From 763c0bacd1a2cd9ff1246b7775693e27e9ef3264 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 1 Jun 2007 02:25:14 +0000 Subject: [PATCH] move the mouse doubleclick time and drag threshold around --- src/mouse.c | 27 +---- src/obconf.glade | 304 ++++++++++++++++++++--------------------------- src/strings.c | 7 +- src/windows.c | 18 ++- 4 files changed, 152 insertions(+), 204 deletions(-) diff --git a/src/mouse.c b/src/mouse.c index 940f989..06beefd 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -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; diff --git a/src/obconf.glade b/src/obconf.glade index a0979e5..e5bacef 100644 --- a/src/obconf.glade +++ b/src/obconf.glade @@ -1401,7 +1401,87 @@ C - The close button - + + True + False + 6 + + + + True + Drag _threshold distance: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + resist_edge + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 1 1 100 1 10 10 + + + + 0 + False + True + + + + + + True + px + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + @@ -2055,95 +2135,6 @@ C - The close button True - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - False - True - - - - - - True - False - 0 - - - - True - <span weight="bold">Mouse Behavior</span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 @@ -2228,95 +2219,62 @@ C - The close button True + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + False + True + + - - - True - False - 6 - - - - True - Drag _threshold distance: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - resist_edge - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + + + True + False + 0 - - - True - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 1 1 100 1 10 10 - - - - 0 - False - True - - + + + True + False + 0 - - - True - px - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 - True - True + False + False diff --git a/src/strings.c b/src/strings.c index 6ad773a..da6cfc4 100644 --- a/src/strings.c +++ b/src/strings.c @@ -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_("Mouse Behavior"); -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_("Desktops"); gchar *s = N_(" "); diff --git a/src/windows.c b/src/windows.c index 00a3e09..6a0bbab 100644 --- a/src/windows.c +++ b/src/windows.c @@ -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)); +} -- 2.39.2