Kaydet (Commit) 93ffc5cd authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Jan Holesovsky

LOK: custom widgets: support custom menu colors

Change-Id: Icd6367fa40f9655cd58816461f0d2fca6f6932e2
üst 23a5a45e
...@@ -343,15 +343,15 @@ bool CustomWidgetDraw::updateSettings(AllSettings& rSettings) ...@@ -343,15 +343,15 @@ bool CustomWidgetDraw::updateSettings(AllSettings& rSettings)
aStyleSet.SetDeactiveColor(Color(COL_GRAY)); aStyleSet.SetDeactiveColor(Color(COL_GRAY));
aStyleSet.SetDeactiveTextColor(Color(COL_LIGHTGRAY)); aStyleSet.SetDeactiveTextColor(Color(COL_LIGHTGRAY));
aStyleSet.SetDeactiveBorderColor(Color(COL_LIGHTGRAY)); aStyleSet.SetDeactiveBorderColor(Color(COL_LIGHTGRAY));
aStyleSet.SetMenuColor(Color(COL_LIGHTGRAY)); aStyleSet.SetMenuColor(Color(COL_WHITE));
aStyleSet.SetMenuBarColor(Color(COL_LIGHTGRAY)); aStyleSet.SetMenuBarColor(Color(COL_WHITE));
aStyleSet.SetMenuBarRolloverColor(Color(COL_BLUE)); aStyleSet.SetMenuBarRolloverColor(aStyle.maHighlightColor);
aStyleSet.SetMenuBorderColor(Color(COL_LIGHTGRAY)); aStyleSet.SetMenuBorderColor(Color(COL_LIGHTGRAY));
aStyleSet.SetMenuTextColor(Color(COL_BLACK)); aStyleSet.SetMenuTextColor(Color(COL_BLACK));
aStyleSet.SetMenuBarTextColor(Color(COL_BLACK)); aStyleSet.SetMenuBarTextColor(Color(COL_BLACK));
aStyleSet.SetMenuBarRolloverTextColor(Color(COL_WHITE)); aStyleSet.SetMenuBarRolloverTextColor(Color(COL_WHITE));
aStyleSet.SetMenuBarHighlightTextColor(Color(COL_WHITE)); aStyleSet.SetMenuBarHighlightTextColor(Color(COL_WHITE));
aStyleSet.SetMenuHighlightColor(Color(COL_BLUE)); aStyleSet.SetMenuHighlightColor(aStyle.maHighlightColor);
aStyleSet.SetMenuHighlightTextColor(Color(COL_WHITE)); aStyleSet.SetMenuHighlightTextColor(Color(COL_WHITE));
aStyleSet.SetHighlightColor(aStyle.maHighlightColor); aStyleSet.SetHighlightColor(aStyle.maHighlightColor);
aStyleSet.SetHighlightTextColor(aStyle.maHighlightTextColor); aStyleSet.SetHighlightTextColor(aStyle.maHighlightTextColor);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <sal/log.hxx> #include <sal/log.hxx>
#include <salmenu.hxx> #include <salmenu.hxx>
#include <salframe.hxx>
#include <svdata.hxx> #include <svdata.hxx>
#include <vcl/decoview.hxx> #include <vcl/decoview.hxx>
#include <vcl/settings.hxx> #include <vcl/settings.hxx>
...@@ -136,8 +137,22 @@ void MenuFloatingWindow::ApplySettings(vcl::RenderContext& rRenderContext) ...@@ -136,8 +137,22 @@ void MenuFloatingWindow::ApplySettings(vcl::RenderContext& rRenderContext)
{ {
FloatingWindow::ApplySettings(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()); SetPointFont(rRenderContext, rStyleSettings.GetMenuFont());
if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire)) if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment