diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-26 10:54:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-27 12:51:02 +0200 |
commit | f9fee27333e97e2251fc9b9b56072abc77a227fd (patch) | |
tree | 16a09ec2aae8dcd9e9bef9f547ea0a2f8e2982d9 | |
parent | a341f12325813dafa9be80a70fc90144a144a742 (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>
-rw-r--r-- | include/vcl/weld.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/RemoteDialogClientBox.cxx | 3 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 20 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 6 |
4 files changed, 26 insertions, 5 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index d422c84193cc..95dd97e9418a 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -237,6 +237,8 @@ public: //make this widget look like a page in a notebook virtual void set_stack_background() = 0; + //make this widget look like it has a highlighted background + virtual void set_highlight_background() = 0; virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() = 0; diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index 30dab80f999a..775047ae5e89 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -135,7 +135,10 @@ IMPL_LINK_NOARG(ClientBoxEntry, DeauthoriseHdl, weld::Button&, void) IMPL_LINK_NOARG(ClientBoxEntry, FocusHdl, weld::Widget&, void) { + if (ClientBoxEntry* pOldEntry = m_pClientBox->GetActiveEntry()) + pOldEntry->m_xContainer->set_stack_background(); m_pClientBox->setActive(this); + m_xContainer->set_highlight_background(); } } //namespace dp_gui 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) |