diff options
-rw-r--r-- | include/vcl/weld.hxx | 5 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationwindow.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/valueset.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/charmap.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/dbui/mailmergehelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/AnnotationWin2.cxx | 8 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 15 |
10 files changed, 37 insertions, 23 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 40d29291d9b1..e40fd3663618 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -388,11 +388,12 @@ public: { m_aVChangeHdl = rLink; } - virtual int get_vscroll_width() const = 0; + virtual int get_scroll_thickness() const = 0; + virtual void set_scroll_thickness(int nThickness) = 0; //trying to use custom color for a scrollbar is generally a bad idea. virtual void customize_scrollbars(const Color& rBackgroundColor, const Color& rShadowColor, - const Color& rFaceColor, int nMaxThickness) + const Color& rFaceColor) = 0; }; diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index 36e7c28f0e3b..dbae6a579c06 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -398,7 +398,7 @@ void AnnotationContents::DoResize() if( aTextHeight > aHeight ) { // we need vertical scrollbars and have to reduce the width - aWidth -= mxVScrollbar->get_vscroll_width(); + aWidth -= mxVScrollbar->get_scroll_thickness(); mxVScrollbar->set_vpolicy(VclPolicyType::ALWAYS); } else @@ -568,8 +568,8 @@ void AnnotationContents::SetColor() mxVScrollbar->customize_scrollbars(maColorLight, maColorDark, - maColor, - GetPrefScrollbarWidth()); + maColor); + mxVScrollbar->set_scroll_thickness(GetPrefScrollbarWidth()); } void AnnotationContents::GetFocus() diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index ad813a172432..17b2821b807a 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -361,7 +361,7 @@ void ThumbnailView::CalculateItemPositions(bool bScrollBarUsed) nScrollRatio = 0; // calculate ScrollBar width - tools::Long nScrBarWidth = mbAllowVScrollBar ? mxScrolledWindow->get_vscroll_width() : 0; + tools::Long nScrBarWidth = mbAllowVScrollBar ? mxScrolledWindow->get_scroll_thickness() : 0; // calculate maximum number of visible columns mnCols = static_cast<sal_uInt16>((aWinSize.Width()-nScrBarWidth) / mnItemWidth); diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index c9a94de237a1..f71b18bfd77e 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1690,7 +1690,7 @@ void ValueSet::ImplInsertItem( std::unique_ptr<ValueSetItem> pItem, const size_t int ValueSet::GetScrollWidth() const { if (mxScrolledWindow) - return mxScrolledWindow->get_vscroll_width(); + return mxScrolledWindow->get_scroll_thickness(); return 0; } diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index 0ff9631fcb3e..cbde9158cc2e 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -85,7 +85,7 @@ void SvxShowCharSet::SetDrawingArea(weld::DrawingArea* pDrawingArea) nY = aSize.Height() / ROW_COUNT; // tdf#121232 set a size request that will result in a 0 m_nXGap by default - mxScrollArea->set_size_request(COLUMN_COUNT * nX + mxScrollArea->get_vscroll_width() + 2, + mxScrollArea->set_size_request(COLUMN_COUNT * nX + mxScrollArea->get_scroll_thickness() + 2, ROW_COUNT * nY); } diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index 0d086e9c8b29..2ef71463f870 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -388,7 +388,7 @@ void SwAddressPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re sal_uInt16 nStartRow = 0; if (m_xVScrollBar->get_vpolicy() != VclPolicyType::NEVER) { - aSize.AdjustWidth(-m_xVScrollBar->get_vscroll_width()); + aSize.AdjustWidth(-m_xVScrollBar->get_scroll_thickness()); nStartRow = m_xVScrollBar->vadjustment_get_value(); } Size aPartSize(aSize.Width() / pImpl->nColumns, diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 25ad2f03abe0..81a222959ee3 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -460,6 +460,9 @@ void SwAnnotationWin::Rescale() mxMetadataDate->set_font(aFont); if (mxMetadataResolved) mxMetadataResolved->set_font(aFont); + if (mxVScrollbar) + mxVScrollbar->set_scroll_thickness(GetPrefScrollbarWidth()); + } void SwAnnotationWin::SetPosAndSize() @@ -694,7 +697,7 @@ void SwAnnotationWin::DoResize() if (aTextHeight > aHeight) { // we need vertical scrollbars and have to reduce the width - aWidth -= mxVScrollbar->get_vscroll_width(); + aWidth -= mxVScrollbar->get_scroll_thickness(); mxVScrollbar->set_vpolicy(VclPolicyType::ALWAYS); } else @@ -821,8 +824,7 @@ void SwAnnotationWin::SetColor(Color aColorDark,Color aColorLight, Color aColorA mxVScrollbar->customize_scrollbars(mColorLight, mColorAnchor, - mColorDark, - GetPrefScrollbarWidth()); + mColorDark); } void SwAnnotationWin::SetSidebarPosition(sw::sidebarwindows::SidebarPosition eSidebarPosition) diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 3f298886b9c1..07b9125b4cad 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2184,13 +2184,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(); @@ -2198,8 +2206,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 8866abe43733..60b9d200e7bf 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -732,8 +732,8 @@ 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(), - 450); + mxScrolledWindow->get_preferred_size().Width() + mxScrolledWindow->get_scroll_thickness(), + mxScrolledWindow->get_preferred_size().Height()); m_xDialog->set_centered_on_parent(true); } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index d7b74836bf29..7afe6a7b1587 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -6002,13 +6002,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); @@ -6025,7 +6033,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); @@ -6050,9 +6058,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 |