anjuta r3805 - in trunk: . src



Author: jhs
Date: Mon Mar 31 13:59:49 2008
New Revision: 3805
URL: http://svn.gnome.org/viewvc/anjuta?rev=3805&view=rev

Log:
2008-03-31  Johannes Schmid  <jhs gnome org>

	patch by: Carl-Anton Ingmarsson:
	* src/anjuta-app.c (style, on_toolbar_style_changed,
	  on_add_merge_widget, anjuta_app_instance_init):
	* src/anjuta.glade:
	
	#470483 â Make toolbar type (icon/text/both) independet from GNOME settings

Modified:
   trunk/ChangeLog
   trunk/src/anjuta-app.c
   trunk/src/anjuta.glade

Modified: trunk/src/anjuta-app.c
==============================================================================
--- trunk/src/anjuta-app.c	(original)
+++ trunk/src/anjuta-app.c	Mon Mar 31 13:59:49 2008
@@ -65,6 +65,53 @@
 
 static gpointer parent_class = NULL;
 static GList* toolbars = NULL;
+static GtkToolbarStyle style = -1;
+
+static void
+on_toolbar_style_changed (GConfClient* client, guint id, GConfEntry* entry,
+						  gpointer user_data)
+{
+	AnjutaApp* app = ANJUTA_APP (user_data);
+	GList *node = toolbars;
+	
+	char* tb_style = anjuta_preferences_get (app->preferences, "anjuta.toolbar.style");
+	
+	if (tb_style)
+	{	
+		if (strcasecmp (tb_style, "Default") == 0)
+			style = -1;
+		else if (strcasecmp (tb_style, "Both") == 0)
+			style = GTK_TOOLBAR_BOTH;
+		else if (strcasecmp (tb_style, "Horiz") == 0)
+			style = GTK_TOOLBAR_BOTH_HORIZ;
+		else if (strcasecmp (tb_style, "Icons") == 0)
+			style = GTK_TOOLBAR_ICONS;
+		else if (strcasecmp (tb_style, "Text") == 0)
+			style = GTK_TOOLBAR_TEXT;
+		
+		DEBUG_PRINT ("Toolbar style: %s", tb_style);
+		
+		g_free(tb_style);
+	}
+	
+	if (style != -1)
+	{
+		while (node)
+		{
+			gtk_toolbar_set_style (GTK_TOOLBAR (node->data), style);
+			node = node->next;
+		}
+	}
+	else
+	{
+		while (node)
+		{
+			gtk_toolbar_unset_style (GTK_TOOLBAR (node->data));
+			node = node->next;
+		}
+	}
+}
+	
 
 static void
 on_gdl_style_changed (GConfClient* client, guint id, GConfEntry* entry,
@@ -256,6 +303,10 @@
 		/* Showing the arrows seem to break anything completly! */
 		gtk_toolbar_set_show_arrow (GTK_TOOLBAR (widget), FALSE);
 		
+		/* Set the toolbar style */
+		if (style != -1)
+			gtk_toolbar_set_style(GTK_TOOLBAR (widget), style);
+		
 		gtk_widget_show (widget);
 		g_object_set_data (G_OBJECT (widget), "app", ui_container);
 		
@@ -611,6 +662,11 @@
 	
 	on_gdl_style_changed (NULL, 0, NULL, app);
 	
+	anjuta_preferences_notify_add (app->preferences, "anjuta.toolbar.style",
+								   on_toolbar_style_changed, app, NULL);
+	
+	on_toolbar_style_changed (NULL, 0, NULL, app);
+	
 	/* Register actions */
 	anjuta_ui_add_action_group_entries (app->ui, "ActionGroupFile", _("File"),
 										menu_entries_file,

Modified: trunk/src/anjuta.glade
==============================================================================
--- trunk/src/anjuta.glade	(original)
+++ trunk/src/anjuta.glade	Mon Mar 31 13:59:49 2008
@@ -32,88 +32,85 @@
                         <property name="column_spacing">5</property>
                         <property name="row_spacing">5</property>
                         <child>
-                          <widget class="GtkEntry" id="preferences_entry:text::0:anjuta.user.name">
+                          <widget class="GtkLabel" id="label2">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="invisible_char">*</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Default project directory:</property>
                           </widget>
                           <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
-                            <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
                             <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="preferences_entry:text::0:anjuta.user.email">
+                          <widget class="GnomeFileEntry" id="fileentry1">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="invisible_char">*</property>
+                            <property name="directory_entry">True</property>
+                            <property name="use_filechooser">True</property>
+                            <property name="filechooser_action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+                            <property name="max_saved">10</property>
+                            <child internal-child="entry">
+                              <widget class="GtkEntry" id="fileentry1-entry3">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                              </widget>
+                            </child>
                           </widget>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
-                            <property name="top_attach">2</property>
-                            <property name="bottom_attach">3</property>
                             <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="label4">
+                          <widget class="GtkLabel" id="label3">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Developer email address:</property>
+                            <property name="label" translatable="yes">Developer name:</property>
                           </widget>
                           <packing>
-                            <property name="top_attach">2</property>
-                            <property name="bottom_attach">3</property>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
                             <property name="x_options">GTK_FILL</property>
                             <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="label3">
+                          <widget class="GtkLabel" id="label4">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Developer name:</property>
+                            <property name="label" translatable="yes">Developer email address:</property>
                           </widget>
                           <packing>
-                            <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
                             <property name="x_options">GTK_FILL</property>
                             <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GnomeFileEntry" id="fileentry1">
+                          <widget class="GtkEntry" id="preferences_entry:text::0:anjuta.user.email">
                             <property name="visible">True</property>
-                            <property name="directory_entry">True</property>
-                            <property name="use_filechooser">True</property>
-                            <property name="filechooser_action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
-                            <property name="max_saved">10</property>
-                            <child internal-child="entry">
-                              <widget class="GtkEntry" id="fileentry1-entry3">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="invisible_char">*</property>
-                              </widget>
-                            </child>
+                            <property name="can_focus">True</property>
                           </widget>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
                             <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="label2">
+                          <widget class="GtkEntry" id="preferences_entry:text::0:anjuta.user.name">
                             <property name="visible">True</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Default project directory:</property>
+                            <property name="can_focus">True</property>
                           </widget>
                           <packing>
-                            <property name="x_options">GTK_FILL</property>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
                             <property name="y_options"></property>
                           </packing>
                         </child>
@@ -209,40 +206,68 @@
                     <property name="visible">True</property>
                     <property name="left_padding">12</property>
                     <child>
-                      <widget class="GtkVBox" id="vbox3">
+                      <widget class="GtkTable" id="table2">
                         <property name="visible">True</property>
-                        <property name="border_width">10</property>
-                        <property name="spacing">5</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="n_rows">2</property>
+                        <property name="n_columns">2</property>
+                        <property name="column_spacing">5</property>
+                        <property name="row_spacing">5</property>
                         <child>
-                          <widget class="GtkHBox" id="hbox1">
+                          <widget class="GtkComboBox" id="preferences_combo:text:Text,Icon,Both,Toolbar,Tabs:2:anjuta.gdl.style">
                             <property name="visible">True</property>
-                            <child>
-                              <widget class="GtkLabel" id="label8">
-                                <property name="visible">True</property>
-                                <property name="label" translatable="yes" comments="Style of the buttons/tabs used to select docked windows in anjuta">Dock switcher style: </property>
-                              </widget>
-                              <packing>
-                                <property name="expand">False</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="GtkComboBox" id="preferences_combo:text:Text,Icon,Both,Toolbar,Tabs:2:anjuta.gdl.style">
-                                <property name="visible">True</property>
-                                <property name="items" translatable="yes">Text
+                            <property name="items" translatable="yes">Text
 Icons
 Text + Icons
 Gnome toolbar setting
 Tabs</property>
-                              </widget>
-                              <packing>
-                                <property name="fill">False</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
                           </widget>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkComboBox" id="preferences_combo:text:Default,Both,Horiz,Icons,Text:0:anjuta.toolbar.style">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="items" translatable="yes">Default
+Text below icons
+Text beside icons
+Icons only
+Text only</property>
+                          </widget>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="y_options"></property>
+                          </packing>
                         </child>
                         <child>
-                          <placeholder/>
+                          <widget class="GtkLabel" id="label6">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="label" translatable="yes" comments="translators: translate the same as in gnome-control-center">Toolbar button labels:</property>
+                          </widget>
+                          <packing>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label8">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes" comments="Style of the buttons/tabs used to select docked windows in anjuta">Dock switcher style: </property>
+                          </widget>
+                          <packing>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
                         </child>
                       </widget>
                     </child>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]