[patch] select tab position

Juho Snellman <[email protected]>
Newsgroups gmane.comp.web.galeon.devel
Message-ID <[email protected]>
Attached patch allows selecting the window edge that tabs are shown
along by modifying the /apps/galeon/UI/Tabs/tabbed_position gconf
variable (which was also used by galeon1 for the same purpose). No
configuration UI, as those seem to be out of fashion these days...

-- 
Juho Snellman
galeon-tabbed_edge-2003-03-29.patch (text/plain, 3.3 KB)
Index: galeon.schemas.in
===================================================================
RCS file: /cvsroot/galeon/galeon/galeon.schemas.in,v
retrieving revision 1.142
diff -u -b -r1.142 galeon.schemas.in
--- galeon.schemas.in	8 Mar 2003 18:06:50 -0000	1.142
+++ galeon.schemas.in	29 Mar 2003 14:04:26 -0000
@@ -447,6 +447,18 @@
         </locale>
       </schema>
       <schema>
+        <key>/schemas/apps/galeon/UI/Tabs/tabbed_position</key>
+        <applyto>/apps/galeon/UI/Tabs/tabbed_position</applyto>
+        <owner>galeon</owner>
+        <type>int</type>
+        <default>2</default>
+        <locale name="C">
+        <short>Edge of window used for tabs</short>
+        <long>Edge of window used for tabs. 0 is left, 1 is right, 2 is top, and 3 is bottom.
+        </long>
+        </locale>
+      </schema>
+      <schema>
         <key>/schemas/apps/galeon/UI/Windows/show_toolbars_in_fullscreen</key>
         <applyto>/apps/galeon/UI/Windows/show_toolbars_in_fullscreen</applyto>
         <owner>galeon</owner>
Index: src/galeon-window.c
===================================================================
RCS file: /cvsroot/galeon/galeon/src/galeon-window.c,v
retrieving revision 1.151
diff -u -b -r1.151 galeon-window.c
--- src/galeon-window.c	20 Mar 2003 01:29:17 -0000	1.151
+++ src/galeon-window.c	29 Mar 2003 14:04:35 -0000
@@ -410,11 +410,22 @@
 	return popup;
 }
 
+static void
+tabbed_position_gconf_changed_cb(GConfClient *client,
+                             guint cnxn_id,
+                             GConfEntry *entry,
+                             GtkNotebook *notebook)
+{
+	GtkPositionType position = eel_gconf_get_integer (CONF_TABS_TABBED_EDGE);    
+	gtk_notebook_set_tab_pos (notebook, position);
+}
+
 static GtkNotebook *
 setup_notebook (GaleonWindow *window)
 {
 	GtkNotebook *notebook;
 	GtkPolicyType policy;
+	GtkPositionType position = eel_gconf_get_integer (CONF_TABS_TABBED_EDGE);
 
 	policy = eel_gconf_get_boolean (CONF_TABS_TABBED_ALWAYS_SHOW)
 		 ? GTK_POLICY_ALWAYS
@@ -423,6 +434,7 @@
 	notebook = GTK_NOTEBOOK (gul_notebook_new ());
 	gtk_notebook_set_scrollable (notebook, TRUE);
 	gtk_notebook_set_show_border (notebook, FALSE);
+	gtk_notebook_set_tab_pos (notebook, position);
 	gul_notebook_set_policy (GUL_NOTEBOOK (notebook), policy);
 	gtk_notebook_popup_enable (notebook);
 
@@ -435,6 +447,10 @@
 			  G_CALLBACK (galeon_window_tab_detached_cb), 
 			  window);
 
+	eel_gconf_notification_add(CONF_TABS_TABBED_EDGE,
+				   (GConfClientNotifyFunc)tabbed_position_gconf_changed_cb,
+				   notebook);
+    
 	gtk_widget_show (GTK_WIDGET (notebook));
 
 	return notebook;
Index: utils/prefs-strings.h
===================================================================
RCS file: /cvsroot/galeon/galeon/utils/prefs-strings.h,v
retrieving revision 1.24
diff -u -b -r1.24 prefs-strings.h
--- utils/prefs-strings.h	20 Feb 2003 14:49:29 -0000	1.24
+++ utils/prefs-strings.h	29 Mar 2003 14:04:36 -0000
@@ -32,6 +32,7 @@
 #define CONF_TABS_TABBED_LOADING_COLOR "/apps/galeon/UI/Tabs/tabbed_loading_color"
 #define CONF_TABS_TABBED_NEW_COLOR "/apps/galeon/UI/Tabs/tabbed_new_color"
 #define CONF_TABS_TABBED_ALWAYS_SHOW "/apps/galeon/UI/Tabs/tabbed_always_show"
+#define CONF_TABS_TABBED_EDGE "/apps/galeon/UI/Tabs/tabbed_position"
 
 /* Window appeareance */
 #define CONF_WINDOWS_SIDEBAR_PAGE "/apps/galeon/UI/Windows/sidebar_page"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.