From a6c38ec963ea9657f9969ec2fb72b9d4e1cebeec Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 31 May 2007 15:32:19 +0000 Subject: [PATCH] add the showDelay and noStrut options to dock tab --- src/dock.c | 61 +++++++++++++--- src/dock.h | 9 +-- src/obconf.glade | 182 ++++++++++++++++++++++++++++++++++++++++++++++- src/strings.c | 5 ++ 4 files changed, 239 insertions(+), 18 deletions(-) diff --git a/src/dock.c b/src/dock.c index 8a4f781..096fda0 100644 --- a/src/dock.c +++ b/src/dock.c @@ -37,24 +37,36 @@ static gboolean mapping = FALSE; void dock_setup_tab() { - GtkWidget *w, *posi, *dir; + GtkWidget *w, *w1, *w2; GtkSizeGroup *group; gchar *s; gint pos; mapping = TRUE; - posi = get_widget("dock_position"); - dir = get_widget("dock_direction"); + w1 = get_widget("dock_position"); + w2 = get_widget("dock_direction"); group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); - gtk_size_group_add_widget(group, posi); - gtk_size_group_add_widget(group, dir); + gtk_size_group_add_widget(group, w1); + gtk_size_group_add_widget(group, w2); - posi = get_widget("dock_position_label"); - dir = get_widget("dock_direction_label"); + w1 = get_widget("dock_position_label"); + w2 = get_widget("dock_direction_label"); group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); - gtk_size_group_add_widget(group, posi); - gtk_size_group_add_widget(group, dir); + gtk_size_group_add_widget(group, w1); + gtk_size_group_add_widget(group, w2); + + w1 = get_widget("dock_hide_label"); + w2 = get_widget("dock_show_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("dock_hide_delay"); + w2 = get_widget("dock_show_delay"); + 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("dock_position"); s = tree_get_string("dock/position", "TopLeft"); @@ -94,6 +106,10 @@ void dock_setup_tab() g_free(s); gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos); + w = get_widget("dock_nostrut"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), + tree_get_bool("dock/noStrut", FALSE)); + w = get_widget("dock_hide"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), tree_get_bool("dock/autoHide", FALSE)); @@ -102,6 +118,10 @@ void dock_setup_tab() gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), tree_get_int("dock/hideDelay", 300)); + w = get_widget("dock_show_delay"); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), + tree_get_int("dock/showDelay", 300)); + dock_enable_stuff(); mapping = FALSE; @@ -123,6 +143,8 @@ void dock_enable_stuff() gtk_widget_set_sensitive(s, b); s = get_widget("dock_float_label_x"); gtk_widget_set_sensitive(s, b); + s = get_widget("dock_nostrut"); + gtk_widget_set_sensitive(s, !b); w = get_widget("dock_hide"); b = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); @@ -133,6 +155,12 @@ void dock_enable_stuff() gtk_widget_set_sensitive(s, b); s = get_widget("dock_hide_label_units"); gtk_widget_set_sensitive(s, b); + s = get_widget("dock_show_delay"); + gtk_widget_set_sensitive(s, b); + s = get_widget("dock_show_label"); + gtk_widget_set_sensitive(s, b); + s = get_widget("dock_show_label_units"); + gtk_widget_set_sensitive(s, b); } void on_dock_top_left_activate(GtkMenuItem *w, gpointer data) @@ -259,6 +287,13 @@ void on_dock_vertical_activate(GtkMenuItem *w, gpointer data) tree_set_string("dock/direction", "Vertical"); } +void on_dock_nostrut_toggled(GtkToggleButton *w, gpointer data) +{ + if (mapping) return; + + tree_set_bool("dock/noStrut", gtk_toggle_button_get_active(w)); +} + void on_dock_hide_toggled(GtkToggleButton *w, gpointer data) { if (mapping) return; @@ -275,3 +310,11 @@ void on_dock_hide_delay_value_changed(GtkSpinButton *w, gpointer data) gtk_spin_button_get_value_as_int(w)); } +void on_dock_show_delay_value_changed(GtkSpinButton *w, gpointer data) +{ + if (mapping) return; + + tree_set_int("dock/showDelay", + gtk_spin_button_get_value_as_int(w)); +} + diff --git a/src/dock.h b/src/dock.h index d32a0a0..0ef1af7 100644 --- a/src/dock.h +++ b/src/dock.h @@ -22,13 +22,6 @@ #include -void dock_setup_position (GtkWidget *w); -void dock_setup_float_x (GtkWidget *w); -void dock_setup_float_y (GtkWidget *w); -void dock_setup_stacking (GtkWidget *top, - GtkWidget *normal, GtkWidget *bottom); -void dock_setup_direction (GtkWidget *w); -void dock_setup_hide (GtkWidget *w); -void dock_setup_hide_delay (GtkWidget *w); +void dock_setup_tab(); #endif diff --git a/src/obconf.glade b/src/obconf.glade index f0c1ca2..f15b54f 100644 --- a/src/obconf.glade +++ b/src/obconf.glade @@ -2311,6 +2311,64 @@ C - The close button + + + 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 + True + Allow _windows to be placed within the dock's area + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + 0 + True + True + + + True @@ -2692,7 +2750,7 @@ C - The close button GTK_JUSTIFY_LEFT False False - 0.5 + 0 0.5 0 0 @@ -2767,6 +2825,128 @@ C - The close button True + + + + 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 + 6 + + + + True + Delay before _showing: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + dock_hide_delay + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 300 0 10000 1 10 10 + + + + 0 + False + True + + + + + + True + ms + 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 + + + + + 0 + True + True + + 0 diff --git a/src/strings.c b/src/strings.c index b9700e1..5440eed 100644 --- a/src/strings.c +++ b/src/strings.c @@ -71,6 +71,8 @@ gchar *s = N_("Floating"); gchar *s = N_(" "); gchar *s = N_("_Floating position:"); gchar *s = N_("x"); +gchar *s = N_(" "); +gchar *s = N_("Allow _windows to be placed within the dock's area"); gchar *s = N_("_Orientation: "); gchar *s = N_("Vertical"); gchar *s = N_("Horizontal"); @@ -85,6 +87,9 @@ gchar *s = N_("_Hide off screen"); gchar *s = N_(" "); gchar *s = N_("_Delay before hiding:"); gchar *s = N_("ms"); +gchar *s = N_(" "); +gchar *s = N_("Delay before _showing:"); +gchar *s = N_("ms"); gchar *s = N_("Dock"); gchar *s = N_("Abo_ut"); gchar *s = N_("About ObConf"); -- 2.34.1