add option for when to show size dialog while resizing
authorDana Jansens <danakj@orodu.net>
Fri, 1 Jun 2007 02:22:14 +0000 (02:22 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 1 Jun 2007 02:22:14 +0000 (02:22 +0000)
src/obconf.glade
src/strings.c
src/windows.c

index 3ac3ce5..a0979e5 100644 (file)
@@ -1316,6 +1316,94 @@ C - The close button</property>
                            </packing>
                          </child>
 
+                         <child>
+                           <widget class="GtkHBox" id="hbox90">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">12</property>
+
+                             <child>
+                               <widget class="GtkLabel" id="label166">
+                                 <property name="visible">True</property>
+                                 <property name="label" translatable="yes">_Show size dialog:</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_popup">
+                                 <property name="visible">True</property>
+                                 <property name="can_focus">True</property>
+                                 <property name="history">0</property>
+
+                                 <child>
+                                   <widget class="GtkMenu" id="menu11">
+
+                                     <child>
+                                       <widget class="GtkMenuItem" id="resize_popup_nonpixel">
+                                         <property name="visible">True</property>
+                                         <property name="label" translatable="yes">When resizing terminal windows</property>
+                                         <property name="use_underline">True</property>
+                                         <signal name="activate" handler="on_resize_popup_nonpixel_activate" last_modification_time="Fri, 01 Jun 2007 02:18:58 GMT"/>
+                                       </widget>
+                                     </child>
+
+                                     <child>
+                                       <widget class="GtkMenuItem" id="resize_popup_always">
+                                         <property name="visible">True</property>
+                                         <property name="label" translatable="yes">Always</property>
+                                         <property name="use_underline">True</property>
+                                         <signal name="activate" handler="on_resize_popup_always_activate" last_modification_time="Fri, 01 Jun 2007 02:18:58 GMT"/>
+                                       </widget>
+                                     </child>
+
+                                     <child>
+                                       <widget class="GtkMenuItem" id="resize_popup_never">
+                                         <property name="visible">True</property>
+                                         <property name="label" translatable="yes">Never</property>
+                                         <property name="use_underline">True</property>
+                                         <signal name="activate" handler="on_resize_popup_never_activate" last_modification_time="Fri, 01 Jun 2007 02:18:58 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>
+
+                         <child>
+                           <placeholder/>
+                         </child>
+
                          <child>
                            <widget class="GtkHBox" id="hbox17">
                              <property name="visible">True</property>
index 67255f0..6ad773a 100644 (file)
@@ -40,6 +40,10 @@ gchar *s = N_("_Place new windows under the mouse pointer");
 gchar *s = N_("<span weight=\"bold\">Moving and Resizing Windows</span>");
 gchar *s = N_("    ");
 gchar *s = N_("Update the window c_ontents while resizing");
+gchar *s = N_("_Show size dialog:");
+gchar *s = N_("When resizing terminal windows");
+gchar *s = N_("Always");
+gchar *s = N_("Never");
 gchar *s = N_("Amount of resistance against other _windows:");
 gchar *s = N_("px");
 gchar *s = N_("Amount of resistance against screen _edges:");
index dc690a1..00a3e09 100644 (file)
 
 static gboolean mapping = FALSE;
 
+#define POPUP_NONPIXEL 0
+#define POPUP_ALWAYS   1
+#define POPUP_NEVER    2
+
 void windows_setup_tab()
 {
     GtkWidget *w, *w1, *w2;
     GtkSizeGroup *group;
     gchar *s;
+    gint pos;
 
     mapping = TRUE;
 
@@ -65,6 +70,14 @@ void windows_setup_tab()
                                  !g_ascii_strcasecmp(s, "UnderMouse"));
     g_free(s);
 
+    w = get_widget("resize_popup");
+    s = tree_get_string("resize/popupShow", "NonPixel");
+    if (!strcasecmp(s, "Always"))     pos = POPUP_ALWAYS;
+    else if (!strcasecmp(s, "Never")) pos = POPUP_NEVER;
+    else                              pos = POPUP_NONPIXEL;
+    g_free(s);
+    gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos);
+
     mapping = FALSE;
 }
 
@@ -106,3 +119,23 @@ void on_resize_contents_toggled(GtkToggleButton *w, gpointer data)
     tree_set_bool("resize/drawContents", gtk_toggle_button_get_active(w));
 }
 
+void on_resize_popup_nonpixel_activate(GtkMenuItem *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_string("resize/popupShow", "NonPixel");
+}
+
+void on_resize_popup_always_activate(GtkMenuItem *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_string("resize/popupShow", "Always");
+}
+
+void on_resize_popup_never_activate(GtkMenuItem *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_string("resize/popupShow", "Never");
+}