Skip to content

Commit 6d92e9c

Browse files
committed
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
1 parent 3cfc8b5 commit 6d92e9c

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

plugins/xrandr/msd-xrandr-manager.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,6 +2277,10 @@ status_icon_popup_menu (MsdXrandrManager *manager, guint button, guint32 timesta
22772277
{
22782278
struct MsdXrandrManagerPrivate *priv = manager->priv;
22792279
GtkWidget *item;
2280+
GtkWidget *image;
2281+
GtkWidget *label;
2282+
GtkWidget *box;
2283+
GSettings *icon_settings;
22802284

22812285
g_assert (priv->configuration == NULL);
22822286
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
22952299

22962300
add_menu_items_for_clone (manager);
22972301

2298-
item = gtk_menu_item_new_with_mnemonic (_("_Configure Display Settings…"));
2302+
item = gtk_menu_item_new();
2303+
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
2304+
image = gtk_image_new_from_icon_name ("preferences-system", GTK_ICON_SIZE_MENU);
2305+
label = gtk_label_new_with_mnemonic("_Configure Display Settings…");
2306+
/*Load the icon unless the user has icons in menus turned off*/
2307+
icon_settings = g_settings_new ("org.mate.interface");
2308+
if (g_settings_get_boolean (icon_settings, "menus-have-icons")){
2309+
gtk_container_add (GTK_CONTAINER (box), image);
2310+
g_signal_connect (item, "size-allocate",
2311+
G_CALLBACK (title_item_size_allocate_cb), NULL);
2312+
}
2313+
gtk_container_add (GTK_CONTAINER (box), label);
2314+
gtk_container_add (GTK_CONTAINER (item), box);
22992315
gtk_widget_set_tooltip_text(item, "Open the display configuration dialog (all settings)");
23002316
g_signal_connect (item, "activate",
23012317
G_CALLBACK (popup_menu_configure_display_cb), manager);
2302-
gtk_widget_show (item);
2318+
gtk_widget_show_all (item);
23032319
gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), item);
23042320

23052321
g_signal_connect (priv->popup_menu, "selection-done",

0 commit comments

Comments
 (0)