summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-10-27 10:50:44 -0400
committerJan Holesovsky <kendy@collabora.com>2018-11-09 18:42:32 +0100
commit93ffc5cd079dda8eb77f625aa7119f9d6b614fab (patch)
tree824474d57a79e1d58b89ee78fab01a930e253648 /vcl
parent23a5a45ee4a8a097192e3c137910a1c81d3604a2 (diff)
LOK: custom widgets: support custom menu colors
Change-Id: Icd6367fa40f9655cd58816461f0d2fca6f6932e2
Diffstat (limited to 'vcl')
-rw-r--r--vcl/headless/CustomWidgetDraw.cxx8
-rw-r--r--vcl/source/window/menufloatingwindow.cxx17
2 files changed, 20 insertions, 5 deletions
diff --git a/vcl/headless/CustomWidgetDraw.cxx b/vcl/headless/CustomWidgetDraw.cxx
index bdae8cea8ade..c428213c6000 100644
--- a/vcl/headless/CustomWidgetDraw.cxx
+++ b/vcl/headless/CustomWidgetDraw.cxx
@@ -343,15 +343,15 @@ bool CustomWidgetDraw::updateSettings(AllSettings& rSettings)
aStyleSet.SetDeactiveColor(Color(COL_GRAY));
aStyleSet.SetDeactiveTextColor(Color(COL_LIGHTGRAY));
aStyleSet.SetDeactiveBorderColor(Color(COL_LIGHTGRAY));
- aStyleSet.SetMenuColor(Color(COL_LIGHTGRAY));
- aStyleSet.SetMenuBarColor(Color(COL_LIGHTGRAY));
- aStyleSet.SetMenuBarRolloverColor(Color(COL_BLUE));
+ aStyleSet.SetMenuColor(Color(COL_WHITE));
+ aStyleSet.SetMenuBarColor(Color(COL_WHITE));
+ aStyleSet.SetMenuBarRolloverColor(aStyle.maHighlightColor);
aStyleSet.SetMenuBorderColor(Color(COL_LIGHTGRAY));
aStyleSet.SetMenuTextColor(Color(COL_BLACK));
aStyleSet.SetMenuBarTextColor(Color(COL_BLACK));
aStyleSet.SetMenuBarRolloverTextColor(Color(COL_WHITE));
aStyleSet.SetMenuBarHighlightTextColor(Color(COL_WHITE));
- aStyleSet.SetMenuHighlightColor(Color(COL_BLUE));
+ aStyleSet.SetMenuHighlightColor(aStyle.maHighlightColor);
aStyleSet.SetMenuHighlightTextColor(Color(COL_WHITE));
aStyleSet.SetHighlightColor(aStyle.maHighlightColor);
aStyleSet.SetHighlightTextColor(aStyle.maHighlightTextColor);
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index 38bb20301bef..aa9bd5a8bc1c 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -23,6 +23,7 @@
#include <sal/log.hxx>
#include <salmenu.hxx>
+#include <salframe.hxx>
#include <svdata.hxx>
#include <vcl/decoview.hxx>
#include <vcl/settings.hxx>
@@ -136,8 +137,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))