From dc0cf732a299cb3bc4402bea6fb0535d7ae9898c Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 1 Nov 2018 09:58:27 -0700 Subject: [PATCH] Provide scale factor to wxGtkStyleContext where it might matter. --- src/gtk/settings.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 1e3a553340..c7f3a092a2 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -790,7 +790,8 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) g_signal_connect(gtk_settings_get_default(), "notify::gtk-font-name", G_CALLBACK(notify_gtk_font_name), NULL); } - wxGtkStyleContext sc; + ContainerWidget(); + wxGtkStyleContext sc(gtk_widget_get_scale_factor(gs_tlw_parent)); sc.AddButton().AddLabel(); gtk_style_context_get(sc, GTK_STATE_FLAG_NORMAL, GTK_STYLE_PROPERTY_FONT, &info.description, NULL); @@ -874,7 +875,7 @@ static int GetScrollbarWidth() if (wx_is_at_least_gtk3(20)) { GtkBorder border; - wxGtkStyleContext sc; + wxGtkStyleContext sc(gtk_widget_get_scale_factor(ScrollBarWidget())); sc.Add(GTK_TYPE_SCROLLBAR, "scrollbar", "scrollbar", "vertical", "right", NULL); gtk_style_context_get_border(sc, GTK_STATE_FLAG_NORMAL, &border);