fix the "fixed popup position" options
authorDana Jansens <danakj@orodu.net>
Sun, 10 Feb 2008 23:35:24 +0000 (18:35 -0500)
committerDana Jansens <danakj@orodu.net>
Sun, 10 Feb 2008 23:35:24 +0000 (18:35 -0500)
- 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
src/obconf.glade
src/strings.c

index 3c9bade..47e91fc 100644 (file)
@@ -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;
 
index e201785..896af35 100644 (file)
@@ -2590,18 +2590,18 @@ Omnipresent (On all desktops)</property>
                                                  <child>
                                                    <widget class="GtkMenuItem" id="menuitem6">
                                                      <property name="visible">True</property>
-                                                     <property name="label" translatable="yes">From left edge</property>
+                                                     <property name="label" translatable="yes">From top edge</property>
                                                      <property name="use_underline">True</property>
-                                                     <signal name="activate" handler="on_fixed_y_position_left_activate" last_modification_time="Sat, 12 Jan 2008 17:54:45 GMT"/>
+                                                     <signal name="activate" handler="on_fixed_y_position_top_activate" last_modification_time="Sun, 10 Feb 2008 23:17:10 GMT"/>
                                                    </widget>
                                                  </child>
 
                                                  <child>
                                                    <widget class="GtkMenuItem" id="menuitem7">
                                                      <property name="visible">True</property>
-                                                     <property name="label" translatable="yes">From right edge</property>
+                                                     <property name="label" translatable="yes">From bottom edge</property>
                                                      <property name="use_underline">True</property>
-                                                     <signal name="activate" handler="on_fixed_y_position_right_activate" last_modification_time="Sat, 12 Jan 2008 17:54:45 GMT"/>
+                                                     <signal name="activate" handler="on_fixed_y_position_bottom_activate" last_modification_time="Sun, 10 Feb 2008 23:17:10 GMT"/>
                                                    </widget>
                                                  </child>
                                                </widget>
index 2447690..7e5c2c5 100644 (file)
@@ -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_("<span weight=\"bold\">Focusing Windows</span>");