[Xfce4-commits] <xfwm4:snap-spacing-experiments> Add new window spacing option, add it to the workspace settings.
Jannis Pohlmann
jannis at xfce.org
Sun Sep 6 18:40:03 CEST 2009
Updating branch refs/heads/snap-spacing-experiments
to 1e5727ab97a6475b5868cb05a0d6ec0c41393081 (commit)
from d39d9c6a4fe8e19ee2117eaaa59c3031be91f5ce (commit)
commit 1e5727ab97a6475b5868cb05a0d6ec0c41393081
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Sun Sep 6 18:37:02 2009 +0200
Add new window spacing option, add it to the workspace settings.
settings-dialogs/workspace-settings.c | 6 +
settings-dialogs/xfwm4-workspace-dialog.glade | 407 ++++++++++++++++---------
src/settings.c | 7 +
src/settings.h | 1 +
4 files changed, 277 insertions(+), 144 deletions(-)
diff --git a/settings-dialogs/workspace-settings.c b/settings-dialogs/workspace-settings.c
index ee69a1e..8708884 100644
--- a/settings-dialogs/workspace-settings.c
+++ b/settings-dialogs/workspace-settings.c
@@ -310,6 +310,8 @@ workspace_dialog_configure_widgets (GladeXML *gxml,
GtkWidget *margin_bottom_spinbutton = glade_xml_get_widget (gxml, "margin_bottom_spinbutton");
GtkWidget *margin_left_spinbutton = glade_xml_get_widget (gxml, "margin_left_spinbutton");
+ GtkWidget *window_spacing_spinbutton = glade_xml_get_widget (gxml, "window_spacing_spinbutton");
+
/* Set monitor icon */
monitor = xfce_inline_icon_at_size (monitor_icon_data, -1, -1);
image = glade_xml_get_widget (gxml, "monitor_icon");
@@ -347,6 +349,10 @@ workspace_dialog_configure_widgets (GladeXML *gxml,
"/general/margin_left",
G_TYPE_INT,
(GObject *)margin_left_spinbutton, "value");
+ xfconf_g_property_bind (channel,
+ "/general/window_spacing",
+ G_TYPE_INT,
+ (GObject *)window_spacing_spinbutton, "value");
workspace_dialog_setup_names_treeview(gxml, channel);
diff --git a/settings-dialogs/xfwm4-workspace-dialog.glade b/settings-dialogs/xfwm4-workspace-dialog.glade
index 513275e..cf0dcae 100644
--- a/settings-dialogs/xfwm4-workspace-dialog.glade
+++ b/settings-dialogs/xfwm4-workspace-dialog.glade
@@ -1,15 +1,16 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Fri Oct 31 11:02:28 2008 -->
+<?xml version="1.0"?>
<glade-interface>
+ <!-- interface-requires gtk+ 2.6 -->
<requires lib="xfce4"/>
+ <!-- interface-requires xfce4 2157.5864 -->
+ <!-- interface-naming-policy toplevel-contextual -->
<widget class="XfceTitledDialog" id="main-dialog">
<property name="title" translatable="yes">Workspaces</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="window_position">center-on-parent</property>
<property name="default_width">400</property>
<property name="default_height">400</property>
<property name="icon_name">xfce4-workspaces</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<property name="subtitle" translatable="yes">Set number and names of workspaces</property>
<child internal-child="vbox">
@@ -19,12 +20,13 @@
<child>
<widget class="GtkHBox" id="plug-child">
<property name="visible">True</property>
+ <property name="spacing">12</property>
<property name="homogeneous">True</property>
<child>
<widget class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
@@ -48,6 +50,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -67,20 +70,20 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
<child>
<widget class="GtkTreeView" id="treeview_ws_names">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="headers_clickable">True</property>
<property name="rules_hint">True</property>
</widget>
</child>
@@ -104,164 +107,264 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkFrame" id="frame2">
+ <widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkAlignment" id="alignment2">
+ <widget class="GtkFrame" id="frame2">
<property name="visible">True</property>
- <property name="left_padding">12</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <widget class="GtkVBox" id="margins">
+ <widget class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
- <property name="border_width">6</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Margins are areas on the edges of the screen where no window will be placed</property>
- <property name="wrap">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">12</property>
<child>
- <widget class="GtkFrame" id="frame3">
+ <widget class="GtkVBox" id="margins">
<property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Margins are areas on the edges of the screen where no window will be placed</property>
+ <property name="wrap">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
- <widget class="GtkAlignment" id="alignment3">
+ <widget class="GtkFrame" id="frame3">
<property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="top_padding">6</property>
- <property name="bottom_padding">6</property>
- <property name="left_padding">6</property>
- <property name="right_padding">6</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0</property>
<child>
- <widget class="GtkTable" id="table1">
+ <widget class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">3</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">6</property>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">6</property>
+ <property name="right_padding">6</property>
<child>
- <widget class="GtkSpinButton" id="margin_left_spinbutton">
+ <widget class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">0 0 100 1 10 0</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">3</property>
+ <child>
+ <widget class="GtkSpinButton" id="margin_left_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="adjustment">0 0 100 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="margin_bottom_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="adjustment">0 0 100 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="margin_right_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="adjustment">0 0 100 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkImage" id="monitor_icon">
+ <property name="visible">True</property>
+ <property name="xpad">6</property>
+ <property name="ypad">6</property>
+ <property name="stock">gtk-missing-image</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="margin_top_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="adjustment">0 0 100 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="margin_bottom_spinbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">0 0 100 1 10 0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="margin_right_spinbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">0 0 100 1 10 0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkImage" id="monitor_icon">
- <property name="visible">True</property>
- <property name="xpad">6</property>
- <property name="ypad">6</property>
- <property name="stock">gtk-missing-image</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="margin_top_spinbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">0 0 100 1 10 0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
</child>
</widget>
</child>
+ <child>
+ <placeholder/>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
</widget>
- </child>
- <child>
- <placeholder/>
<packing>
- <property name="type">label_item</property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
- <packing>
- <property name="position">1</property>
- </packing>
</child>
</widget>
</child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Margins</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkLabel" id="label4">
+ <widget class="GtkFrame" id="frame4">
<property name="visible">True</property>
- <property name="label" translatable="yes"><b>Margins</b></property>
- <property name="use_markup">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkVBox" id="margins1">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">This defines the space between windows that is used when snapping is enabled</property>
+ <property name="wrap">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Spacing (px):</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="window_spacing_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="adjustment">0 0 100 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Window Spacing</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="type">label_item</property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -276,31 +379,38 @@
<property name="visible">True</property>
<child>
<widget class="GtkButton" id="button2">
+ <property name="label">gtk-help</property>
+ <property name="response_id">-11</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-help</property>
<property name="use_stock">True</property>
- <property name="response_id">-11</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkButton" id="button1">
+ <property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-close</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -309,10 +419,10 @@
<widget class="XfceTitledDialog" id="change_name_dialog">
<property name="title" translatable="yes">Change workspace name</property>
<property name="resizable">False</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="window_position">center-on-parent</property>
<property name="destroy_with_parent">True</property>
<property name="icon_name">xfce4-workspaces</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="type_hint">dialog</property>
<property name="skip_taskbar_hint">True</property>
<property name="transient_for">main-dialog</property>
<property name="has_separator">False</property>
@@ -335,6 +445,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -358,36 +469,44 @@
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="button3">
+ <property name="label">gtk-cancel</property>
+ <property name="response_id">-6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
- <property name="response_id">-6</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkButton" id="button4">
+ <property name="label">gtk-save</property>
+ <property name="response_id">-3</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-save</property>
<property name="use_stock">True</property>
- <property name="response_id">-3</property>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
diff --git a/src/settings.c b/src/settings.c
index a837235..f2d4b4c 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -716,6 +716,7 @@ loadSettings (ScreenInfo *screen_info)
{"unredirect_overlays", NULL, G_TYPE_BOOLEAN, TRUE},
{"urgent_blink", NULL, G_TYPE_BOOLEAN, TRUE},
{"use_compositing", NULL, G_TYPE_BOOLEAN, TRUE},
+ {"window_spacing", NULL, G_TYPE_UINT, TRUE},
{"workspace_count", NULL, G_TYPE_INT, TRUE},
{"wrap_cycle", NULL, G_TYPE_BOOLEAN, TRUE},
{"wrap_layout", NULL, G_TYPE_BOOLEAN, TRUE},
@@ -808,6 +809,8 @@ loadSettings (ScreenInfo *screen_info)
getBoolValue ("unredirect_overlays", rc);
screen_info->params->use_compositing =
getBoolValue ("use_compositing", rc);
+ screen_info->params->window_spacing =
+ getIntValue ("window_spacing", rc);
screen_info->params->wrap_workspaces =
getBoolValue ("wrap_workspaces", rc);
@@ -1114,6 +1117,10 @@ cb_xfwm4_channel_property_changed(XfconfChannel *channel, const gchar *property_
{
screen_info->params->snap_width = CLAMP (g_value_get_int (value), 5, 100);
}
+ else if (!strcmp (name, "window_spacing"))
+ {
+ screen_info->params->window_spacing = CLAMP (g_value_get_int (value), 5, 100);
+ }
else if (!strcmp (name, "wrap_resistance"))
{
screen_info->params->wrap_resistance = CLAMP (g_value_get_int (value), 5, 100);
diff --git a/src/settings.h b/src/settings.h
index 2c1c431..f459674 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -189,6 +189,7 @@ struct _XfwmParams
int title_alignment;
int title_horizontal_offset;
int title_shadow[2];
+ int window_spacing;
int wrap_resistance;
gboolean borderless_maximize;
gboolean box_move;
More information about the Xfce4-commits
mailing list