diff options
Diffstat (limited to 'vcl/unx/gtk3/salnativewidgets-gtk.cxx')
-rw-r--r-- | vcl/unx/gtk3/salnativewidgets-gtk.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx b/vcl/unx/gtk3/salnativewidgets-gtk.cxx index bfdeed4238..391baed222 100644 --- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx @@ -355,7 +355,6 @@ static GtkWidget* gCacheWindow; static GtkWidget* gDumbContainer; #if GTK_CHECK_VERSION(4, 0, 0) static GtkWidget* gVScrollbar; -static GtkWidget* gHScrollbar; static GtkWidget* gTextView; #else static GtkWidget* gComboBox; @@ -363,6 +362,7 @@ static GtkWidget* gListBox; static GtkWidget* gSpinBox; static GtkWidget* gTreeViewWidget; #endif +static GtkWidget* gHScrollbar; static GtkWidget* gEntryBox; namespace @@ -2625,10 +2625,11 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings) // set scrollbar settings gint min_slider_length = 21; + GtkRequisition natural_horz_scroll_size; + gtk_widget_get_preferred_size(gHScrollbar, nullptr, &natural_horz_scroll_size); + #if GTK_CHECK_VERSION(4, 0, 0) - GtkRequisition natural_size; - gtk_widget_get_preferred_size(gHScrollbar, nullptr, &natural_size); - aStyleSet.SetScrollBarSize(natural_size.height); + aStyleSet.SetScrollBarSize(natural_horz_scroll_size.height); #else // Grab some button style attributes Size aSize; @@ -2646,6 +2647,10 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings) if (has_forward || has_backward || has_forward2 || has_backward2) QuerySize(mpHScrollbarButtonStyle, aSize); + // Recent breeze (Mar 2024) has 17 vs 10, while Adwaita still reports 14 vs 14. + if (natural_horz_scroll_size.height > aSize.Height()) + aSize.setHeight(natural_horz_scroll_size.height); + aStyleSet.SetScrollBarSize(aSize.Height()); gtk_style_context_get(mpVScrollbarSliderStyle, gtk_style_context_get_state(mpVScrollbarSliderStyle), @@ -2932,15 +2937,16 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) mpToolButtonStyle = gtk_widget_get_style_context(GTK_WIDGET(pButton)); #endif + gHScrollbar = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, nullptr); + gtk_fixed_put(GTK_FIXED(gDumbContainer), gHScrollbar, 0, 0); + gtk_widget_show(gHScrollbar); + #if GTK_CHECK_VERSION(4, 0, 0) gVScrollbar = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, nullptr); gtk_fixed_put(GTK_FIXED(gDumbContainer), gVScrollbar, 0, 0); gtk_widget_show(gVScrollbar); mpVScrollbarStyle = gtk_widget_get_style_context(gVScrollbar); - gHScrollbar = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, nullptr); - gtk_fixed_put(GTK_FIXED(gDumbContainer), gHScrollbar, 0, 0); - gtk_widget_show(gHScrollbar); mpHScrollbarStyle = gtk_widget_get_style_context(gHScrollbar); gTextView = gtk_text_view_new(); |