gnome-terminal r2538 - trunk/src



Author: chpe
Date: Fri Apr 11 19:01:59 2008
New Revision: 2538
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2538&view=rev

Log:
Move the font selector into glade.


Modified:
   trunk/src/gnome-terminal.glade2
   trunk/src/profile-editor.c

Modified: trunk/src/gnome-terminal.glade2
==============================================================================
--- trunk/src/gnome-terminal.glade2	(original)
+++ trunk/src/gnome-terminal.glade2	Fri Apr 11 19:01:59 2008
@@ -1170,14 +1170,50 @@
 			<widget class="GtkHBox" id="font-hbox">
 			  <property name="visible">True</property>
 			  <property name="homogeneous">False</property>
-			  <property name="spacing">0</property>
+			  <property name="spacing">12</property>
 
 			  <child>
-			    <placeholder/>
+			    <widget class="GtkLabel" id="font-selector-label">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">_Font:</property>
+			      <property name="use_underline">True</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			      <property name="mnemonic_widget">font-selector</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
 			  </child>
 
 			  <child>
-			    <placeholder/>
+			    <widget class="GtkFontButton" id="font-selector">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="title" translatable="yes">Choose A Terminal Font</property>
+			      <property name="show_style">True</property>
+			      <property name="show_size">True</property>
+			      <property name="use_font">True</property>
+			      <property name="use_size">True</property>
+			      <property name="focus_on_click">False</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
 			  </child>
 			</widget>
 			<packing>

Modified: trunk/src/profile-editor.c
==============================================================================
--- trunk/src/profile-editor.c	(original)
+++ trunk/src/profile-editor.c	Fri Apr 11 19:01:59 2008
@@ -1215,34 +1215,18 @@
 
       profile_editor_update_palette (editor, profile);
 
-      w = glade_xml_get_widget (xml, "font-hbox");
-
-      fontsel = gtk_font_button_new ();
+      fontsel = glade_xml_get_widget (xml, "font-selector");
       g_object_set_data (G_OBJECT (editor), "font-selector", fontsel);
 
-      gtk_font_button_set_title (GTK_FONT_BUTTON (fontsel), _("Choose A Terminal Font"));
-      gtk_font_button_set_show_size (GTK_FONT_BUTTON (fontsel), TRUE);
-      gtk_font_button_set_show_style (GTK_FONT_BUTTON (fontsel), FALSE);
-      gtk_font_button_set_use_font (GTK_FONT_BUTTON (fontsel), TRUE);
-      gtk_font_button_set_use_size (GTK_FONT_BUTTON (fontsel), FALSE);
-
       profile_editor_update_font (editor, profile);
       g_signal_connect (G_OBJECT (fontsel), "font_set",
 			G_CALLBACK (font_set),
 			profile);
 
-      font_label = gtk_label_new_with_mnemonic (_("_Font:"));
-      gtk_misc_set_alignment (GTK_MISC (font_label), 0.0, 0.5);
-      gtk_label_set_mnemonic_widget (GTK_LABEL (font_label), fontsel);
-
-      gtk_box_set_spacing (GTK_BOX (w), 12);
-      
-      gtk_box_pack_start (GTK_BOX (w), GTK_WIDGET (font_label), FALSE, FALSE, 0);
-      gtk_box_pack_start (GTK_BOX (w), GTK_WIDGET (fontsel), FALSE, FALSE, 0);
-
       size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
       gtk_size_group_add_widget (size_group,
-				 font_label);
+				 glade_xml_get_widget (xml,
+                                                       "font-selector-label"));
       gtk_size_group_add_widget (size_group,
 				 glade_xml_get_widget (xml,
 						       "profile-name-label"));
@@ -1250,9 +1234,7 @@
 				 glade_xml_get_widget (xml,
 						       "profile-icon-label"));
       g_object_unref (G_OBJECT (size_group));
-      
-      gtk_widget_show_all (w);
-      
+
       w = glade_xml_get_widget (xml, "reset-compat-defaults-button");
       g_signal_connect (G_OBJECT (w), "clicked",
 			G_CALLBACK (reset_compat_defaults_clicked),
@@ -1260,19 +1242,9 @@
 
       terminal_util_set_unique_role (GTK_WINDOW (editor), "gnome-terminal-profile-editor");
     }
-  else
-    {
-      old_transient_parent = gtk_window_get_transient_for (GTK_WINDOW (editor));
-    }
-
-  if (old_transient_parent != transient_parent)
-    {
-      gtk_window_set_transient_for (GTK_WINDOW (editor),
-                                    GTK_WINDOW (transient_parent));
-      gtk_widget_hide (editor); /* re-show the window on its new parent */
-    }
-  
-  /*   gtk_widget_show_all (editor);*/
+      
+  gtk_window_set_transient_for (GTK_WINDOW (editor),
+                                GTK_WINDOW (transient_parent));
   gtk_window_present (GTK_WINDOW (editor));
 }
 



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