summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-26 10:54:05 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-27 12:51:02 +0200
commitf9fee27333e97e2251fc9b9b56072abc77a227fd (patch)
tree16a09ec2aae8dcd9e9bef9f547ea0a2f8e2982d9 /vcl
parenta341f12325813dafa9be80a70fc90144a144a742 (diff)
enable setting a highlight bg
(cherry picked from commit 9b618c846835abb1fe664b5951dffb3c133380fe) Change-Id: I44649a9e2b1b267b56c2a5691d23665e7df94a58 Reviewed-on: https://gerrit.libreoffice.org/76449 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/salvtables.cxx20
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx6
2 files changed, 21 insertions, 5 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 6f8d11cb7886..bf50e7bc6ce2 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -294,6 +294,15 @@ protected:
virtual bool HandleKeyEventListener(VclWindowEvent& rEvent);
virtual void HandleMouseEventListener(VclSimpleEvent& rEvent);
+ void set_background(const Color& rColor)
+ {
+ m_xWidget->SetControlBackground(rColor);
+ m_xWidget->SetBackground(m_xWidget->GetControlBackground());
+ // turn off WB_CLIPCHILDREN otherwise the bg won't extend "under"
+ // transparent children of the widget
+ m_xWidget->SetStyle(m_xWidget->GetStyle() & ~WB_CLIPCHILDREN);
+ }
+
public:
SalInstanceWidget(vcl::Window* pWidget, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
: m_xWidget(pWidget)
@@ -681,11 +690,12 @@ public:
virtual void set_stack_background() override
{
- m_xWidget->SetControlBackground(m_xWidget->GetSettings().GetStyleSettings().GetWindowColor());
- m_xWidget->SetBackground(m_xWidget->GetControlBackground());
- // turn off WB_CLIPCHILDREN otherwise the bg won't extend "under"
- // transparent children of the widget
- m_xWidget->SetStyle(m_xWidget->GetStyle() & ~WB_CLIPCHILDREN);
+ set_background(m_xWidget->GetSettings().GetStyleSettings().GetWindowColor());;
+ }
+
+ virtual void set_highlight_background() override
+ {
+ set_background(m_xWidget->GetSettings().GetStyleSettings().GetHighlightColor());;
}
SystemWindow* getSystemWindow()
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index a846b16d6e17..5e5feb493c86 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2105,6 +2105,12 @@ public:
set_background(&sColor);
}
+ virtual void set_highlight_background() override
+ {
+ OUString sColor = Application::GetSettings().GetStyleSettings().GetHighlightColor().AsRGBHexString();
+ set_background(&sColor);
+ }
+
virtual ~GtkInstanceWidget() override
{
if (m_pFocusEvent)