From 8043344eb849cfc124a924fc5c3476a54db87c07 Mon Sep 17 00:00:00 2001 From: Rob Kendrick Date: Sat, 4 Nov 2006 23:38:18 +0000 Subject: Finish GTK about box svn path=/trunk/netsurf/; revision=3030 --- gtk/gtk_gui.c | 25 +++ gtk/gtk_gui.h | 4 + gtk/gtk_window.c | 27 +++ gtk/res/netsurf.glade | 504 +++++++++++++++++++++++++++----------------------- 4 files changed, 325 insertions(+), 235 deletions(-) (limited to 'gtk') diff --git a/gtk/gtk_gui.c b/gtk/gtk_gui.c index 686e01775..413d3320a 100644 --- a/gtk/gtk_gui.c +++ b/gtk/gtk_gui.c @@ -55,7 +55,11 @@ char *glade_file_location; struct gui_window *search_current_window = 0; +GtkWindow *wndAbout; + GladeXML *gladeWindows; +GtkWindow *wndTooltip; +GtkLabel *labelTooltip; /** * Locate a shared resource file by searching known places in order. @@ -152,6 +156,9 @@ void gui_init(int argc, char** argv) if (gladeWindows == NULL) die("Unable to load Glade window definitions.\n"); glade_xml_signal_autoconnect(gladeWindows); + + wndTooltip = glade_xml_get_widget(gladeWindows, "wndTooltip"); + labelTooltip = glade_xml_get_widget(gladeWindows, "tooltip"); nsgtk_completion_init(); @@ -212,6 +219,13 @@ void gui_init(int argc, char** argv) urldb_load(option_url_file); urldb_load_cookies(option_cookie_file); + wndAbout = GTK_WINDOW(glade_xml_get_widget(gladeWindows, "wndAbout")); + gtk_label_set_text(GTK_LABEL( + glade_xml_get_widget(gladeWindows, "labelVersion")), + netsurf_version); + gtk_image_set_from_file(GTK_IMAGE( + glade_xml_get_widget(gladeWindows, "imageLogo")), + find_resource(buf, "netsurf-logo.png", "netsurf-logo.png")); nsgtk_history_init(); } @@ -328,6 +342,17 @@ void gui_download_window_done(struct gui_download_window *dw) void gui_create_form_select_menu(struct browser_window *bw, struct form_control *control) { + + int i; + struct form_option *option; + + LOG(("Trying to open select menu...")); + + for (i = 0, option = control->data.select.items; option; + i++, option = option->next) { + LOG(("Option: %s", option->text)); + } + } void gui_window_save_as_link(struct gui_window *g, struct content *c) diff --git a/gtk/gtk_gui.h b/gtk/gtk_gui.h index 3b8850445..30e0cb06f 100644 --- a/gtk/gtk_gui.h +++ b/gtk/gtk_gui.h @@ -14,3 +14,7 @@ extern GladeXML *gladeWindows; extern char *glade_file_location; extern char *options_file_location; +extern GtkWindow *wndAbout; + +extern GtkWindow *wndTooltip; +extern GtkLabel *labelTooltip; diff --git a/gtk/gtk_window.c b/gtk/gtk_window.c index 199bf0f2c..c13efabdd 100644 --- a/gtk/gtk_window.c +++ b/gtk/gtk_window.c @@ -646,6 +646,8 @@ MENUHANDLER(global_history) MENUHANDLER(about) { + gtk_widget_show(GTK_WIDGET(wndAbout)); + gdk_window_raise(GDK_WINDOW(wndAbout)); return TRUE; } @@ -676,6 +678,31 @@ gboolean nsgtk_history_expose_event(GtkWidget *widget, gboolean nsgtk_history_motion_notify_event(GtkWidget *widget, GdkEventMotion *event, gpointer g) { + /* if we're hovering over a history item, popup our tooltip bodge + * describing the page. + */ + struct gtk_history_window *gw = g; + const char *url; + int winx, winy; + +// if (!option_history_tooltip) +// return TRUE; + + url = history_position_url(gw->g->bw->history, event->x, event->y); + if (url == NULL) { + gtk_widget_hide(wndTooltip); + return TRUE; + } + + gtk_label_set_text(labelTooltip, url); + gtk_window_get_position(gw->g->window, &winx, &winy); + + LOG(("winx = %d, winy = %d, event->x = %d, event->y = %d", + winx, winy, event->x, event->y)); + + gtk_widget_show(GTK_WIDGET(wndTooltip)); + gtk_window_move(wndTooltip, event->x + winx, event->y + winy); + return TRUE; } diff --git a/gtk/res/netsurf.glade b/gtk/res/netsurf.glade index 09fda24fc..16603ccb7 100644 --- a/gtk/res/netsurf.glade +++ b/gtk/res/netsurf.glade @@ -824,7 +824,6 @@ True gtk-about True - @@ -4693,266 +4692,219 @@ Fantasy About NetSurf GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE + GTK_WIN_POS_CENTER False True False True False False - GDK_WINDOW_TYPE_HINT_DIALOG + GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True False - + - - + + 5 True False 0 - - + + + + 0 + False + False + + - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - - - + + + True + Version Number + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 False - True - GTK_PACK_END + False - - 6 + + 4 True - False - 0 + True + True + True + GTK_POS_TOP + False + False - + True - False - 0 - - - - True - netsurf-logo.png - 0.5 - 0.5 - 0 - 0 - - - 6 - True - True - - + True + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT - + True True - <b>Test Version</b> - False - True - GTK_JUSTIFY_LEFT - False - True - 0.5 - 0.660000026226 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + False + False + False + GTK_JUSTIFY_LEFT + GTK_WRAP_WORD + False + 0 + 0 + 0 + 0 + 0 + 0 + Kevin Bagust, John M Bell, James Bursa, Matthew Hambley, Rob Jackson, Rob Kendrick, Jeffrey Lee, Adrian Lees, Phil Mellor, Philip Pemberton, Daniel Silverstone, Andrew Timmins, John Tytgat, and Richard Wilson. - - 0 - True - False - - 4 - False - False + False + True - + + True + Written by + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + True True - True - True - GTK_POS_TOP - False - False + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT - + True True - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - False - 0 - 0 - 0 - 0 - 0 - 0 - Kevin Bagust, John M Bell, James Bursa, Matthew Hambley, Rob Jackson, Rob Kendrick, Jeffrey Lee, Adrian Lees, Phil Mellor, Philip Pemberton, Daniel Silverstone, Andrew Timmins, John Tytgat, and Richard Wilson. - - - - - False - True - - - - - - True - Written by - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + False + False + False + GTK_JUSTIFY_LEFT + GTK_WRAP_WORD + False + 0 + 0 + 0 + 0 + 0 + 0 + Sebastian Barthel, Bruno D'Arcangeli, Michael Drake, Andrew Duffell, Richard Hallas, Gerard van Katwijk, Jérôme Mathevet, and Simon Voortman. - - tab - + + + False + True + + - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - False - 0 - 0 - 0 - 0 - 0 - 0 - Sebastian Barthel, Bruno D'Arcangeli, Michael Drake, Andrew Duffell, Richard Hallas, Gerard van Katwijk, Jérôme Mathevet, and Simon Voortman. - - - - - False - True - - + + + True + Graphics/Translations by + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + - - - True - Graphics/Translations by - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT - + True True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - False - 0 - 0 - 0 - 0 - 0 - 0 - GNU GENERAL PUBLIC LICENSE + False + False + False + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + False + 0 + 0 + 0 + 0 + 0 + 0 + GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., @@ -5232,49 +5184,131 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - - - - False - True - + + + False + True + + + + + + True + Licence + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + + 6 + True + GTK_BUTTONBOX_END + 0 + + + + True + True + True + GTK_RELIEF_NORMAL + True + - + True - Licence - False - False - GTK_JUSTIFY_LEFT - False - False 0.5 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-close + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Close + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + - - tab - - - 0 - True - True - 0 - True - True + False + False -- cgit v1.2.3