r2902 rjek - /trunk/netsurf/gtk/res/netsurf.glade
by netsurf@semichrome.net
Author: rjek
Date: Tue Aug 29 01:50:29 2006
New Revision: 2902
URL: http://svn.semichrome.net?rev=2902&view=rev
Log:
misc changes to nsgtk's glade window templates
Modified:
trunk/netsurf/gtk/res/netsurf.glade
Modified: trunk/netsurf/gtk/res/netsurf.glade
URL: http://svn.semichrome.net/trunk/netsurf/gtk/res/netsurf.glade?rev=2902&r1...
==============================================================================
--- trunk/netsurf/gtk/res/netsurf.glade (original)
+++ trunk/netsurf/gtk/res/netsurf.glade Tue Aug 29 01:50:29 2006
@@ -48,7 +48,7 @@
<accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image449">
+ <widget class="GtkImage" id="image465">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
@@ -82,7 +82,7 @@
<accelerator key="F" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image450">
+ <widget class="GtkImage" id="image466">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
@@ -104,7 +104,7 @@
<accelerator key="W" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image451">
+ <widget class="GtkImage" id="image467">
<property name="visible">True</property>
<property name="stock">gtk-close</property>
<property name="icon_size">1</property>
@@ -133,7 +133,7 @@
<accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image452">
+ <widget class="GtkImage" id="image468">
<property name="visible">True</property>
<property name="stock">gtk-save-as</property>
<property name="icon_size">1</property>
@@ -203,7 +203,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image453">
+ <widget class="GtkImage" id="image469">
<property name="visible">True</property>
<property name="stock">gtk-print-preview</property>
<property name="icon_size">1</property>
@@ -226,7 +226,7 @@
<accelerator key="P" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image454">
+ <widget class="GtkImage" id="image470">
<property name="visible">True</property>
<property name="stock">gtk-print</property>
<property name="icon_size">1</property>
@@ -350,7 +350,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image455">
+ <widget class="GtkImage" id="image471">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
@@ -384,7 +384,7 @@
<accelerator key="Escape" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image456">
+ <widget class="GtkImage" id="image472">
<property name="visible">True</property>
<property name="stock">gtk-stop</property>
<property name="icon_size">1</property>
@@ -405,7 +405,7 @@
<accelerator key="F5" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image457">
+ <widget class="GtkImage" id="image473">
<property name="visible">True</property>
<property name="stock">gtk-refresh</property>
<property name="icon_size">1</property>
@@ -433,7 +433,7 @@
<accelerator key="F11" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image458">
+ <widget class="GtkImage" id="image474">
<property name="visible">True</property>
<property name="stock">gtk-zoom-in</property>
<property name="icon_size">1</property>
@@ -455,7 +455,7 @@
<accelerator key="plus" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image459">
+ <widget class="GtkImage" id="image475">
<property name="visible">True</property>
<property name="stock">gtk-zoom-in</property>
<property name="icon_size">1</property>
@@ -476,7 +476,7 @@
<accelerator key="0" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image460">
+ <widget class="GtkImage" id="image476">
<property name="visible">True</property>
<property name="stock">gtk-zoom-100</property>
<property name="icon_size">1</property>
@@ -497,7 +497,7 @@
<accelerator key="minus" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image461">
+ <widget class="GtkImage" id="image477">
<property name="visible">True</property>
<property name="stock">gtk-zoom-out</property>
<property name="icon_size">1</property>
@@ -623,6 +623,7 @@
<child>
<widget class="GtkMenuItem" id="save_window_size">
<property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Save this window's size and position for use with new windows.</property>
<property name="label" translatable="yes">Save window size</property>
<property name="use_underline">True</property>
</widget>
@@ -649,7 +650,7 @@
<accelerator key="Left" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image462">
+ <widget class="GtkImage" id="image478">
<property name="visible">True</property>
<property name="stock">gtk-go-back</property>
<property name="icon_size">1</property>
@@ -670,7 +671,7 @@
<accelerator key="Right" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image463">
+ <widget class="GtkImage" id="image479">
<property name="visible">True</property>
<property name="stock">gtk-go-forward</property>
<property name="icon_size">1</property>
@@ -691,7 +692,7 @@
<accelerator key="Home" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image464">
+ <widget class="GtkImage" id="image480">
<property name="visible">True</property>
<property name="stock">gtk-home</property>
<property name="icon_size">1</property>
@@ -780,7 +781,7 @@
<accelerator key="F1" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image465">
+ <widget class="GtkImage" id="image481">
<property name="visible">True</property>
<property name="stock">gtk-help</property>
<property name="icon_size">1</property>
@@ -1026,6 +1027,7 @@
<widget class="GtkHPaned" id="hpaned1">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="position">0</property>
<child>
<widget class="GtkLabel" id="statusBar">
@@ -1036,8 +1038,8 @@
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.490000009537</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property>
@@ -1060,7 +1062,7 @@
</widget>
<packing>
<property name="shrink">True</property>
- <property name="resize">True</property>
+ <property name="resize">False</property>
</packing>
</child>
</widget>
17 years
r2901 rjek - in /trunk/netsurf: desktop/options.c gtk/gtk_window.c gtk/res/netsurf.glade
by netsurf@semichrome.net
Author: rjek
Date: Tue Aug 29 01:42:30 2006
New Revision: 2901
URL: http://svn.semichrome.net?rev=2901&view=rev
Log:
Implement user-defined new window placement in nsgtk
Modified:
trunk/netsurf/desktop/options.c
trunk/netsurf/gtk/gtk_window.c
trunk/netsurf/gtk/res/netsurf.glade
Modified: trunk/netsurf/desktop/options.c
URL: http://svn.semichrome.net/trunk/netsurf/desktop/options.c?rev=2901&r1=290...
==============================================================================
--- trunk/netsurf/desktop/options.c (original)
+++ trunk/netsurf/desktop/options.c Tue Aug 29 01:42:30 2006
@@ -107,7 +107,7 @@
int option_window_screen_height = 0;
/** default size of status bar vs. h scroll bar */
#ifdef nsgtk
-int option_toolbar_status_width = 5;
+int option_toolbar_status_width = 400;
#else
int option_toolbar_status_width = 6667;
#endif
Modified: trunk/netsurf/gtk/gtk_window.c
URL: http://svn.semichrome.net/trunk/netsurf/gtk/gtk_window.c?rev=2901&r1=2900...
==============================================================================
--- trunk/netsurf/gtk/gtk_window.c (original)
+++ trunk/netsurf/gtk/gtk_window.c Tue Aug 29 01:42:30 2006
@@ -53,6 +53,7 @@
GtkMenuItem *stop_menu;
GtkMenuItem *reload_menu;
GtkImage *throbber;
+ GtkPaned *status_pane;
GladeXML *xml;
@@ -147,6 +148,7 @@
MENUPROTO(zoom_in);
MENUPROTO(normal_size);
MENUPROTO(zoom_out);
+MENUPROTO(save_window_size);
/* navigate menu */
MENUPROTO(back);
@@ -176,6 +178,7 @@
MENUEVENT(zoom_in),
MENUEVENT(normal_size),
MENUEVENT(zoom_out),
+ MENUEVENT(save_window_size),
/* navigate menu */
MENUEVENT(back),
@@ -591,6 +594,21 @@
struct gui_window *gw = g;
nsgtk_window_change_scale(gw, gw->scale - 0.05);
+
+ return TRUE;
+}
+
+MENUHANDLER(save_window_size)
+{
+ struct gui_window *gw = g;
+
+ option_toolbar_status_width = gtk_paned_get_position(gw->status_pane);
+ gtk_window_get_position(gw->window, &option_window_x, &option_window_y);
+ gtk_window_get_size(gw->window, &option_window_width,
+ &option_window_height);
+
+
+ options_write(options_file_location);
return TRUE;
}
@@ -731,6 +749,21 @@
g->reload_menu = GTK_MENU_ITEM(GET_WIDGET("reload"));
g->throbber = GTK_IMAGE(GET_WIDGET("throbber"));
g->viewport = GTK_VIEWPORT(GET_WIDGET("viewport1"));
+ g->status_pane = GTK_PANED(GET_WIDGET("hpaned1"));
+
+ /* set this window's size and position to what's in the options, or
+ * or some sensible default if they're not set yet.
+ */
+ if (option_window_width > 0) {
+ gtk_window_move(g->window, option_window_x, option_window_y);
+ gtk_window_resize(g->window, option_window_width,
+ option_window_height);
+ } else {
+ gtk_window_set_default_size(g->window, 600, 600);
+ }
+
+ /* set the size of the hpane with status bar and h scrollbar */
+ gtk_paned_set_position(g->status_pane, option_toolbar_status_width);
/* connect our scrollbars to the viewport */
gtk_viewport_set_hadjustment(g->viewport,
@@ -743,9 +776,6 @@
* glade because of the way it emulates toolbars.
*/
gtk_tool_item_set_expand(GTK_TOOL_ITEM(GET_WIDGET("toolURLBar")), TRUE);
-
- /* set the initial size of the browser window */
- gtk_window_set_default_size(g->window, 600, 600);
/* set the events we're interested in receiving from the browser's
* drawing area.
Modified: trunk/netsurf/gtk/res/netsurf.glade
URL: http://svn.semichrome.net/trunk/netsurf/gtk/res/netsurf.glade?rev=2901&r1...
==============================================================================
--- trunk/netsurf/gtk/res/netsurf.glade (original)
+++ trunk/netsurf/gtk/res/netsurf.glade Tue Aug 29 01:42:30 2006
@@ -48,7 +48,7 @@
<accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image382">
+ <widget class="GtkImage" id="image449">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
@@ -82,7 +82,7 @@
<accelerator key="F" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image383">
+ <widget class="GtkImage" id="image450">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
@@ -104,7 +104,7 @@
<accelerator key="W" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image384">
+ <widget class="GtkImage" id="image451">
<property name="visible">True</property>
<property name="stock">gtk-close</property>
<property name="icon_size">1</property>
@@ -133,7 +133,7 @@
<accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image385">
+ <widget class="GtkImage" id="image452">
<property name="visible">True</property>
<property name="stock">gtk-save-as</property>
<property name="icon_size">1</property>
@@ -203,7 +203,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image386">
+ <widget class="GtkImage" id="image453">
<property name="visible">True</property>
<property name="stock">gtk-print-preview</property>
<property name="icon_size">1</property>
@@ -226,7 +226,7 @@
<accelerator key="P" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image387">
+ <widget class="GtkImage" id="image454">
<property name="visible">True</property>
<property name="stock">gtk-print</property>
<property name="icon_size">1</property>
@@ -350,7 +350,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image388">
+ <widget class="GtkImage" id="image455">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
@@ -384,7 +384,7 @@
<accelerator key="Escape" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image389">
+ <widget class="GtkImage" id="image456">
<property name="visible">True</property>
<property name="stock">gtk-stop</property>
<property name="icon_size">1</property>
@@ -405,7 +405,7 @@
<accelerator key="F5" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image390">
+ <widget class="GtkImage" id="image457">
<property name="visible">True</property>
<property name="stock">gtk-refresh</property>
<property name="icon_size">1</property>
@@ -433,7 +433,7 @@
<accelerator key="F11" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image391">
+ <widget class="GtkImage" id="image458">
<property name="visible">True</property>
<property name="stock">gtk-zoom-in</property>
<property name="icon_size">1</property>
@@ -455,7 +455,7 @@
<accelerator key="plus" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image392">
+ <widget class="GtkImage" id="image459">
<property name="visible">True</property>
<property name="stock">gtk-zoom-in</property>
<property name="icon_size">1</property>
@@ -476,7 +476,7 @@
<accelerator key="0" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image393">
+ <widget class="GtkImage" id="image460">
<property name="visible">True</property>
<property name="stock">gtk-zoom-100</property>
<property name="icon_size">1</property>
@@ -497,7 +497,7 @@
<accelerator key="minus" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image394">
+ <widget class="GtkImage" id="image461">
<property name="visible">True</property>
<property name="stock">gtk-zoom-out</property>
<property name="icon_size">1</property>
@@ -566,7 +566,7 @@
<property name="sensitive">False</property>
<property name="label" translatable="yes">Menu bar</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
</widget>
</child>
@@ -611,6 +611,20 @@
</child>
</widget>
</child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator11">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="save_window_size">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Save window size</property>
+ <property name="use_underline">True</property>
</widget>
</child>
</widget>
@@ -635,7 +649,7 @@
<accelerator key="Left" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image395">
+ <widget class="GtkImage" id="image462">
<property name="visible">True</property>
<property name="stock">gtk-go-back</property>
<property name="icon_size">1</property>
@@ -656,7 +670,7 @@
<accelerator key="Right" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image396">
+ <widget class="GtkImage" id="image463">
<property name="visible">True</property>
<property name="stock">gtk-go-forward</property>
<property name="icon_size">1</property>
@@ -677,7 +691,7 @@
<accelerator key="Home" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image397">
+ <widget class="GtkImage" id="image464">
<property name="visible">True</property>
<property name="stock">gtk-home</property>
<property name="icon_size">1</property>
@@ -766,7 +780,7 @@
<accelerator key="F1" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image398">
+ <widget class="GtkImage" id="image465">
<property name="visible">True</property>
<property name="stock">gtk-help</property>
<property name="icon_size">1</property>
17 years
r2900 rjek - in /trunk/netsurf: desktop/options.c desktop/options.h riscos/options.h
by netsurf@semichrome.net
Author: rjek
Date: Tue Aug 29 01:17:35 2006
New Revision: 2900
URL: http://svn.semichrome.net?rev=2900&view=rev
Log:
Move default window size opens into core for use from nsgtk
Modified:
trunk/netsurf/desktop/options.c
trunk/netsurf/desktop/options.h
trunk/netsurf/riscos/options.h
Modified: trunk/netsurf/desktop/options.c
URL: http://svn.semichrome.net/trunk/netsurf/desktop/options.c?rev=2900&r1=289...
==============================================================================
--- trunk/netsurf/desktop/options.c (original)
+++ trunk/netsurf/desktop/options.c Tue Aug 29 01:17:35 2006
@@ -93,6 +93,25 @@
char *option_homepage_url = 0;
/** URL completion in url bar */
bool option_url_suggestion = true;
+/** default x position of new windows */
+int option_window_x = 0;
+/** default y position of new windows */
+int option_window_y = 0;
+/** default width of new windows */
+int option_window_width = 0;
+/** default height of new windows */
+int option_window_height = 0;
+/** width of screen when above options were saved */
+int option_window_screen_width = 0;
+/** height of screen when above options were saved */
+int option_window_screen_height = 0;
+/** default size of status bar vs. h scroll bar */
+#ifdef nsgtk
+int option_toolbar_status_width = 5;
+#else
+int option_toolbar_status_width = 6667;
+#endif
+
/* Fetcher configuration */
/** Maximum simultaneous active fetchers */
int option_max_fetchers = 24;
@@ -142,6 +161,13 @@
{ "cookie_jar", OPTION_STRING, &option_cookie_jar },
{ "homepage_url", OPTION_STRING, &option_homepage_url },
{ "url_suggestion", OPTION_BOOL, &option_url_suggestion },
+ { "window_x", OPTION_INTEGER, &option_window_x },
+ { "window_y", OPTION_INTEGER, &option_window_y },
+ { "window_width", OPTION_INTEGER, &option_window_width },
+ { "window_height", OPTION_INTEGER, &option_window_height },
+ { "window_screen_width", OPTION_INTEGER, &option_window_screen_width },
+ { "window_screen_height", OPTION_INTEGER, &option_window_screen_height },
+ { "toolbar_status_size", OPTION_INTEGER, &option_toolbar_status_width },
/* Fetcher options */
{ "max_fetchers", OPTION_INTEGER, &option_max_fetchers },
{ "max_fetchers_per_host",
Modified: trunk/netsurf/desktop/options.h
URL: http://svn.semichrome.net/trunk/netsurf/desktop/options.h?rev=2900&r1=289...
==============================================================================
--- trunk/netsurf/desktop/options.h (original)
+++ trunk/netsurf/desktop/options.h Tue Aug 29 01:17:35 2006
@@ -58,6 +58,13 @@
extern char *option_cookie_jar;
extern char *option_homepage_url;
extern bool option_url_suggestion;
+extern int option_window_x;
+extern int option_window_y;
+extern int option_window_width;
+extern int option_window_height;
+extern int option_window_screen_width;
+extern int option_window_screen_height;
+extern int option_toolbar_status_width;
/* Fetcher configuration. */
extern int option_max_fetchers;
Modified: trunk/netsurf/riscos/options.h
URL: http://svn.semichrome.net/trunk/netsurf/riscos/options.h?rev=2900&r1=2899...
==============================================================================
--- trunk/netsurf/riscos/options.h (original)
+++ trunk/netsurf/riscos/options.h Tue Aug 29 01:17:35 2006
@@ -24,7 +24,6 @@
extern int option_bg_plot_style; /* tinct flagword */
extern bool option_history_tooltip;
extern int option_scale;
-extern int option_toolbar_status_width;
extern bool option_toolbar_show_status;
extern bool option_toolbar_show_buttons;
extern bool option_toolbar_show_address;
@@ -33,12 +32,6 @@
extern char *option_toolbar_hotlist;
extern char *option_toolbar_history;
extern char *option_toolbar_cookies;
-extern int option_window_x;
-extern int option_window_y;
-extern int option_window_width;
-extern int option_window_height;
-extern int option_window_screen_width;
-extern int option_window_screen_height;
extern bool option_window_stagger;
extern bool option_window_size_clone;
extern bool option_background_images;
@@ -70,7 +63,6 @@
int option_bg_plot_style = tinct_DITHER;\
bool option_history_tooltip = true; \
int option_scale = 100; \
-int option_toolbar_status_width = 6667; \
bool option_toolbar_show_status = true; \
bool option_toolbar_show_buttons = true; \
bool option_toolbar_show_address = true; \
@@ -79,12 +71,6 @@
char *option_toolbar_hotlist = 0; \
char *option_toolbar_history = 0; \
char *option_toolbar_cookies = 0; \
-int option_window_x = 0; \
-int option_window_y = 0; \
-int option_window_width = 0; \
-int option_window_height = 0; \
-int option_window_screen_width = 0; \
-int option_window_screen_height = 0; \
bool option_window_stagger = true; \
bool option_window_size_clone = true; \
bool option_background_images = true; \
@@ -125,12 +111,6 @@
{ "toolbar_hotlist", OPTION_STRING, &option_toolbar_hotlist }, \
{ "toolbar_history", OPTION_STRING, &option_toolbar_history }, \
{ "toolbar_cookies", OPTION_STRING, &option_toolbar_cookies }, \
-{ "window_x", OPTION_INTEGER, &option_window_x }, \
-{ "window_y", OPTION_INTEGER, &option_window_y }, \
-{ "window_width", OPTION_INTEGER, &option_window_width }, \
-{ "window_height", OPTION_INTEGER, &option_window_height }, \
-{ "window_screen_width", OPTION_INTEGER, &option_window_screen_width }, \
-{ "window_screen_height", OPTION_INTEGER, &option_window_screen_height }, \
{ "window_stagger", OPTION_BOOL, &option_window_stagger }, \
{ "window_size_clone", OPTION_BOOL, &option_window_size_clone }, \
{ "background_images", OPTION_BOOL, &option_background_images }, \
17 years
r2899 rjek - /trunk/netsurf/gtk/gtk_window.c
by netsurf@semichrome.net
Author: rjek
Date: Mon Aug 28 21:36:01 2006
New Revision: 2899
URL: http://svn.semichrome.net?rev=2899&view=rev
Log:
Set caret position in URL bar to the end when core updates it
Modified:
trunk/netsurf/gtk/gtk_window.c
Modified: trunk/netsurf/gtk/gtk_window.c
URL: http://svn.semichrome.net/trunk/netsurf/gtk/gtk_window.c?rev=2899&r1=2898...
==============================================================================
--- trunk/netsurf/gtk/gtk_window.c (original)
+++ trunk/netsurf/gtk/gtk_window.c Mon Aug 28 21:36:01 2006
@@ -1048,6 +1048,7 @@
void gui_window_set_url(struct gui_window *g, const char *url)
{
gtk_entry_set_text(g->url_bar, url);
+ gtk_editable_set_position(GTK_EDITABLE(g->url_bar), -1);
}
void gui_window_start_throbber(struct gui_window* g)
17 years
r2898 rjek - /trunk/netsurf/gtk/gtk_window.c
by netsurf@semichrome.net
Author: rjek
Date: Mon Aug 28 21:31:21 2006
New Revision: 2898
URL: http://svn.semichrome.net?rev=2898&view=rev
Log:
Make nsgtk's gui_window_remove_caret actually remove the caret
Modified:
trunk/netsurf/gtk/gtk_window.c
Modified: trunk/netsurf/gtk/gtk_window.c
URL: http://svn.semichrome.net/trunk/netsurf/gtk/gtk_window.c?rev=2898&r1=2897...
==============================================================================
--- trunk/netsurf/gtk/gtk_window.c (original)
+++ trunk/netsurf/gtk/gtk_window.c Mon Aug 28 21:31:21 2006
@@ -1093,11 +1093,15 @@
void gui_window_remove_caret(struct gui_window *g)
{
- if (g->careth == 0)
+ int oh = g->careth;
+
+ if (oh == 0)
return;
+ g->careth = 0;
+
gui_window_redraw(g, g->caretx, g->carety,
- g->caretx, g->carety + g->careth);
+ g->caretx, g->carety + oh);
}
void gui_window_new_content(struct gui_window *g)
17 years
r2897 rjek - /trunk/netsurf/gtk/gtk_window.c
by netsurf@semichrome.net
Author: rjek
Date: Mon Aug 28 21:24:45 2006
New Revision: 2897
URL: http://svn.semichrome.net?rev=2897&view=rev
Log:
Force nsgtk caret plotting to use GDK. Move plotting to stand-alone function.
Modified:
trunk/netsurf/gtk/gtk_window.c
Modified: trunk/netsurf/gtk/gtk_window.c
URL: http://svn.semichrome.net/trunk/netsurf/gtk/gtk_window.c?rev=2897&r1=2896...
==============================================================================
--- trunk/netsurf/gtk/gtk_window.c (original)
+++ trunk/netsurf/gtk/gtk_window.c Mon Aug 28 21:24:45 2006
@@ -94,6 +94,7 @@
static wchar_t gdkkey_to_nskey(GdkEventKey *);
static void nsgtk_window_destroy_event(GtkWidget *, gpointer);
+static void nsgtk_plot_caret(int x, int y, int h);
static gboolean nsgtk_window_expose_event(GtkWidget *, GdkEventExpose *,
gpointer);
static gboolean nsgtk_window_motion_notify_event(GtkWidget *, GdkEventMotion *,
@@ -259,6 +260,24 @@
gui_window_destroy(g);
}
+/** Plot a caret. It is assumed that the plotters have been set up. */
+void nsgtk_plot_caret(int x, int y, int h)
+{
+ GdkColor colour;
+
+ colour.red = 0;
+ colour.green = 0;
+ colour.blue = 0;
+ colour.pixel = 0;
+ gdk_color_alloc(gdk_colormap_get_system(),
+ &colour);
+ gdk_gc_set_foreground(current_gc, &colour);
+
+ gdk_draw_line(current_drawable, current_gc,
+ x, y,
+ x, y + h - 1);
+}
+
gboolean nsgtk_window_expose_event(GtkWidget *widget,
GdkEventExpose *event, gpointer data)
{
@@ -287,8 +306,7 @@
g->scale, 0xFFFFFF);
if (g->careth != 0)
- plot.line(g->caretx, g->carety,
- g->caretx, g->carety + g->careth, 1, 0, false, false);
+ nsgtk_plot_caret(g->caretx, g->carety, g->careth);
g_object_unref(current_gc);
#ifdef CAIRO_VERSION
17 years
r2896 bursa - /trunk/netsurf/desktop/browser.c
by netsurf@semichrome.net
Author: bursa
Date: Mon Aug 28 20:35:12 2006
New Revision: 2896
URL: http://svn.semichrome.net?rev=2896&view=rev
Log:
Use browser_window_remove_caret() instead of resetting caret-related callbacks directly.
Modified:
trunk/netsurf/desktop/browser.c
Modified: trunk/netsurf/desktop/browser.c
URL: http://svn.semichrome.net/trunk/netsurf/desktop/browser.c?rev=2896&r1=289...
==============================================================================
--- trunk/netsurf/desktop/browser.c (original)
+++ trunk/netsurf/desktop/browser.c Mon Aug 28 20:35:12 2006
@@ -326,9 +326,7 @@
}
bw->current_content = c;
bw->loading_content = NULL;
- bw->caret_callback = NULL;
- bw->paste_callback = NULL;
- bw->move_callback = NULL;
+ browser_window_remove_caret(bw);
bw->scrolling_box = NULL;
gui_window_new_content(bw->window);
if (bw->frag_id)
@@ -392,9 +390,7 @@
bw->loading_content = 0;
else if (c == bw->current_content) {
bw->current_content = 0;
- bw->caret_callback = NULL;
- bw->paste_callback = NULL;
- bw->move_callback = NULL;
+ browser_window_remove_caret(bw);
bw->scrolling_box = NULL;
selection_init(bw->sel, NULL);
}
@@ -445,9 +441,7 @@
bw->loading_content = 0;
else if (c == bw->current_content) {
bw->current_content = 0;
- bw->caret_callback = NULL;
- bw->paste_callback = NULL;
- bw->move_callback = NULL;
+ browser_window_remove_caret(bw);
bw->scrolling_box = NULL;
selection_init(bw->sel, NULL);
}
@@ -464,9 +458,7 @@
bw->loading_content = 0;
else if (c == bw->current_content) {
bw->current_content = 0;
- bw->caret_callback = NULL;
- bw->paste_callback = NULL;
- bw->move_callback = NULL;
+ browser_window_remove_caret(bw);
bw->scrolling_box = NULL;
selection_init(bw->sel, NULL);
}
@@ -1145,9 +1137,7 @@
if (selection_click(bw->sel, mouse, text_box->byte_offset + idx)) {
/* key presses must be directed at the main browser
* window, paste text operations ignored */
- bw->caret_callback = NULL;
- bw->paste_callback = NULL;
- bw->move_callback = NULL;
+ browser_window_remove_caret(bw);
if (selection_dragging(bw->sel)) {
bw->drag_type = DRAGGING_SELECTION;
17 years
r2894 jmb - /trunk/netsurf/riscos/filetype.c
by netsurf@semichrome.net
Author: jmb
Date: Fri Aug 25 23:46:38 2006
New Revision: 2894
URL: http://svn.semichrome.net?rev=2894&view=rev
Log:
Make fetch_mimetype consider our internal mapping table
Modified:
trunk/netsurf/riscos/filetype.c
Modified: trunk/netsurf/riscos/filetype.c
URL: http://svn.semichrome.net/trunk/netsurf/riscos/filetype.c?rev=2894&r1=289...
==============================================================================
--- trunk/netsurf/riscos/filetype.c (original)
+++ trunk/netsurf/riscos/filetype.c Fri Aug 25 23:46:38 2006
@@ -152,6 +152,7 @@
int objtype;
char *mime = calloc(BUF_SIZE, sizeof(char));
char *slash;
+ struct type_entry *t;
if (!mime) {
LOG(("Insufficient memory for calloc"));
@@ -193,6 +194,16 @@
filetype = load;
}
+ /* search for MIME type in our internal table */
+ t = bsearch(&filetype, type_map, TYPE_MAP_COUNT,
+ sizeof(type_map[0]), cmp_type);
+ if (t) {
+ /* found, so return it */
+ strncpy(mime, t->mime_type, BUF_SIZE);
+ return mime;
+ }
+
+ /* not in internal table, so ask MimeMap */
e = xmimemaptranslate_filetype_to_mime_type(filetype, mime);
if (e) {
LOG(("xmimemaptranslate_filetype_to_mime_type: 0x%x: %s",
17 years