summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-01-29 13:00:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-01-30 11:38:24 +0100
commit6aa18a840cc205b430999e4243d9ee4b9091432d (patch)
tree0e37b327d8c82b182c0594f2916baf5275976114 /vcl/source/app
parent6792aa49a5a7eba601693734a164ab45042c580b (diff)
add something to override scrollbar colors
Change-Id: Ibc2e428fcda41f4e9150f3e5029ba346c459c4b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110159 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/salvtables.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index fe93e637a823..e9e675e1645b 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1969,6 +1969,21 @@ private:
DECL_LINK(VscrollHdl, ScrollBar*, void);
DECL_LINK(HscrollHdl, ScrollBar*, void);
+ static void customize_scrollbars(ScrollBar& rScrollBar, const Color& rButtonTextColor,
+ const Color& rBackgroundColor, const Color& rShadowColor,
+ const Color& rFaceColor)
+ {
+ rScrollBar.EnableNativeWidget(false);
+ AllSettings aSettings = rScrollBar.GetSettings();
+ StyleSettings aStyleSettings = aSettings.GetStyleSettings();
+ aStyleSettings.SetButtonTextColor(rButtonTextColor);
+ aStyleSettings.SetCheckedColor(rBackgroundColor); // background
+ aStyleSettings.SetShadowColor(rShadowColor);
+ aStyleSettings.SetFaceColor(rFaceColor);
+ aSettings.SetStyleSettings(aStyleSettings);
+ rScrollBar.SetSettings(aSettings);
+ }
+
public:
SalInstanceScrolledWindow(VclScrolledWindow* pScrolledWindow, SalInstanceBuilder* pBuilder,
bool bTakeOwnership, bool bUserManagedScrolling)
@@ -2173,6 +2188,19 @@ public:
return m_xScrolledWindow->getVertScrollBar().get_preferred_size().Width();
}
+ virtual void customize_scrollbars(const Color& rBackgroundColor, const Color& rShadowColor,
+ const Color& rFaceColor, int nThickness) override
+ {
+ ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
+ ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
+ customize_scrollbars(rHorzScrollBar, Color(0, 0, 0), rBackgroundColor, rShadowColor,
+ rFaceColor);
+ customize_scrollbars(rVertScrollBar, Color(0, 0, 0), rBackgroundColor, rShadowColor,
+ rFaceColor);
+ rHorzScrollBar.set_height_request(nThickness);
+ rVertScrollBar.set_width_request(nThickness);
+ }
+
virtual ~SalInstanceScrolledWindow() override
{
ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();