summaryrefslogtreecommitdiff
path: root/plugins/xrandr
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2018-05-31 00:47:19 -0400
committerlukefromdc <[email protected]>2018-05-31 14:20:00 -0400
commit6d92e9c81e7a95c4e0a424416f7aa03d65c61799 (patch)
tree96f5c5444a4d4f17e4c0cc8010becec4b7673efd /plugins/xrandr
parent3cfc8b5587e9bed4f0c9f1b57b9610495682edeb (diff)
downloadmate-settings-daemon-6d92e9c81e7a95c4e0a424416f7aa03d65c61799.tar.bz2
mate-settings-daemon-6d92e9c81e7a95c4e0a424416f7aa03d65c61799.tar.xz
xrandr-applet-popup: add an icon for configuration item
To distinguish it more quickly from mirror(clone) item and rotation items. Also show it only if icons in menus are turned on
Diffstat (limited to 'plugins/xrandr')
-rw-r--r--plugins/xrandr/msd-xrandr-manager.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/xrandr/msd-xrandr-manager.c b/plugins/xrandr/msd-xrandr-manager.c
index 5f9df18..ff60bd0 100644
--- a/plugins/xrandr/msd-xrandr-manager.c
+++ b/plugins/xrandr/msd-xrandr-manager.c
@@ -2277,6 +2277,10 @@ status_icon_popup_menu (MsdXrandrManager *manager, guint button, guint32 timesta
{
struct MsdXrandrManagerPrivate *priv = manager->priv;
GtkWidget *item;
+ GtkWidget *image;
+ GtkWidget *label;
+ GtkWidget *box;
+ GSettings *icon_settings;
g_assert (priv->configuration == NULL);
priv->configuration = mate_rr_config_new_current (priv->rw_screen, NULL);
@@ -2295,11 +2299,23 @@ status_icon_popup_menu (MsdXrandrManager *manager, guint button, guint32 timesta
add_menu_items_for_clone (manager);
- item = gtk_menu_item_new_with_mnemonic (_("_Configure Display Settingsā€¦"));
+ item = gtk_menu_item_new();
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
+ image = gtk_image_new_from_icon_name ("preferences-system", GTK_ICON_SIZE_MENU);
+ label = gtk_label_new_with_mnemonic("_Configure Display Settingsā€¦");
+ /*Load the icon unless the user has icons in menus turned off*/
+ icon_settings = g_settings_new ("org.mate.interface");
+ if (g_settings_get_boolean (icon_settings, "menus-have-icons")){
+ gtk_container_add (GTK_CONTAINER (box), image);
+ g_signal_connect (item, "size-allocate",
+ G_CALLBACK (title_item_size_allocate_cb), NULL);
+ }
+ gtk_container_add (GTK_CONTAINER (box), label);
+ gtk_container_add (GTK_CONTAINER (item), box);
gtk_widget_set_tooltip_text(item, "Open the display configuration dialog (all settings)");
g_signal_connect (item, "activate",
G_CALLBACK (popup_menu_configure_display_cb), manager);
- gtk_widget_show (item);
+ gtk_widget_show_all (item);
gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), item);
g_signal_connect (priv->popup_menu, "selection-done",