Commit 59951a69 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

don't use deprecated gtk_icon_size_register

Also 'gtk-icon-sizes' in themes are deprecated and ignored. That
means that panel-menu and panel-menu-bar always is registered with
default sizes - 24x24px and 16x16px. We can safely replace these by
built-in stock icon sizes.

This commit also restores limited option to change icon size. You
can change icon size to one of built-in sizes - 16px, 24px, 32px
and 48px.
parent 7807bf81
......@@ -7,6 +7,13 @@
<child name="run-dialog" schema="org.gnome.gnome-panel.run-dialog"/>
</schema>
<enum id='org.gnome.gnome-panel.icon-size'>
<value nick='16px' value='1'/>
<value nick='24px' value='3'/>
<value nick='32px' value='5'/>
<value nick='48px' value='6'/>
</enum>
<schema id="org.gnome.gnome-panel.general" path="/org/gnome/gnome-panel/general/">
<key name="enable-tooltips" type="b">
<default>true</default>
......@@ -18,6 +25,14 @@
<_summary>Confirm panel removal</_summary>
<_description>If true, a dialog is shown asking for confirmation if the user wants to remove a panel.</_description>
</key>
<key name="panel-menu" enum="org.gnome.gnome-panel.icon-size">
<default>'24px'</default>
<_summary>Icon size in the menus</_summary>
</key>
<key name="panel-menu-bar" enum="org.gnome.gnome-panel.icon-size">
<default>'16px'</default>
<_summary>Icon size for only Applications item in the Menu Bar applet</_summary>
</key>
</schema>
<schema id="org.gnome.gnome-panel.layout" path="/org/gnome/gnome-panel/layout/">
......
......@@ -95,7 +95,6 @@ main (int argc, char **argv)
panel_action_protocol_init ();
panel_multiscreen_init ();
panel_init_stock_icons_and_items ();
if (!panel_layout_load ()) {
panel_cleanup_do ();
......
......@@ -57,6 +57,12 @@ static GtkIconSize panel_menu_bar_object_icon_size = 0;
GtkIconSize
panel_menu_bar_object_icon_get_size (void)
{
if (panel_menu_bar_object_icon_size == 0) {
GSettings *settings = g_settings_new ("org.gnome.gnome-panel.general");
panel_menu_bar_object_icon_size = (GtkIconSize) g_settings_get_enum (settings, "panel-menu-bar");
g_object_unref (settings);
}
return panel_menu_bar_object_icon_size;
}
......@@ -188,11 +194,6 @@ panel_menu_bar_object_class_init (PanelMenuBarObjectClass *klass)
PANEL_TYPE_ORIENTATION,
PANEL_ORIENTATION_TOP,
G_PARAM_READWRITE));
if (panel_menu_bar_object_icon_size == 0)
panel_menu_bar_object_icon_size = gtk_icon_size_register ("panel-menu-bar",
PANEL_DEFAULT_MENU_BAR_OBJECT_ICON_SIZE,
PANEL_DEFAULT_MENU_BAR_OBJECT_ICON_SIZE);
}
static gboolean
......
......@@ -34,13 +34,11 @@ static GtkIconSize panel_menu_icon_size = 0;
GtkIconSize
panel_menu_icon_get_size (void)
{
return panel_menu_icon_size;
}
if (panel_menu_icon_size == 0) {
GSettings *settings = g_settings_new ("org.gnome.gnome-panel.general");
panel_menu_icon_size = (GtkIconSize) g_settings_get_enum (settings, "panel-menu");
g_object_unref (settings);
}
void
panel_init_stock_icons_and_items (void)
{
panel_menu_icon_size = gtk_icon_size_register ("panel-menu",
PANEL_DEFAULT_MENU_ICON_SIZE,
PANEL_DEFAULT_MENU_ICON_SIZE);
return panel_menu_icon_size;
}
......@@ -31,7 +31,6 @@ G_BEGIN_DECLS
/* themeable size - "panel-menu" -- This is used for the icons in the menus */
#define PANEL_DEFAULT_MENU_ICON_SIZE 24
void panel_init_stock_icons_and_items (void);
GtkIconSize panel_menu_icon_get_size (void);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment