diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-19 10:13:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-02-19 13:33:09 +0100 |
commit | b925043f64179c23c5f7cfbc20b7c46cebdd1a26 (patch) | |
tree | f5873f3c355be1ea218d9176d4912484f43de226 /vcl | |
parent | de9d840743413470aa57333fbe540d6c8f7dffb1 (diff) |
rename get_vscroll_width to get_scroll_thickness
and add split customize_scrollbars to form a separate set_scroll_thickness
Change-Id: Ia4b1c85d6ae85b0fb7aeb852d3a91b36b63143db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111207
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 15 |
3 files changed, 21 insertions, 10 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 31964747cd11..7bb05907ecba 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2223,13 +2223,21 @@ public: return VclPolicyType::NEVER; } - virtual int get_vscroll_width() const override + virtual int get_scroll_thickness() const override { return m_xScrolledWindow->getVertScrollBar().get_preferred_size().Width(); } + virtual void set_scroll_thickness(int nThickness) override + { + ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); + ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); + rHorzScrollBar.set_height_request(nThickness); + rVertScrollBar.set_width_request(nThickness); + } + virtual void customize_scrollbars(const Color& rBackgroundColor, const Color& rShadowColor, - const Color& rFaceColor, int nThickness) override + const Color& rFaceColor) override { ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); @@ -2237,8 +2245,6 @@ public: rFaceColor); customize_scrollbars(rVertScrollBar, Color(0, 0, 0), rBackgroundColor, rShadowColor, rFaceColor); - rHorzScrollBar.set_height_request(nThickness); - rVertScrollBar.set_width_request(nThickness); } virtual ~SalInstanceScrolledWindow() override diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index f5fac8531094..a6352f16384a 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -683,7 +683,7 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptr<PrinterC // lock the dialog height, regardless of later expander state mxScrolledWindow->set_size_request( - mxScrolledWindow->get_preferred_size().Width() + mxScrolledWindow->get_vscroll_width(), + mxScrolledWindow->get_preferred_size().Width() + mxScrolledWindow->get_scroll_thickness(), mxScrolledWindow->get_preferred_size().Height()); } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index a8191a29a2ed..470fae9387ea 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -5956,13 +5956,21 @@ public: return GtkToVcl(eGtkVPolicy); } - virtual int get_vscroll_width() const override + virtual int get_scroll_thickness() const override { if (gtk_scrolled_window_get_overlay_scrolling(m_pScrolledWindow)) return 0; return gtk_widget_get_allocated_width(gtk_scrolled_window_get_vscrollbar(m_pScrolledWindow)); } + virtual void set_scroll_thickness(int nThickness) override + { + GtkWidget *pHorzBar = gtk_scrolled_window_get_hscrollbar(m_pScrolledWindow); + GtkWidget *pVertBar = gtk_scrolled_window_get_vscrollbar(m_pScrolledWindow); + gtk_widget_set_size_request(pHorzBar, -1, nThickness); + gtk_widget_set_size_request(pVertBar, nThickness, -1); + } + virtual void disable_notify_events() override { g_signal_handler_block(m_pVAdjustment, m_nVAdjustChangedSignalId); @@ -5979,7 +5987,7 @@ public: virtual void customize_scrollbars(const Color& rBackgroundColor, const Color& rShadowColor, - const Color& rFaceColor, int nThickness) override + const Color& rFaceColor) override { GtkWidget *pHorzBar = gtk_scrolled_window_get_hscrollbar(m_pScrolledWindow); GtkWidget *pVertBar = gtk_scrolled_window_get_vscrollbar(m_pScrolledWindow); @@ -6005,9 +6013,6 @@ public: GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); gtk_style_context_add_provider(pVertContext, GTK_STYLE_PROVIDER(m_pScrollBarCssProvider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); - - gtk_widget_set_size_request(pHorzBar, -1, nThickness); - gtk_widget_set_size_request(pVertBar, nThickness, -1); } virtual ~GtkInstanceScrolledWindow() override |