set nicer limits on the spinners
authorDana Jansens <danakj@orodu.net>
Thu, 31 May 2007 16:10:39 +0000 (16:10 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 31 May 2007 16:10:39 +0000 (16:10 +0000)
src/behavior.c
src/obconf.glade
src/strings.c

index 3607abc..e715c33 100644 (file)
@@ -26,23 +26,35 @@ static void behavior_enable_stuff();
 
 void behavior_setup_tab()
 {
-    GtkWidget *w, *winresist, *edgeresist;
+    GtkWidget *w, *w1, *w2;
     GtkSizeGroup *group;
     gchar *s;
 
     mapping = TRUE;
 
-    winresist  = get_widget("resist_window");
-    edgeresist = get_widget("resist_edge");
-    group      = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-    gtk_size_group_add_widget(group, winresist);
-    gtk_size_group_add_widget(group, edgeresist);
-
-    winresist  = get_widget("resist_window_label");
-    edgeresist = get_widget("resist_edge_label");
-    group      = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-    gtk_size_group_add_widget(group, winresist);
-    gtk_size_group_add_widget(group, edgeresist);
+    w1    = get_widget("resist_window");
+    w2    = get_widget("resist_edge");
+    group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+    gtk_size_group_add_widget(group, w1);
+    gtk_size_group_add_widget(group, w2);
+
+    w1    = get_widget("resist_window_label");
+    w2    = get_widget("resist_edge_label");
+    group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+    gtk_size_group_add_widget(group, w1);
+    gtk_size_group_add_widget(group, w2);
+
+    w1    = get_widget("doubleclick_time");
+    w2    = get_widget("drag_threshold");
+    group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+    gtk_size_group_add_widget(group, w1);
+    gtk_size_group_add_widget(group, w2);
+
+    w1    = get_widget("doubleclick_time_label");
+    w2    = get_widget("drag_threshold_label");
+    group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+    gtk_size_group_add_widget(group, w1);
+    gtk_size_group_add_widget(group, w2);
 
     w = get_widget("focus_mouse");
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
@@ -83,6 +95,14 @@ void behavior_setup_tab()
                                  !g_ascii_strcasecmp(s, "UnderMouse"));
     g_free(s);
 
+    w = get_widget("doubleclick_time");
+    gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
+                              tree_get_int("mouse/doubleClickTime", 200));
+
+    w = get_widget("drag_threshold");
+    gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
+                              tree_get_int("mouse/dragThreshold", 3));
+
     behavior_enable_stuff();
 
     mapping = FALSE;
@@ -179,3 +199,20 @@ void on_resize_contents_toggled(GtkToggleButton *w, gpointer data)
 
     tree_set_bool("resize/drawContents", gtk_toggle_button_get_active(w));
 }
+
+void on_doubleclick_time_value_changed(GtkSpinButton *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_int("mouse/doubleClickTime",
+                 gtk_spin_button_get_value_as_int(w));
+}
+
+void on_drag_threshold_value_changed(GtkSpinButton *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_int("mouse/dragThreshold",
+                 gtk_spin_button_get_value_as_int(w));
+}
+
index f15b54f..09b76d4 100644 (file)
@@ -1193,11 +1193,11 @@ C - The close button</property>
                                          <property name="can_focus">True</property>
                                          <property name="climb_rate">1</property>
                                          <property name="digits">0</property>
-                                         <property name="numeric">False</property>
+                                         <property name="numeric">True</property>
                                          <property name="update_policy">GTK_UPDATE_ALWAYS</property>
                                          <property name="snap_to_ticks">False</property>
                                          <property name="wrap">False</property>
-                                         <property name="adjustment">0 0 100000 100 10 100000</property>
+                                         <property name="adjustment">0 0 10000 100 10 100</property>
                                          <signal name="value_changed" handler="on_focus_delay_value_changed" after="yes" last_modification_time="Sun, 14 Sep 2003 11:24:28 GMT"/>
                                        </widget>
                                        <packing>
@@ -1549,12 +1549,12 @@ C - The close button</property>
                                  <property name="can_focus">True</property>
                                  <property name="climb_rate">1</property>
                                  <property name="digits">0</property>
-                                 <property name="numeric">False</property>
+                                 <property name="numeric">True</property>
                                  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
                                  <property name="snap_to_ticks">False</property>
                                  <property name="wrap">False</property>
-                                 <property name="adjustment">20 0 10000 1 10 10</property>
-                                 <signal name="value_changed" handler="on_resist_window_value_changed" last_modification_time="Tue, 23 Sep 2003 22:22:53 GMT"/>
+                                 <property name="adjustment">20 0 100 1 10 10</property>
+                                 <signal name="value_changed" handler="on_resist_window_value_changed" after="yes" last_modification_time="Tue, 23 Sep 2003 22:22:53 GMT"/>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>
@@ -1633,12 +1633,12 @@ C - The close button</property>
                                  <property name="can_focus">True</property>
                                  <property name="climb_rate">1</property>
                                  <property name="digits">0</property>
-                                 <property name="numeric">False</property>
+                                 <property name="numeric">True</property>
                                  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
                                  <property name="snap_to_ticks">False</property>
                                  <property name="wrap">False</property>
                                  <property name="adjustment">1 0 100 1 10 10</property>
-                                 <signal name="value_changed" handler="on_resist_edge_value_changed" last_modification_time="Tue, 23 Sep 2003 22:23:04 GMT"/>
+                                 <signal name="value_changed" handler="on_resist_edge_value_changed" after="yes" last_modification_time="Tue, 23 Sep 2003 22:23:04 GMT"/>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>
@@ -1695,7 +1695,264 @@ C - The close button</property>
                </widget>
                <packing>
                  <property name="padding">0</property>
-                 <property name="expand">True</property>
+                 <property name="expand">False</property>
+                 <property name="fill">True</property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkVBox" id="vbox43">
+                 <property name="visible">True</property>
+                 <property name="homogeneous">False</property>
+                 <property name="spacing">6</property>
+
+                 <child>
+                   <widget class="GtkLabel" id="label109">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">&lt;span weight=&quot;bold&quot;&gt;Mouse Behavior&lt;/span&gt;</property>
+                     <property name="use_underline">False</property>
+                     <property name="use_markup">True</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="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="hbox59">
+                     <property name="visible">True</property>
+                     <property name="homogeneous">False</property>
+                     <property name="spacing">0</property>
+
+                     <child>
+                       <widget class="GtkLabel" id="label110">
+                         <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="GtkVBox" id="vbox44">
+                         <property name="visible">True</property>
+                         <property name="homogeneous">False</property>
+                         <property name="spacing">6</property>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox60">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">6</property>
+
+                             <child>
+                               <widget class="GtkLabel" id="doubleclick_time_label">
+                                 <property name="visible">True</property>
+                                 <property name="label" translatable="yes">Double-_click time:</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">resist_window</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="GtkSpinButton" id="doubleclick_time">
+                                 <property name="visible">True</property>
+                                 <property name="can_focus">True</property>
+                                 <property name="climb_rate">1</property>
+                                 <property name="digits">0</property>
+                                 <property name="numeric">True</property>
+                                 <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                                 <property name="snap_to_ticks">False</property>
+                                 <property name="wrap">False</property>
+                                 <property name="adjustment">0 0 100000 100 10 100</property>
+                                 <signal name="value_changed" handler="on_doubleclick_time_value_changed" after="yes" last_modification_time="Thu, 31 May 2007 16:09:40 GMT"/>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">True</property>
+                               </packing>
+                             </child>
+
+                             <child>
+                               <widget class="GtkLabel" id="doubleclick_time_units_label">
+                                 <property name="visible">True</property>
+                                 <property name="label" translatable="yes">ms</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>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">True</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox61">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">6</property>
+
+                             <child>
+                               <widget class="GtkLabel" id="drag_threshold_label">
+                                 <property name="visible">True</property>
+                                 <property name="label" translatable="yes">Drag _threshold distance:</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">resist_edge</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="GtkSpinButton" id="drag_threshold">
+                                 <property name="visible">True</property>
+                                 <property name="can_focus">True</property>
+                                 <property name="climb_rate">1</property>
+                                 <property name="digits">0</property>
+                                 <property name="numeric">True</property>
+                                 <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                                 <property name="snap_to_ticks">False</property>
+                                 <property name="wrap">False</property>
+                                 <property name="adjustment">1 1 100 1 10 10</property>
+                                 <signal name="value_changed" handler="on_drag_threshold_value_changed" after="yes" last_modification_time="Thu, 31 May 2007 16:02:00 GMT"/>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">True</property>
+                               </packing>
+                             </child>
+
+                             <child>
+                               <widget class="GtkLabel" id="drag_threshold_units_label">
+                                 <property name="visible">True</property>
+                                 <property name="label" translatable="yes">px</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>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</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>
+                   </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">False</property>
                  <property name="fill">True</property>
                </packing>
              </child>
@@ -1836,7 +2093,7 @@ C - The close button</property>
                              <property name="can_focus">True</property>
                              <property name="climb_rate">1</property>
                              <property name="digits">0</property>
-                             <property name="numeric">False</property>
+                             <property name="numeric">True</property>
                              <property name="update_policy">GTK_UPDATE_ALWAYS</property>
                              <property name="snap_to_ticks">False</property>
                              <property name="wrap">False</property>
@@ -2238,7 +2495,7 @@ C - The close button</property>
                                      <property name="can_focus">True</property>
                                      <property name="climb_rate">1</property>
                                      <property name="digits">0</property>
-                                     <property name="numeric">False</property>
+                                     <property name="numeric">True</property>
                                      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
                                      <property name="snap_to_ticks">False</property>
                                      <property name="wrap">False</property>
@@ -2283,7 +2540,7 @@ C - The close button</property>
                                      <property name="can_focus">True</property>
                                      <property name="climb_rate">1</property>
                                      <property name="digits">0</property>
-                                     <property name="numeric">False</property>
+                                     <property name="numeric">True</property>
                                      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
                                      <property name="snap_to_ticks">False</property>
                                      <property name="wrap">False</property>
@@ -2773,11 +3030,11 @@ C - The close button</property>
                                      <property name="can_focus">True</property>
                                      <property name="climb_rate">1</property>
                                      <property name="digits">0</property>
-                                     <property name="numeric">False</property>
+                                     <property name="numeric">True</property>
                                      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
                                      <property name="snap_to_ticks">False</property>
                                      <property name="wrap">False</property>
-                                     <property name="adjustment">300 0 10000 1 10 10</property>
+                                     <property name="adjustment">300 0 10000 1 10 100</property>
                                      <signal name="value_changed" handler="on_dock_hide_delay_value_changed" after="yes" last_modification_time="Sun, 14 Sep 2003 11:08:49 GMT"/>
                                    </widget>
                                    <packing>
@@ -2895,11 +3152,11 @@ C - The close button</property>
                                      <property name="can_focus">True</property>
                                      <property name="climb_rate">1</property>
                                      <property name="digits">0</property>
-                                     <property name="numeric">False</property>
+                                     <property name="numeric">True</property>
                                      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
                                      <property name="snap_to_ticks">False</property>
                                      <property name="wrap">False</property>
-                                     <property name="adjustment">300 0 10000 1 10 10</property>
+                                     <property name="adjustment">300 0 10000 1 10 100</property>
                                      <signal name="value_changed" handler="on_dock_show_delay_value_changed" after="yes" last_modification_time="Thu, 31 May 2007 15:17:16 GMT"/>
                                    </widget>
                                    <packing>
index 5440eed..05ebde4 100644 (file)
@@ -50,6 +50,12 @@ gchar *s = N_("Amount of resistance against other _windows:");
 gchar *s = N_("px");
 gchar *s = N_("Amount of resistance against screen _edges:");
 gchar *s = N_("px");
+gchar *s = N_("<span weight=\"bold\">Mouse Behavior</span>");
+gchar *s = N_("    ");
+gchar *s = N_("Double-_click time:");
+gchar *s = N_("ms");
+gchar *s = N_("Drag _threshold distance:");
+gchar *s = N_("px");
 gchar *s = N_("Behavior");
 gchar *s = N_("<span weight=\"bold\">Desktops</span>");
 gchar *s = N_("    ");