From 22740768f3a72b7422291d7ae53cce7a228735b7 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 19 Jul 2007 17:24:59 -0400 Subject: [PATCH] add the
option for placing windows --- src/obconf.glade | 20 ++++++++++++++++++++ src/strings.c | 1 + src/windows.c | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/src/obconf.glade b/src/obconf.glade index c176997..83a8e38 100644 --- a/src/obconf.glade +++ b/src/obconf.glade @@ -1266,6 +1266,26 @@ C - The close button False + + + + True + True + _Center new windows when they are placed + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + 0 diff --git a/src/strings.c b/src/strings.c index 8faceb4..7ff2733 100644 --- a/src/strings.c +++ b/src/strings.c @@ -38,6 +38,7 @@ gchar *s = N_("Focus _new windows when they appear"); gchar *s = N_("Placing Windows"); gchar *s = N_(" "); gchar *s = N_("_Place new windows under the mouse pointer"); +gchar *s = N_("_Center new windows when they are placed"); gchar *s = N_("Moving and Resizing Windows"); gchar *s = N_(" "); gchar *s = N_("Update the window contents while _resizing"); diff --git a/src/windows.c b/src/windows.c index 54bd391..f81cec4 100644 --- a/src/windows.c +++ b/src/windows.c @@ -79,6 +79,10 @@ void windows_setup_tab() !g_ascii_strcasecmp(s, "UnderMouse")); g_free(s); + w = get_widget("place_center"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), + tree_get_bool("placement/center", TRUE)); + w = get_widget("resize_popup"); s = tree_get_string("resize/popupShow", "NonPixel"); if (!strcasecmp(s, "Always")) pos = POPUP_ALWAYS; @@ -113,6 +117,12 @@ static void enable_stuff() w = get_widget("resize_position"); gtk_widget_set_sensitive(w, b); + + w = get_widget("place_mouse"); + b = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); + + w = get_widget("place_center"); + gtk_widget_set_sensitive(w, !b); } void on_focus_new_toggled(GtkToggleButton *w, gpointer data) @@ -129,6 +139,14 @@ void on_place_mouse_toggled(GtkToggleButton *w, gpointer data) tree_set_string("placement/policy", (gtk_toggle_button_get_active(w) ? "UnderMouse" : "Smart")); + enable_stuff(); +} + +void on_place_center_toggled(GtkToggleButton *w, gpointer data) +{ + if (mapping) return; + + tree_set_bool("placement/center", gtk_toggle_button_get_active(w)); } void on_resist_window_value_changed(GtkSpinButton *w, gpointer data) -- 2.39.2