[Xfce4-commits] <xfce4-settings:stephan/dialogs> Fix title-bar layout configuration
Stephan Arts
noreply at xfce.org
Fri Mar 23 22:00:01 CET 2012
Updating branch refs/heads/stephan/dialogs
to 05535ed34a8aee30e0241656e6fbd4d5df6edc95 (commit)
from 4220c6d9f63b27401c25f259f003231d138819e8 (commit)
commit 05535ed34a8aee30e0241656e6fbd4d5df6edc95
Author: Stephan Arts <stephan at xfce.org>
Date: Fri Mar 23 21:57:12 2012 +0100
Fix title-bar layout configuration
dialogs/appearance-settings/main.c | 50 +++++++++++++++++++++++++++++------
1 files changed, 41 insertions(+), 9 deletions(-)
diff --git a/dialogs/appearance-settings/main.c b/dialogs/appearance-settings/main.c
index bff1fa9..777ab37 100644
--- a/dialogs/appearance-settings/main.c
+++ b/dialogs/appearance-settings/main.c
@@ -128,7 +128,15 @@ xfwm_settings_active_frame_drag_data (GtkWidget *widget,
guint info,
guint timestamp,
gpointer *user_data);
-
+static void
+xfwm_settings_hidden_frame_drag_data (GtkWidget *widget,
+ GdkDragContext *drag_context,
+ gint x,
+ gint y,
+ GtkSelectionData *data,
+ guint info,
+ guint timestamp,
+ gpointer *user_data);
static GdkPixbuf *
xfwm_settings_create_icon_from_widget (GtkWidget *widget);
@@ -393,7 +401,7 @@ xfwm_settings_save_button_layout (GtkBuilder *builder)
gint i;
GtkContainer *container;
- container = (GtkContainer *)gtk_builder_get_object (builder, "active-frame");
+ container = (GtkContainer *)gtk_builder_get_object (builder, "active-box");
children = gtk_container_get_children (container);
key_chars = g_new0 (const char *, g_list_length (children) + 1);
@@ -405,9 +413,8 @@ xfwm_settings_save_button_layout (GtkBuilder *builder)
}
value = g_strjoinv ("", (gchar **) key_chars);
- g_debug("%s", value);
- //xfconf_channel_set_string (xfwm4_channel, "/general/button_layout", value);
+ xfconf_channel_set_string (xfwm4_channel, "/general/button_layout", value);
g_list_free (children);
g_free (key_chars);
@@ -1242,10 +1249,8 @@ appearance_settings_dialog_configure_widgets (GtkBuilder *builder)
gtk_drag_dest_set (hidden_frame, GTK_DEST_DEFAULT_ALL, target_entry, 1, GDK_ACTION_MOVE);
-#if 0
g_signal_connect (hidden_frame, "drag-data-received",
- G_CALLBACK (xfwm_settings_hidden_frame_drag_data), settings);
-#endif
+ G_CALLBACK (xfwm_settings_hidden_frame_drag_data), builder);
children = gtk_container_get_children (GTK_CONTAINER (active_box));
for (list_iter = children; list_iter != NULL; list_iter = g_list_next (list_iter))
@@ -1262,7 +1267,6 @@ appearance_settings_dialog_configure_widgets (GtkBuilder *builder)
}
g_object_set_data (object, "key_char", (gpointer) &name[strlen (name) - 1]);
- g_debug("%s", (char *)g_object_get_data (object, "key_char"));
gtk_drag_source_set (GTK_WIDGET(object), GDK_BUTTON1_MASK, &target_entry[1], 1, GDK_ACTION_MOVE);
g_signal_connect (object, "drag_data_get",
@@ -1286,7 +1290,6 @@ appearance_settings_dialog_configure_widgets (GtkBuilder *builder)
name = gtk_buildable_get_name (GTK_BUILDABLE (object));
g_object_set_data (object, "key_char", (gpointer) &name[strlen (name) - 1]);
- g_debug("%s", &name[strlen(name)-1]);
gtk_drag_source_set (GTK_WIDGET (object), GDK_BUTTON1_MASK, &target_entry[0], 1, GDK_ACTION_MOVE);
g_signal_connect (object, "drag_data_get",
@@ -1643,6 +1646,35 @@ xfwm_settings_active_frame_drag_data (GtkWidget *widget,
}
static void
+xfwm_settings_hidden_frame_drag_data (GtkWidget *widget,
+ GdkDragContext *drag_context,
+ gint x,
+ gint y,
+ GtkSelectionData *data,
+ guint info,
+ guint timestamp,
+ gpointer *user_data)
+{
+ GtkWidget *source;
+ GtkWidget *parent;
+ GtkWidget *hidden_box;
+ GtkBuilder*builder = GTK_BUILDER (user_data);
+
+ source = GTK_WIDGET (gtk_builder_get_object (builder,
+ (const gchar *)gtk_selection_data_get_data (data)));
+ parent = gtk_widget_get_parent (source);
+
+ hidden_box = GTK_WIDGET (gtk_builder_get_object (builder, "hidden-box"));
+
+ g_object_ref (source);
+ gtk_container_remove (GTK_CONTAINER (parent), source);
+ gtk_box_pack_start (GTK_BOX (hidden_box), source, info == 3, info == 3, 0);
+ g_object_unref (source);
+
+ xfwm_settings_save_button_layout (builder);
+}
+
+static void
cb_xfwm_title_button_alignment_changed (GtkComboBox *combo,
GtkWidget *button)
{
More information about the Xfce4-commits
mailing list