diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-10-27 10:50:44 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-11-08 09:14:38 +0100 |
commit | c8ae3b1e9806cee83466087df989fc05d0c448f2 (patch) | |
tree | a6869a767819d3fffa5dc379331918638875159f /vcl/source/window | |
parent | ef70918177d244a4e984f629a5856cca2ec9ac00 (diff) |
LOK: custom widgets: support custom menu colors
Change-Id: Icd6367fa40f9655cd58816461f0d2fca6f6932e2
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/menufloatingwindow.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index c66510cf8f1a..7a6730c3ef49 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -21,6 +21,7 @@ #include "menuitemlist.hxx" #include "menubarwindow.hxx" +#include <salframe.hxx> #include <svdata.hxx> #include <vcl/decoview.hxx> #include <vcl/settings.hxx> @@ -135,8 +136,22 @@ void MenuFloatingWindow::ApplySettings(vcl::RenderContext& rRenderContext) { FloatingWindow::ApplySettings(rRenderContext); - const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); + if (IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItem) && + IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire)) + { + AllSettings aSettings(GetSettings()); + ImplGetFrame()->UpdateSettings(aSettings); // Update theme colors. + StyleSettings aStyle(aSettings.GetStyleSettings()); + Color aHighlightTextColor = ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor; + if (aHighlightTextColor != Color(COL_TRANSPARENT)) + { + aStyle.SetMenuHighlightTextColor(aHighlightTextColor); + } + aSettings.SetStyleSettings(aStyle); + OutputDevice::SetSettings(aSettings); + } + const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); SetPointFont(rRenderContext, rStyleSettings.GetMenuFont()); if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire)) |