summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/org.mate.panel.menubar.gschema.xml.in20
-rw-r--r--mate-panel/panel-stock-icons.c35
2 files changed, 48 insertions, 7 deletions
diff --git a/data/org.mate.panel.menubar.gschema.xml.in b/data/org.mate.panel.menubar.gschema.xml.in
index 0c707412..71cd4e97 100644
--- a/data/org.mate.panel.menubar.gschema.xml.in
+++ b/data/org.mate.panel.menubar.gschema.xml.in
@@ -1,4 +1,14 @@
<schemalist gettext-domain="@GETTEXT_PACKAGE@">
+
+ <enum id="org.mate.panel.menubar.icon-size">
+ <value nick="default" value="-1"/>
+ <value nick="16px" value="16"/>
+ <value nick="22px" value="22"/>
+ <value nick="24px" value="24"/>
+ <value nick="32px" value="32"/>
+ <value nick="48px" value="48"/>
+ </enum>
+
<schema id="org.mate.panel.menubar" path="/org/mate/panel/menubar/">
<key name="show-applications" type="b">
<default>true</default>
@@ -25,5 +35,15 @@
<summary>Icon to show in menu bar</summary>
<description>Set the theme icon name to use in menu bar.</description>
</key>
+ <key name="icon-size" enum="org.mate.panel.menubar.icon-size">
+ <default>'default'</default>
+ <summary>Menu bar icon size</summary>
+ <description>Set the size of an icon used in menu bar. The panel must be restarted for this to take effect.</description>
+ </key>
+ <key name="item-icon-size" enum="org.mate.panel.menubar.icon-size">
+ <default>'default'</default>
+ <summary>Menu items icon size</summary>
+ <description>Set the size of icons used in the menu. The panel must be restarted for this to take effect.</description>
+ </key>
</schema>
</schemalist>
diff --git a/mate-panel/panel-stock-icons.c b/mate-panel/panel-stock-icons.c
index 26639784..514e5818 100644
--- a/mate-panel/panel-stock-icons.c
+++ b/mate-panel/panel-stock-icons.c
@@ -30,6 +30,7 @@
#include <gtk/gtk.h>
#include "panel-icon-names.h"
+#include "panel-schemas.h"
static GtkIconSize panel_menu_icon_size = 0;
static GtkIconSize panel_menu_bar_icon_size = 0;
@@ -128,14 +129,33 @@ void
panel_init_stock_icons_and_items (void)
{
GtkIconFactory *factory;
+ GSettings *settings;
+ gint icon_size;
+
+ settings = g_settings_new (PANEL_MENU_BAR_SCHEMA);
+
+ icon_size = g_settings_get_enum (settings, "item-icon-size");
+ if (icon_size <= 0) {
+ panel_menu_icon_size = gtk_icon_size_register ("panel-menu",
+ PANEL_DEFAULT_MENU_ICON_SIZE,
+ PANEL_DEFAULT_MENU_ICON_SIZE);
+ } else {
+ /* underscores to prevent themes from altering these settings */
+ panel_menu_icon_size = gtk_icon_size_register ("__panel-menu",
+ icon_size,
+ icon_size);
+ }
- panel_menu_icon_size = gtk_icon_size_register ("panel-menu",
- PANEL_DEFAULT_MENU_ICON_SIZE,
- PANEL_DEFAULT_MENU_ICON_SIZE);
-
- panel_menu_bar_icon_size = gtk_icon_size_register ("panel-foobar",
- PANEL_DEFAULT_MENU_BAR_ICON_SIZE,
- PANEL_DEFAULT_MENU_BAR_ICON_SIZE);
+ icon_size = g_settings_get_enum (settings, "icon-size");
+ if (icon_size <= 0) {
+ panel_menu_bar_icon_size = gtk_icon_size_register ("panel-foobar",
+ PANEL_DEFAULT_MENU_BAR_ICON_SIZE,
+ PANEL_DEFAULT_MENU_BAR_ICON_SIZE);
+ } else {
+ panel_menu_bar_icon_size = gtk_icon_size_register ("__panel-foobar",
+ icon_size,
+ icon_size);
+ }
panel_add_to_icon_size = gtk_icon_size_register ("panel-add-to",
PANEL_ADD_TO_DEFAULT_ICON_SIZE,
@@ -148,4 +168,5 @@ panel_init_stock_icons_and_items (void)
panel_init_stock_items (factory);
g_object_unref (factory);
+ g_object_unref (settings);
}