move the mouse doubleclick time and drag threshold around
authorDana Jansens <danakj@orodu.net>
Fri, 1 Jun 2007 02:25:14 +0000 (02:25 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 1 Jun 2007 02:25:14 +0000 (02:25 +0000)
src/mouse.c
src/obconf.glade
src/strings.c
src/windows.c

index 940f989..06beefd 100644 (file)
@@ -36,24 +36,11 @@ static void enable_stuff();
 
 void mouse_setup_tab()
 {
-    GtkWidget *w, *w1, *w2;
-    GtkSizeGroup *group;
+    GtkWidget *w;
     gint a;
 
     mapping = TRUE;
 
-    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),
                                  tree_get_bool("focus/followMouse", FALSE));
@@ -74,10 +61,6 @@ void mouse_setup_tab()
     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", 8));
-
     w = get_widget("titlebar_doubleclick");
     a = read_doubleclick_action();
     if (a == TITLEBAR_CUSTOM) {
@@ -180,14 +163,6 @@ void on_doubleclick_time_value_changed(GtkSpinButton *w, gpointer data)
                  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));
-}
-
 static gint read_doubleclick_action()
 {
     xmlNodePtr n, top, c;
index a0979e5..e5bacef 100644 (file)
@@ -1401,7 +1401,87 @@ C - The close button</property>
                          </child>
 
                          <child>
-                           <placeholder/>
+                           <widget class="GtkHBox" id="hbox86">
+                             <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="label160">
+                                 <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">True</property>
+                             <property name="fill">True</property>
+                           </packing>
                          </child>
 
                          <child>
@@ -2055,95 +2135,6 @@ C - The close button</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>
-
-             <child>
-               <widget class="GtkVBox" id="vbox63">
-                 <property name="visible">True</property>
-                 <property name="homogeneous">False</property>
-                 <property name="spacing">0</property>
-
-                 <child>
-                   <widget class="GtkLabel" id="label163">
-                     <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="hbox88">
-                     <property name="visible">True</property>
-                     <property name="homogeneous">False</property>
-                     <property name="spacing">0</property>
-
-                     <child>
-                       <widget class="GtkLabel" id="label162">
-                         <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="vbox64">
-                         <property name="visible">True</property>
-                         <property name="homogeneous">False</property>
-                         <property name="spacing">0</property>
 
                          <child>
                            <widget class="GtkHBox" id="hbox85">
@@ -2228,95 +2219,62 @@ C - The close button</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>
 
-                         <child>
-                           <widget class="GtkHBox" id="hbox86">
-                             <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="GtkVBox" id="vbox63">
+                 <property name="visible">True</property>
+                 <property name="homogeneous">False</property>
+                 <property name="spacing">0</property>
 
-                             <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="GtkHBox" id="hbox88">
+                     <property name="visible">True</property>
+                     <property name="homogeneous">False</property>
+                     <property name="spacing">0</property>
 
-                             <child>
-                               <widget class="GtkLabel" id="label160">
-                                 <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">True</property>
-                             <property name="fill">True</property>
-                           </packing>
-                         </child>
+                     <child>
+                       <widget class="GtkLabel" id="label162">
+                         <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">True</property>
-                         <property name="fill">True</property>
+                         <property name="expand">False</property>
+                         <property name="fill">False</property>
                        </packing>
                      </child>
                    </widget>
index 6ad773a..da6cfc4 100644 (file)
@@ -44,6 +44,8 @@ gchar *s = N_("_Show size dialog:");
 gchar *s = N_("When resizing terminal windows");
 gchar *s = N_("Always");
 gchar *s = N_("Never");
+gchar *s = N_("Drag _threshold distance:");
+gchar *s = N_("px");
 gchar *s = N_("Amount of resistance against other _windows:");
 gchar *s = N_("px");
 gchar *s = N_("Amount of resistance against screen _edges:");
@@ -62,12 +64,9 @@ gchar *s = N_("    ");
 gchar *s = N_("_Double click on the titlebar:");
 gchar *s = N_("Maximizes the window");
 gchar *s = N_("Shades the window");
-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_("    ");
 gchar *s = N_("Mouse");
 gchar *s = N_("<span weight=\"bold\">Desktops</span>");
 gchar *s = N_("    ");
index 00a3e09..6a0bbab 100644 (file)
@@ -28,7 +28,7 @@ static gboolean mapping = FALSE;
 
 void windows_setup_tab()
 {
-    GtkWidget *w, *w1, *w2;
+    GtkWidget *w, *w1, *w2, *w3;
     GtkSizeGroup *group;
     gchar *s;
     gint pos;
@@ -37,15 +37,19 @@ void windows_setup_tab()
 
     w1    = get_widget("resist_window");
     w2    = get_widget("resist_edge");
+    w3    = 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);
+    gtk_size_group_add_widget(group, w3);
 
     w1    = get_widget("resist_window_label");
     w2    = get_widget("resist_edge_label");
+    w3    = 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);
+    gtk_size_group_add_widget(group, w3);
 
     w = get_widget("focus_new");
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
@@ -78,6 +82,10 @@ void windows_setup_tab()
     g_free(s);
     gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos);
 
+    w = get_widget("drag_threshold");
+    gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
+                              tree_get_int("mouse/dragThreshold", 8));
+
     mapping = FALSE;
 }
 
@@ -139,3 +147,11 @@ void on_resize_popup_never_activate(GtkMenuItem *w, gpointer data)
 
     tree_set_string("resize/popupShow", "Never");
 }
+
+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));
+}