summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
Diffstat (limited to 'applets')
-rw-r--r--applets/clock/Makefile.am3
-rw-r--r--applets/clock/clock.c11
-rw-r--r--applets/clock/org.mate.panel.applet.clock.gschema.xml.in88
-rw-r--r--applets/clock/org.mate.panel.applet.clock.gschema.xml.in.in88
-rw-r--r--applets/fish/Makefile.am3
-rw-r--r--applets/fish/org.mate.panel.applet.fish.gschema.xml.in34
-rw-r--r--applets/fish/org.mate.panel.applet.fish.gschema.xml.in.in34
-rw-r--r--applets/wncklet/Makefile.am3
-rw-r--r--applets/wncklet/org.mate.panel.applet.window-list.gschema.xml.in24
-rw-r--r--applets/wncklet/org.mate.panel.applet.window-list.gschema.xml.in.in24
-rw-r--r--applets/wncklet/org.mate.panel.applet.workspace-switcher.gschema.xml.in19
-rw-r--r--applets/wncklet/org.mate.panel.applet.workspace-switcher.gschema.xml.in.in24
-rw-r--r--applets/wncklet/window-list.c3
-rw-r--r--applets/wncklet/workspace-switcher.c98
-rw-r--r--applets/wncklet/workspace-switcher.ui15
15 files changed, 296 insertions, 175 deletions
diff --git a/applets/clock/Makefile.am b/applets/clock/Makefile.am
index 17dc67e4..6744d122 100644
--- a/applets/clock/Makefile.am
+++ b/applets/clock/Makefile.am
@@ -159,6 +159,9 @@ gsettings_SCHEMAS = org.mate.panel.applet.clock.gschema.xml
@INTLTOOL_XML_NOMERGE_RULE@
@GSETTINGS_RULES@
+%.gschema.xml.in: %.gschema.xml.in.in Makefile
+ $(AM_V_GEN) $(SED) -e 's^\@GETTEXT_PACKAGE\@^$(GETTEXT_PACKAGE)^g' < $< > $@
+
EXTRA_DIST = \
org.mate.panel.ClockApplet.mate-panel-applet.in.in \
$(gsettings_SCHEMAS) \
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index 44b844e8..bcbf847d 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -2264,6 +2264,17 @@ static void
setup_gsettings (ClockData *cd)
{
cd->settings = mate_panel_applet_settings_new (MATE_PANEL_APPLET (cd->applet), CLOCK_SCHEMA);
+
+ /* hack to allow users to set custom format in dconf-editor */
+ gint format;
+ gchar *custom_format;
+ format = g_settings_get_enum (cd->settings, KEY_FORMAT);
+ custom_format = g_settings_get_string (cd->settings, KEY_CUSTOM_FORMAT);
+ g_settings_set_enum (cd->settings, KEY_FORMAT, format);
+ g_settings_set_string (cd->settings, KEY_CUSTOM_FORMAT, custom_format);
+ if (custom_format != NULL)
+ g_free (custom_format);
+
g_signal_connect (cd->settings, "changed::" KEY_FORMAT, G_CALLBACK (format_changed), cd);
g_signal_connect (cd->settings, "changed::" KEY_SHOW_SECONDS, G_CALLBACK (show_seconds_changed), cd);
g_signal_connect (cd->settings, "changed::" KEY_SHOW_DATE, G_CALLBACK (show_date_changed), cd);
diff --git a/applets/clock/org.mate.panel.applet.clock.gschema.xml.in b/applets/clock/org.mate.panel.applet.clock.gschema.xml.in
deleted file mode 100644
index d2f7daca..00000000
--- a/applets/clock/org.mate.panel.applet.clock.gschema.xml.in
+++ /dev/null
@@ -1,88 +0,0 @@
-<schemalist gettext-domain="@GETTEXT_PACKAGE@">
- <enum id="org.mate.panel.applet.clock.ClockFormat">
- <value nick="invalid" value="0"/>
- <value nick="12-hour" value="1"/>
- <value nick="24-hour" value="2"/>
- <value nick="unix" value="3"/>
- <value nick="internet" value="4"/>
- <value nick="custom" value="5"/>
- </enum>
- <enum id="org.mate.panel.applet.clock.TemperatureUnit">
- <value nick="Invalid" value="0"/>
- <value nick="Default" value="1"/>
- <value nick="Kelvin" value="2"/>
- <value nick="Centigrade" value="3"/>
- <value nick="Fahrenheit" value="4"/>
- </enum>
- <enum id="org.mate.panel.applet.clock.SpeedUnit">
- <value nick="Invalid" value="0"/>
- <value nick="Default" value="1"/>
- <value nick="m/s" value="2"/>
- <value nick="km/h" value="3"/>
- <value nick="mph" value="4"/>
- <value nick="knots" value="5"/>
- <value nick="Beaufort scale" value="6"/>
- </enum>
- <schema id="org.mate.panel.applet.clock">
- <key name="format" enum="org.mate.panel.applet.clock.ClockFormat">
- <default>'24-hour'</default>
- <summary>Hour format</summary>
- <description>This key specifies the hour format used by the clock applet. Possible values are "12-hour", "24-hour", "internet", "unix" and "custom". If set to "internet", the clock will display Internet time. The Internet time system divides the day into 1000 ".beats". There are no time zones in this system, so time is the same all over the world. If set to "unix", the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set to "custom", the clock will display time according to the format specified in the custom_format key.</description>
- </key>
- <key name="custom-format" type="s">
- <default>''</default>
- <summary>Custom format of the clock</summary>
- <description>This key specifies the format used by the clock applet when the format key is set to "custom". You can use conversion specifiers understood by strftime() to obtain a specific format. See the strftime() manual for more information.</description>
- </key>
- <key name="show-seconds" type="b">
- <default>false</default>
- <summary>Show time with seconds</summary>
- <description>If true, display seconds in time.</description>
- </key>
- <key name="show-date" type="b">
- <default>true</default>
- <summary>Show date in clock</summary>
- <description>If true, display date in the clock, in addition to time.</description>
- </key>
- <key name="show-tooltip" type="b">
- <default>true</default>
- <summary>Show date in tooltip</summary>
- <description>If true, show date in a tooltip when the pointer is over the clock.</description>
- </key>
- <key name="show-weather" type="b">
- <default>true</default>
- <summary>Show weather in clock</summary>
- <description>If true, display a weather icon.</description>
- </key>
- <key name="show-temperature" type="b">
- <default>true</default>
- <summary>Show temperature in clock</summary>
- <description>If true, show the temperature next to the weather icon.</description>
- </key>
- <key name="show-week-numbers" type="b">
- <default>true</default>
- <summary>Show week numbers in calendar</summary>
- <description>If true, show week numbers in the calendar.</description>
- </key>
- <key name="expand-locations" type="b">
- <default>false</default>
- <summary>Expand list of locations</summary>
- <description>If true, expand the list of locations in the calendar window.</description>
- </key>
- <key name="cities" type="as">
- <default>[]</default>
- <summary>List of locations</summary>
- <description>A list of locations to display in the calendar window.</description>
- </key>
- <key name="temperature-unit" enum="org.mate.panel.applet.clock.TemperatureUnit">
- <default>'Default'</default>
- <summary>Temperature unit</summary>
- <description>The unit to use when showing temperatures.</description>
- </key>
- <key name="speed-unit" enum="org.mate.panel.applet.clock.SpeedUnit">
- <default>'Default'</default>
- <summary>Speed unit</summary>
- <description>The unit to use when showing wind speed.</description>
- </key>
- </schema>
-</schemalist>
diff --git a/applets/clock/org.mate.panel.applet.clock.gschema.xml.in.in b/applets/clock/org.mate.panel.applet.clock.gschema.xml.in.in
new file mode 100644
index 00000000..c041c53c
--- /dev/null
+++ b/applets/clock/org.mate.panel.applet.clock.gschema.xml.in.in
@@ -0,0 +1,88 @@
+<schemalist gettext-domain="@GETTEXT_PACKAGE@">
+ <enum id="org.mate.panel.applet.clock.ClockFormat">
+ <value nick="invalid" value="0"/>
+ <value nick="12-hour" value="1"/>
+ <value nick="24-hour" value="2"/>
+ <value nick="unix" value="3"/>
+ <value nick="internet" value="4"/>
+ <value nick="custom" value="5"/>
+ </enum>
+ <enum id="org.mate.panel.applet.clock.TemperatureUnit">
+ <value nick="Invalid" value="0"/>
+ <value nick="Default" value="1"/>
+ <value nick="Kelvin" value="2"/>
+ <value nick="Centigrade" value="3"/>
+ <value nick="Fahrenheit" value="4"/>
+ </enum>
+ <enum id="org.mate.panel.applet.clock.SpeedUnit">
+ <value nick="Invalid" value="0"/>
+ <value nick="Default" value="1"/>
+ <value nick="m/s" value="2"/>
+ <value nick="km/h" value="3"/>
+ <value nick="mph" value="4"/>
+ <value nick="knots" value="5"/>
+ <value nick="Beaufort scale" value="6"/>
+ </enum>
+ <schema id="org.mate.panel.applet.clock">
+ <key name="format" enum="org.mate.panel.applet.clock.ClockFormat">
+ <default>'24-hour'</default>
+ <_summary>Hour format</_summary>
+ <_description>This key specifies the hour format used by the clock applet. Possible values are "12-hour", "24-hour", "internet", "unix" and "custom". If set to "internet", the clock will display Internet time. The Internet time system divides the day into 1000 ".beats". There are no time zones in this system, so time is the same all over the world. If set to "unix", the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set to "custom", the clock will display time according to the format specified in the custom_format key.</_description>
+ </key>
+ <key name="custom-format" type="s">
+ <default>''</default>
+ <_summary>Custom format of the clock</_summary>
+ <_description>This key specifies the format used by the clock applet when the format key is set to "custom". You can use conversion specifiers understood by strftime() to obtain a specific format. See the strftime() manual for more information.</_description>
+ </key>
+ <key name="show-seconds" type="b">
+ <default>false</default>
+ <_summary>Show time with seconds</_summary>
+ <_description>If true, display seconds in time.</_description>
+ </key>
+ <key name="show-date" type="b">
+ <default>true</default>
+ <_summary>Show date in clock</_summary>
+ <_description>If true, display date in the clock, in addition to time.</_description>
+ </key>
+ <key name="show-tooltip" type="b">
+ <default>true</default>
+ <_summary>Show date in tooltip</_summary>
+ <_description>If true, show date in a tooltip when the pointer is over the clock.</_description>
+ </key>
+ <key name="show-weather" type="b">
+ <default>true</default>
+ <_summary>Show weather in clock</_summary>
+ <_description>If true, display a weather icon.</_description>
+ </key>
+ <key name="show-temperature" type="b">
+ <default>true</default>
+ <_summary>Show temperature in clock</_summary>
+ <_description>If true, show the temperature next to the weather icon.</_description>
+ </key>
+ <key name="show-week-numbers" type="b">
+ <default>true</default>
+ <_summary>Show week numbers in calendar</_summary>
+ <_description>If true, show week numbers in the calendar.</_description>
+ </key>
+ <key name="expand-locations" type="b">
+ <default>false</default>
+ <_summary>Expand list of locations</_summary>
+ <_description>If true, expand the list of locations in the calendar window.</_description>
+ </key>
+ <key name="cities" type="as">
+ <default>[]</default>
+ <_summary>List of locations</_summary>
+ <_description>A list of locations to display in the calendar window.</_description>
+ </key>
+ <key name="temperature-unit" enum="org.mate.panel.applet.clock.TemperatureUnit">
+ <default>'Default'</default>
+ <_summary>Temperature unit</_summary>
+ <_description>The unit to use when showing temperatures.</_description>
+ </key>
+ <key name="speed-unit" enum="org.mate.panel.applet.clock.SpeedUnit">
+ <default>'Default'</default>
+ <_summary>Speed unit</_summary>
+ <_description>The unit to use when showing wind speed.</_description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/applets/fish/Makefile.am b/applets/fish/Makefile.am
index d25c5eb0..5ba408ee 100644
--- a/applets/fish/Makefile.am
+++ b/applets/fish/Makefile.am
@@ -81,6 +81,9 @@ gsettings_SCHEMAS = org.mate.panel.applet.fish.gschema.xml
@INTLTOOL_XML_NOMERGE_RULE@
@GSETTINGS_RULES@
+%.gschema.xml.in: %.gschema.xml.in.in Makefile
+ $(AM_V_GEN) $(SED) -e 's^\@GETTEXT_PACKAGE\@^$(GETTEXT_PACKAGE)^g' < $< > $@
+
EXTRA_DIST = \
wanda.svg \
$(fishbitmaps_DATA) \
diff --git a/applets/fish/org.mate.panel.applet.fish.gschema.xml.in b/applets/fish/org.mate.panel.applet.fish.gschema.xml.in
deleted file mode 100644
index a3c3fe77..00000000
--- a/applets/fish/org.mate.panel.applet.fish.gschema.xml.in
+++ /dev/null
@@ -1,34 +0,0 @@
-<schemalist gettext-domain="@GETTEXT_PACKAGE@">
- <schema id="org.mate.panel.applet.fish">
- <key name="name" type="s">
- <default>'Wanda'</default>
- <summary>The fish's name</summary>
- <description>A fish without a name is a pretty dull fish. Bring your fish to life by naming him.</description>
- </key>
- <key name="image" type="s">
- <default>'wanda.png'</default>
- <summary>The fish's animation pixmap</summary>
- <description>This key specifies the filename of the pixmap which will be used for the animation displayed in the fish applet relative to the pixmap directory.</description>
- </key>
- <key name="command" type="s">
- <default>'fortune'</default>
- <summary>Command to execute on click</summary>
- <description>This key specifies the command that will be tried to execute when the fish is clicked.</description>
- </key>
- <key name="frames" type="i">
- <default>8</default>
- <summary>Frames in fish's animation</summary>
- <description>This key specifies the number of frames that will be displayed in the fish's animation.</description>
- </key>
- <key name="speed" type="d">
- <default>0.3</default>
- <summary>Pause per frame</summary>
- <description>This key specifies the number of seconds each frame will be displayed.</description>
- </key>
- <key name="rotate" type="b">
- <default>false</default>
- <summary>Rotate on vertical panels</summary>
- <description>If true, the fish's animation will be displayed rotated on vertical panels.</description>
- </key>
- </schema>
-</schemalist>
diff --git a/applets/fish/org.mate.panel.applet.fish.gschema.xml.in.in b/applets/fish/org.mate.panel.applet.fish.gschema.xml.in.in
new file mode 100644
index 00000000..6ab7bd07
--- /dev/null
+++ b/applets/fish/org.mate.panel.applet.fish.gschema.xml.in.in
@@ -0,0 +1,34 @@
+<schemalist gettext-domain="@GETTEXT_PACKAGE@">
+ <schema id="org.mate.panel.applet.fish">
+ <key name="name" type="s">
+ <default>'Wanda'</default>
+ <_summary>The fish's name</_summary>
+ <_description>A fish without a name is a pretty dull fish. Bring your fish to life by naming him.</_description>
+ </key>
+ <key name="image" type="s">
+ <default>'wanda.png'</default>
+ <_summary>The fish's animation pixmap</_summary>
+ <_description>This key specifies the filename of the pixmap which will be used for the animation displayed in the fish applet relative to the pixmap directory.</_description>
+ </key>
+ <key name="command" type="s">
+ <default>'fortune'</default>
+ <_summary>Command to execute on click</_summary>
+ <_description>This key specifies the command that will be tried to execute when the fish is clicked.</_description>
+ </key>
+ <key name="frames" type="i">
+ <default>8</default>
+ <_summary>Frames in fish's animation</_summary>
+ <_description>This key specifies the number of frames that will be displayed in the fish's animation.</_description>
+ </key>
+ <key name="speed" type="d">
+ <default>0.3</default>
+ <_summary>Pause per frame</_summary>
+ <_description>This key specifies the number of seconds each frame will be displayed.</_description>
+ </key>
+ <key name="rotate" type="b">
+ <default>false</default>
+ <_summary>Rotate on vertical panels</_summary>
+ <_description>If true, the fish's animation will be displayed rotated on vertical panels.</_description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/applets/wncklet/Makefile.am b/applets/wncklet/Makefile.am
index 55a2dddc..b6842195 100644
--- a/applets/wncklet/Makefile.am
+++ b/applets/wncklet/Makefile.am
@@ -90,6 +90,9 @@ gsettings_SCHEMAS = \
@INTLTOOL_XML_NOMERGE_RULE@
@GSETTINGS_RULES@
+%.gschema.xml.in: %.gschema.xml.in.in Makefile
+ $(AM_V_GEN) $(SED) -e 's^\@GETTEXT_PACKAGE\@^$(GETTEXT_PACKAGE)^g' < $< > $@
+
EXTRA_DIST = \
org.mate.panel.Wncklet.mate-panel-applet.in.in \
$(service_in_files) \
diff --git a/applets/wncklet/org.mate.panel.applet.window-list.gschema.xml.in b/applets/wncklet/org.mate.panel.applet.window-list.gschema.xml.in
deleted file mode 100644
index 0f2d871d..00000000
--- a/applets/wncklet/org.mate.panel.applet.window-list.gschema.xml.in
+++ /dev/null
@@ -1,24 +0,0 @@
-<schemalist gettext-domain="@GETTEXT_PACKAGE@">
- <enum id="org.mate.panel.applet.window-list.GroupingType">
- <value nick="never" value="0"/>
- <value nick="auto" value="1"/>
- <value nick="always" value="2"/>
- </enum>
- <schema id="org.mate.panel.applet.window-list">
- <key name="display-all-workspaces" type="b">
- <default>false</default>
- <summary>Show windows from all workspaces</summary>
- <description>If true, the window list will show windows from all workspaces. Otherwise it will only display windows from the current workspace.</description>
- </key>
- <key name="group-windows" enum="org.mate.panel.applet.window-list.GroupingType">
- <default>'never'</default>
- <summary>When to group windows</summary>
- <description>Decides when to group windows from the same application on the window list. Possible values are "never", "auto" and "always".</description>
- </key>
- <key name="move-unminimized-windows" type="b">
- <default>true</default>
- <summary>Move windows to current workspace when unminimized</summary>
- <description>If true, then when unminimizing a window, move it to the current workspace. Otherwise, switch to the workspace of the window.</description>
- </key>
- </schema>
-</schemalist>
diff --git a/applets/wncklet/org.mate.panel.applet.window-list.gschema.xml.in.in b/applets/wncklet/org.mate.panel.applet.window-list.gschema.xml.in.in
new file mode 100644
index 00000000..a9647379
--- /dev/null
+++ b/applets/wncklet/org.mate.panel.applet.window-list.gschema.xml.in.in
@@ -0,0 +1,24 @@
+<schemalist gettext-domain="@GETTEXT_PACKAGE@">
+ <enum id="org.mate.panel.applet.window-list.GroupingType">
+ <value nick="never" value="0"/>
+ <value nick="auto" value="1"/>
+ <value nick="always" value="2"/>
+ </enum>
+ <schema id="org.mate.panel.applet.window-list">
+ <key name="display-all-workspaces" type="b">
+ <default>false</default>
+ <_summary>Show windows from all workspaces</_summary>
+ <_description>If true, the window list will show windows from all workspaces. Otherwise it will only display windows from the current workspace.</_description>
+ </key>
+ <key name="group-windows" enum="org.mate.panel.applet.window-list.GroupingType">
+ <default>'never'</default>
+ <_summary>When to group windows</_summary>
+ <_description>Decides when to group windows from the same application on the window list. Possible values are "never", "auto" and "always".</_description>
+ </key>
+ <key name="move-unminimized-windows" type="b">
+ <default>true</default>
+ <_summary>Move windows to current workspace when unminimized</_summary>
+ <_description>If true, then when unminimizing a window, move it to the current workspace. Otherwise, switch to the workspace of the window.</_description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/applets/wncklet/org.mate.panel.applet.workspace-switcher.gschema.xml.in b/applets/wncklet/org.mate.panel.applet.workspace-switcher.gschema.xml.in
deleted file mode 100644
index f4664312..00000000
--- a/applets/wncklet/org.mate.panel.applet.workspace-switcher.gschema.xml.in
+++ /dev/null
@@ -1,19 +0,0 @@
-<schemalist>
- <schema id="org.mate.panel.applet.workspace-switcher">
- <key name="display-workspace-names" type="b">
- <default>false</default>
- <summary>Display workspace names</summary>
- <description>If true, the workspaces in the workspace switcher will display the names of the workspaces. Otherwise they will display the windows on the workspace. This setting only works when the window manager is Marco.</description>
- </key>
- <key name="display-all-workspaces" type="b">
- <default>true</default>
- <summary>Display all workspaces</summary>
- <description>If true, the workspace switcher will show all workspaces. Otherwise it will only show the current workspace.</description>
- </key>
- <key name="num-rows" type="i">
- <default>1</default>
- <summary>Rows in workspace switcher</summary>
- <description>This key specifies how many rows (for horizontal layout) or columns (for vertical layout) the workspace switcher shows the workspaces in. This key is only relevant if the display_all_workspaces key is true.</description>
- </key>
- </schema>
-</schemalist>
diff --git a/applets/wncklet/org.mate.panel.applet.workspace-switcher.gschema.xml.in.in b/applets/wncklet/org.mate.panel.applet.workspace-switcher.gschema.xml.in.in
new file mode 100644
index 00000000..82a20922
--- /dev/null
+++ b/applets/wncklet/org.mate.panel.applet.workspace-switcher.gschema.xml.in.in
@@ -0,0 +1,24 @@
+<schemalist gettext-domain="@GETTEXT_PACKAGE@">
+ <schema id="org.mate.panel.applet.workspace-switcher">
+ <key name="display-workspace-names" type="b">
+ <default>false</default>
+ <_summary>Display workspace names</_summary>
+ <_description>If true, the workspaces in the workspace switcher will display the names of the workspaces. Otherwise they will display the windows on the workspace. This setting only works when the window manager is Marco.</_description>
+ </key>
+ <key name="display-all-workspaces" type="b">
+ <default>true</default>
+ <_summary>Display all workspaces</_summary>
+ <_description>If true, the workspace switcher will show all workspaces. Otherwise it will only show the current workspace.</_description>
+ </key>
+ <key name="num-rows" type="i">
+ <default>1</default>
+ <_summary>Rows in workspace switcher</_summary>
+ <_description>This key specifies how many rows (for horizontal layout) or columns (for vertical layout) the workspace switcher shows the workspaces in. This key is only relevant if the display_all_workspaces key is true.</_description>
+ </key>
+ <key name="wrap-workspaces" type="b">
+ <default>false</default>
+ <_summary>Wrap around on scroll</_summary>
+ <_description>If true, the workspace switcher will allow wrap-around, which means switching from the first to the last workspace and vice versa via scrolling.</_description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c
index d38c7c3d..8dc900f4 100644
--- a/applets/wncklet/window-list.c
+++ b/applets/wncklet/window-list.c
@@ -115,6 +115,7 @@ static void applet_change_orient(MatePanelApplet* applet, MatePanelAppletOrient
tasklist->orientation = new_orient;
+ matewnck_tasklist_set_orientation (tasklist->tasklist, new_orient);
tasklist_update(tasklist);
}
@@ -414,6 +415,8 @@ gboolean window_list_applet_fill(MatePanelApplet* applet)
tasklist->tasklist = matewnck_tasklist_new(NULL);
+ matewnck_tasklist_set_orientation (tasklist->tasklist, tasklist->orientation);
+
matewnck_tasklist_set_icon_loader(MATEWNCK_TASKLIST(tasklist->tasklist), icon_loader_func, tasklist, NULL);
g_signal_connect(G_OBJECT(tasklist->tasklist), "destroy", G_CALLBACK(destroy_tasklist), tasklist);
diff --git a/applets/wncklet/workspace-switcher.c b/applets/wncklet/workspace-switcher.c
index 4d24663f..cda52708 100644
--- a/applets/wncklet/workspace-switcher.c
+++ b/applets/wncklet/workspace-switcher.c
@@ -62,6 +62,7 @@ typedef struct {
GtkWidget* workspace_names_label;
GtkWidget* workspace_names_scroll;
GtkWidget* display_workspaces_toggle;
+ GtkWidget* wrap_workspaces_toggle;
GtkWidget* all_workspaces_radio;
GtkWidget* current_only_radio;
GtkWidget* num_rows_spin; /* for vertical layout this is cols */
@@ -74,6 +75,7 @@ typedef struct {
int n_rows; /* for vertical layout this is cols */
MatewnckPagerDisplayMode display_mode;
gboolean display_all;
+ gboolean wrap_workspaces;
GSettings* settings;
} PagerData;
@@ -192,17 +194,34 @@ static void applet_change_orient(MatePanelApplet* applet, MatePanelAppletOrient
static void applet_change_background(MatePanelApplet* applet, MatePanelAppletBackgroundType type, GdkColor* color, GdkPixmap* pixmap, PagerData* pager)
{
+ /* taken from the TrashApplet */
+ GtkRcStyle *rc_style;
+ GtkStyle *style;
+
+ /* reset style */
+ gtk_widget_set_style (GTK_WIDGET (pager->pager), NULL);
+ rc_style = gtk_rc_style_new ();
+ gtk_widget_modify_style (GTK_WIDGET (pager->pager), rc_style);
+ g_object_unref (rc_style);
+
switch (type)
{
- case PANEL_NO_BACKGROUND:
- matewnck_pager_set_shadow_type(MATEWNCK_PAGER(pager->pager), GTK_SHADOW_IN);
- break;
- case PANEL_COLOR_BACKGROUND:
- matewnck_pager_set_shadow_type(MATEWNCK_PAGER(pager->pager), GTK_SHADOW_NONE);
- break;
- case PANEL_PIXMAP_BACKGROUND:
- matewnck_pager_set_shadow_type(MATEWNCK_PAGER(pager->pager), GTK_SHADOW_NONE);
- break;
+ case PANEL_COLOR_BACKGROUND:
+ gtk_widget_modify_bg (GTK_WIDGET (pager->pager), GTK_STATE_NORMAL, color);
+ break;
+
+ case PANEL_PIXMAP_BACKGROUND:
+ style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (pager->pager)));
+ if (style->bg_pixmap[GTK_STATE_NORMAL])
+ g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]);
+ style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref(pixmap);
+ gtk_widget_set_style (GTK_WIDGET (pager->pager), style);
+ g_object_unref (style);
+ break;
+
+ case PANEL_NO_BACKGROUND:
+ default:
+ break;
}
}
@@ -251,6 +270,10 @@ static gboolean applet_scroll(MatePanelApplet* applet, GdkEventScroll* event, Pa
{
index += n_columns;
}
+ else if (pager->wrap_workspaces && index == n_workspaces - 1)
+ {
+ index = 0;
+ }
else if ((index < n_workspaces - 1 && index + in_last_row != n_workspaces - 1) || (index == n_workspaces - 1 && in_last_row != 0))
{
index = (index % n_columns) + 1;
@@ -259,7 +282,13 @@ static gboolean applet_scroll(MatePanelApplet* applet, GdkEventScroll* event, Pa
case GDK_SCROLL_RIGHT:
if (index < n_workspaces - 1)
+ {
index++;
+ }
+ else if (pager->wrap_workspaces)
+ {
+ index = 0;
+ }
break;
case GDK_SCROLL_UP:
@@ -271,6 +300,10 @@ static gboolean applet_scroll(MatePanelApplet* applet, GdkEventScroll* event, Pa
{
index = ((pager->n_rows - 1) * n_columns) + (index % n_columns) - 1;
}
+ else if (pager->wrap_workspaces)
+ {
+ index = n_workspaces - 1;
+ }
if (index >= n_workspaces)
index -= n_columns;
@@ -278,7 +311,13 @@ static gboolean applet_scroll(MatePanelApplet* applet, GdkEventScroll* event, Pa
case GDK_SCROLL_LEFT:
if (index > 0)
+ {
index--;
+ }
+ else if (pager->wrap_workspaces)
+ {
+ index = n_workspaces - 1;
+ }
break;
default:
g_assert_not_reached();
@@ -394,6 +433,20 @@ static void all_workspaces_changed(GSettings* settings, gchar* key, PagerData* p
}
}
+static void wrap_workspaces_changed(GSettings* settings, gchar* key, PagerData* pager)
+{
+ gboolean value = FALSE; /* Default value */
+
+ value = g_settings_get_boolean (settings, key);
+
+ pager->wrap_workspaces = value;
+
+ if (pager->wrap_workspaces_toggle && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pager->wrap_workspaces_toggle)) != value)
+ {
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pager->wrap_workspaces_toggle), value);
+ }
+}
+
static void setup_gsettings(PagerData* pager)
{
pager->settings = mate_panel_applet_settings_new (MATE_PANEL_APPLET (pager->applet), WORKSPACE_SWITCHER_SCHEMA);
@@ -410,6 +463,11 @@ static void setup_gsettings(PagerData* pager)
"changed::display-all-workspaces",
G_CALLBACK (all_workspaces_changed),
pager);
+ g_signal_connect (pager->settings,
+ "changed::wrap-workspaces",
+ G_CALLBACK (wrap_workspaces_changed),
+ pager);
+
}
gboolean workspace_switcher_applet_fill(MatePanelApplet* applet)
@@ -433,6 +491,8 @@ gboolean workspace_switcher_applet_fill(MatePanelApplet* applet)
display_names = g_settings_get_boolean(pager->settings, "display-workspace-names");
+ pager->wrap_workspaces = g_settings_get_boolean(pager->settings, "wrap-workspaces");
+
if (display_names)
{
pager->display_mode = MATEWNCK_PAGER_DISPLAY_NAME;
@@ -537,8 +597,12 @@ static void display_about_dialog(GtkAction* action, PagerData* pager)
NULL);
}
+static void wrap_workspaces_toggled(GtkToggleButton* button, PagerData* pager)
+{
+ g_settings_set_boolean(pager->settings, "wrap-workspaces", gtk_toggle_button_get_active(button));
+}
-static void display_workspace_names_toggled(GtkToggleButton*button, PagerData* pager)
+static void display_workspace_names_toggled(GtkToggleButton* button, PagerData* pager)
{
g_settings_set_boolean(pager->settings, "display-workspace-names", gtk_toggle_button_get_active(button));
}
@@ -655,6 +719,7 @@ static void properties_dialog_destroyed(GtkWidget* widget, PagerData* pager)
pager->workspace_names_label = NULL;
pager->workspace_names_scroll = NULL;
pager->display_workspaces_toggle = NULL;
+ pager->wrap_workspaces_toggle = NULL;
pager->all_workspaces_radio = NULL;
pager->current_only_radio = NULL;
pager->num_rows_spin = NULL;
@@ -751,6 +816,9 @@ static void setup_dialog(GtkBuilder* builder, PagerData* pager)
pager->display_workspaces_toggle = WID("workspace_name_toggle");
setup_sensitivity(pager, builder, "workspace_name_toggle", NULL, NULL, pager->settings, "display-workspace-names" /* key */);
+ pager->wrap_workspaces_toggle = WID("workspace_wrap_toggle");
+ setup_sensitivity(pager, builder, "workspace_wrap_toggle", NULL, NULL, pager->settings, "wrap-workspaces" /* key */);
+
pager->all_workspaces_radio = WID("all_workspaces_radio");
pager->current_only_radio = WID("current_only_radio");
setup_sensitivity(pager, builder, "all_workspaces_radio", "current_only_radio", "label_row_col", pager->settings, "display-all-workspaces" /* key */);
@@ -768,6 +836,16 @@ static void setup_dialog(GtkBuilder* builder, PagerData* pager)
g_object_unref (marco_general_settings);
g_object_unref (marco_workspaces_settings);
+
+ /* Wrap workspaces: */
+ if (pager->wrap_workspaces_toggle)
+ {
+ /* make sure the toggle button resembles the value of wrap_workspaces */
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pager->wrap_workspaces_toggle), pager->wrap_workspaces);
+ }
+
+ g_signal_connect(G_OBJECT(pager->wrap_workspaces_toggle), "toggled", (GCallback) wrap_workspaces_toggled, pager);
+
/* Display workspace names: */
g_signal_connect(G_OBJECT(pager->display_workspaces_toggle), "toggled", (GCallback) display_workspace_names_toggled, pager);
diff --git a/applets/wncklet/workspace-switcher.ui b/applets/wncklet/workspace-switcher.ui
index 8de7fb34..00aae987 100644
--- a/applets/wncklet/workspace-switcher.ui
+++ b/applets/wncklet/workspace-switcher.ui
@@ -234,6 +234,21 @@
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="workspace_wrap_toggle">
+ <property name="label" translatable="yes">Allow workspace _wrap around in switcher</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
</object>
</child>
</object>