Skip to content
Permalink
Browse files

hidpi: fix tray icon spacing with window-scaling > 1

  • Loading branch information...
lukefromdc committed Mar 21, 2018
1 parent ff04f33 commit 0b15ea1f6d218cc2a850bef3f0cb98d303c63bc3
@@ -120,6 +120,8 @@ na_tray_child_get_preferred_width (GtkWidget *widget,
gint *minimal_width,
gint *natural_width)
{
gint scale;
scale = gtk_widget_get_scale_factor (widget);
GTK_WIDGET_CLASS (na_tray_child_parent_class)->get_preferred_width (widget,
minimal_width,
natural_width);
@@ -129,13 +131,18 @@ na_tray_child_get_preferred_width (GtkWidget *widget,

if (*natural_width < 16)
*natural_width = 16;

*minimal_width = *minimal_width / scale;
*natural_width = *natural_width / scale;
}

static void
na_tray_child_get_preferred_height (GtkWidget *widget,
gint *minimal_height,
gint *natural_height)
{
gint scale;
scale = gtk_widget_get_scale_factor (widget);
GTK_WIDGET_CLASS (na_tray_child_parent_class)->get_preferred_height (widget,
minimal_height,
natural_height);
@@ -145,6 +152,9 @@ na_tray_child_get_preferred_height (GtkWidget *widget,

if (*natural_height < 16)
*natural_height = 16;

*minimal_height = *minimal_height / scale;
*natural_height = *natural_height / scale;
}

static void
@@ -127,7 +127,8 @@ tray_added (NaTrayManager *manager,

na_host_emit_item_added (NA_HOST (tray), NA_ITEM (icon));

gtk_widget_show (GTK_WIDGET (icon));
/*Does not seem to be needed anymore and can cause a render issue with hidpi*/
/*gtk_widget_show (GTK_WIDGET (icon));*/
}

static void

0 comments on commit 0b15ea1

Please sign in to comment.
You can’t perform that action at this time.