add the popupPosition option
authorDana Jansens <danakj@orodu.net>
Fri, 1 Jun 2007 02:32:36 +0000 (02:32 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 1 Jun 2007 02:32:36 +0000 (02:32 +0000)
src/obconf.glade
src/strings.c
src/windows.c

index e5bacef..d104408 100644 (file)
@@ -1266,7 +1266,7 @@ C - The close button</property>
                      <property name="spacing">0</property>
 
                      <child>
-                       <widget class="GtkLabel" id="label35">
+                       <widget class="GtkLabel" id="label168">
                          <property name="visible">True</property>
                          <property name="label" translatable="yes">    </property>
                          <property name="use_underline">False</property>
@@ -1400,6 +1400,119 @@ C - The close button</property>
                            </packing>
                          </child>
 
+                         <child>
+                           <widget class="GtkHBox" id="hbox91">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">0</property>
+
+                             <child>
+                               <widget class="GtkLabel" id="label35">
+                                 <property name="visible">True</property>
+                                 <property name="label" translatable="yes">    </property>
+                                 <property name="use_underline">False</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.5</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</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>
+                               <widget class="GtkHBox" id="hbox91">
+                                 <property name="visible">True</property>
+                                 <property name="homogeneous">False</property>
+                                 <property name="spacing">12</property>
+
+                                 <child>
+                                   <widget class="GtkLabel" id="label167">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">Size _dialog's position</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">dock_position</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>
+                                   <widget class="GtkOptionMenu" id="resize_position">
+                                     <property name="visible">True</property>
+                                     <property name="can_focus">True</property>
+                                     <property name="history">0</property>
+
+                                     <child>
+                                       <widget class="GtkMenu" id="menu12">
+
+                                         <child>
+                                           <widget class="GtkMenuItem" id="resize_position_center">
+                                             <property name="visible">True</property>
+                                             <property name="label" translatable="yes">Centered on the window</property>
+                                             <property name="use_underline">True</property>
+                                             <signal name="activate" handler="on_resize_position_center_activate" last_modification_time="Fri, 01 Jun 2007 02:29:30 GMT"/>
+                                           </widget>
+                                         </child>
+
+                                         <child>
+                                           <widget class="GtkMenuItem" id="resize_position_top">
+                                             <property name="visible">True</property>
+                                             <property name="label" translatable="yes">Above the window</property>
+                                             <property name="use_underline">True</property>
+                                             <signal name="activate" handler="on_resize_position_top_activate" last_modification_time="Fri, 01 Jun 2007 02:29:30 GMT"/>
+                                           </widget>
+                                         </child>
+                                       </widget>
+                                     </child>
+                                   </widget>
+                                   <packing>
+                                     <property name="padding">0</property>
+                                     <property name="expand">False</property>
+                                     <property name="fill">False</property>
+                                   </packing>
+                                 </child>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">True</property>
+                                 <property name="fill">True</property>
+                               </packing>
+                             </child>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">True</property>
+                             <property name="fill">True</property>
+                           </packing>
+                         </child>
+
                          <child>
                            <widget class="GtkHBox" id="hbox86">
                              <property name="visible">True</property>
index da6cfc4..492c031 100644 (file)
@@ -44,6 +44,10 @@ gchar *s = N_("_Show size dialog:");
 gchar *s = N_("When resizing terminal windows");
 gchar *s = N_("Always");
 gchar *s = N_("Never");
+gchar *s = N_("    ");
+gchar *s = N_("Size _dialog's position");
+gchar *s = N_("Centered on the window");
+gchar *s = N_("Above the window");
 gchar *s = N_("Drag _threshold distance:");
 gchar *s = N_("px");
 gchar *s = N_("Amount of resistance against other _windows:");
index 6a0bbab..54bd391 100644 (file)
@@ -26,6 +26,11 @@ static gboolean mapping = FALSE;
 #define POPUP_ALWAYS   1
 #define POPUP_NEVER    2
 
+#define POSITION_CENTER 0
+#define POSITION_TOP    1
+
+static void enable_stuff();
+
 void windows_setup_tab()
 {
     GtkWidget *w, *w1, *w2, *w3;
@@ -86,9 +91,30 @@ void windows_setup_tab()
     gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
                               tree_get_int("mouse/dragThreshold", 8));
 
+    w = get_widget("resize_position");
+    s = tree_get_string("resize/popupPosition", "Center");
+    if (!strcasecmp(s, "Top")) pos = POSITION_TOP;
+    else                       pos = POSITION_CENTER;
+    g_free(s);
+    gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos);
+
+    enable_stuff();
+
     mapping = FALSE;
 }
 
+static void enable_stuff()
+{
+    GtkWidget *w;
+    gboolean b;
+
+    w = get_widget("resize_popup");
+    b = gtk_option_menu_get_history(GTK_OPTION_MENU(w)) != POPUP_NEVER;
+
+    w = get_widget("resize_position");
+    gtk_widget_set_sensitive(w, b);
+}
+
 void on_focus_new_toggled(GtkToggleButton *w, gpointer data)
 {
     if (mapping) return;
@@ -132,6 +158,7 @@ void on_resize_popup_nonpixel_activate(GtkMenuItem *w, gpointer data)
     if (mapping) return;
 
     tree_set_string("resize/popupShow", "NonPixel");
+    enable_stuff();
 }
 
 void on_resize_popup_always_activate(GtkMenuItem *w, gpointer data)
@@ -139,6 +166,7 @@ void on_resize_popup_always_activate(GtkMenuItem *w, gpointer data)
     if (mapping) return;
 
     tree_set_string("resize/popupShow", "Always");
+    enable_stuff();
 }
 
 void on_resize_popup_never_activate(GtkMenuItem *w, gpointer data)
@@ -146,6 +174,7 @@ void on_resize_popup_never_activate(GtkMenuItem *w, gpointer data)
     if (mapping) return;
 
     tree_set_string("resize/popupShow", "Never");
+    enable_stuff();
 }
 
 void on_drag_threshold_value_changed(GtkSpinButton *w, gpointer data)
@@ -155,3 +184,21 @@ void on_drag_threshold_value_changed(GtkSpinButton *w, gpointer data)
     tree_set_int("mouse/dragThreshold",
                  gtk_spin_button_get_value_as_int(w));
 }
+
+void on_resize_position_center_activate(GtkMenuItem *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_string("resize/popupPosition", "Center");
+    enable_stuff();
+}
+
+
+void on_resize_position_top_activate(GtkMenuItem *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_string("resize/popupPosition", "Top");
+    enable_stuff();
+}
+