From 3350b06d1122a39c24259598bede5d9717ba8c6e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 10 Feb 2008 18:35:24 -0500 Subject: [PATCH] fix the "fixed popup position" options - the text was wrong for the fixed y position popup (using left/right instead of top/bottom) - the config wasn't being loaded correctly for them --- src/moveresize.c | 30 ++++++++++++++++++++++++------ src/obconf.glade | 8 ++++---- src/strings.c | 4 ++-- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/moveresize.c b/src/moveresize.c index 3c9bade..47e91fc 100644 --- a/src/moveresize.c +++ b/src/moveresize.c @@ -43,6 +43,7 @@ void moveresize_setup_tab() GtkSizeGroup *group; gchar *s; gint pos, i; + gboolean opp; mapping = TRUE; @@ -95,13 +96,30 @@ void moveresize_setup_tab() g_free(s); gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos); + w = get_widget("fixed_x_popup"); + s = tree_get_string("resize/popupFixedPosition/x", "0"); + opp = s[0] == '-'; + if (s[0] == '-' || s[0] == '+') ++s; + if (!strcasecmp(s, "Center")) pos = EDGE_CENTER; + else if (opp) pos = EDGE_RIGHT; + else pos = EDGE_LEFT; + g_free(s); + gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos); + w = get_widget("fixed_x_pos"); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), - tree_get_int("resize/popupFixedPosition/x", 0)); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), MAX(atoi(s), 0)); + + w = get_widget("fixed_y_popup"); + s = tree_get_string("resize/popupFixedPosition/y", "0"); + opp = s[0] == '-'; + if (!strcasecmp(s, "Center")) pos = EDGE_CENTER; + else if (opp) pos = EDGE_RIGHT; + else pos = EDGE_LEFT; + g_free(s); + gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos); w = get_widget("fixed_y_pos"); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), - tree_get_int("resize/popupFixedPosition/y", 0)); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), MAX(atoi(s), 0)); i = tree_get_int("mouse/screenEdgeWarpTime", 400); @@ -301,7 +319,7 @@ void on_fixed_x_position_center_activate(GtkMenuItem *w, gpointer data) enable_stuff(); } -void on_fixed_y_position_left_activate(GtkMenuItem *w, gpointer data) +void on_fixed_y_position_top_activate(GtkMenuItem *w, gpointer data) { if (mapping) return; @@ -309,7 +327,7 @@ void on_fixed_y_position_left_activate(GtkMenuItem *w, gpointer data) enable_stuff(); } -void on_fixed_y_position_right_activate(GtkMenuItem *w, gpointer data) +void on_fixed_y_position_bottom_activate(GtkMenuItem *w, gpointer data) { if (mapping) return; diff --git a/src/obconf.glade b/src/obconf.glade index e201785..896af35 100644 --- a/src/obconf.glade +++ b/src/obconf.glade @@ -2590,18 +2590,18 @@ Omnipresent (On all desktops) True - From left edge + From top edge True - + True - From right edge + From bottom edge True - + diff --git a/src/strings.c b/src/strings.c index 2447690..7e5c2c5 100644 --- a/src/strings.c +++ b/src/strings.c @@ -90,8 +90,8 @@ gchar *s = N_("From right edge"); gchar *s = N_("px"); gchar *s = N_("Fixed _y position:"); gchar *s = N_("Centered"); -gchar *s = N_("From left edge"); -gchar *s = N_("From right edge"); +gchar *s = N_("From top edge"); +gchar *s = N_("From bottom edge"); gchar *s = N_("px"); gchar *s = N_("Move & Resize"); gchar *s = N_("Focusing Windows"); -- 2.39.2