Skip to content
Browse files
xrandr applet popup: add monitor icons to monitor label menuitems
  • Loading branch information
lukefromdc committed May 18, 2018
1 parent a386cd6 commit 57b6fa4e37afa3449208abf6578bfc5a773c60b2
Showing with 7 additions and 1 deletion.
  1. +7 −1 plugins/xrandr/msd-xrandr-manager.c
@@ -1717,9 +1717,13 @@ make_menu_item_for_output_title (MsdXrandrManager *manager, MateRROutputInfo *ou
GtkWidget *item;
GtkStyleContext *context;
GtkWidget *label;
GtkWidget *image;
GtkWidget *box;
char *str;

item = gtk_menu_item_new ();
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
image = gtk_image_new_from_icon_name ("computer-symbolic", GTK_ICON_SIZE_MENU);
context = gtk_widget_get_style_context (item);
gtk_style_context_add_class (context, "xrandr-applet");

@@ -1739,7 +1743,9 @@ make_menu_item_for_output_title (MsdXrandrManager *manager, MateRROutputInfo *ou
gtk_widget_set_margin_top (label, OUTPUT_TITLE_ITEM_BORDER + OUTPUT_TITLE_ITEM_PADDING);
gtk_widget_set_margin_bottom (label, OUTPUT_TITLE_ITEM_BORDER + OUTPUT_TITLE_ITEM_PADDING);

gtk_container_add (GTK_CONTAINER (item), label);
gtk_container_add (GTK_CONTAINER (box), image);
gtk_container_add (GTK_CONTAINER (box), label);
gtk_container_add (GTK_CONTAINER (item), box);

gtk_widget_set_sensitive (item, FALSE); /* the title is not selectable */
gtk_widget_show_all (item);

0 comments on commit 57b6fa4

Please sign in to comment.