diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-09-20 00:06:52 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-11-09 18:42:31 +0100 |
commit | b838e7e800d7c05bbe168a0eb8efa625d8b539cf (patch) | |
tree | f8fbce402bf47023abf95af43e1da367260a01d4 /vcl/headless/CustomWidgetDraw.cxx | |
parent | 7d879658886cd73b38b12e5e6081bac7eda145d1 (diff) |
custom widgets: setup style setting in the widget library
Some theme colors are set using the style settings, which are
implemented by each backend to correspond to the system theme.
For custom widgets these need to also be set by the library
itself. This commit adds the ground work and sets some of the
colors for windows backgrounds.
Change-Id: Ia65b1605b2b7bef7f01ff1feff2e7470479e626a
Diffstat (limited to 'vcl/headless/CustomWidgetDraw.cxx')
-rw-r--r-- | vcl/headless/CustomWidgetDraw.cxx | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/vcl/headless/CustomWidgetDraw.cxx b/vcl/headless/CustomWidgetDraw.cxx index 5cf2ccf83f55..5698f0ac34d8 100644 --- a/vcl/headless/CustomWidgetDraw.cxx +++ b/vcl/headless/CustomWidgetDraw.cxx @@ -309,6 +309,76 @@ bool CustomWidgetDraw::getNativeControlRegion( rNativeBoundingRegion, rNativeContentRegion); } +bool CustomWidgetDraw::updateSettings(AllSettings& rSettings) +{ + if (!s_pWidgetImplementation) + return false; + + WidgetDrawStyle aStyle; + + if (s_pWidgetImplementation->updateSettings(aStyle)) + { + StyleSettings aStyleSet = rSettings.GetStyleSettings(); + + aStyleSet.SetFaceColor(aStyle.maFaceColor); + aStyleSet.SetCheckedColor(Color(0xCC, 0xCC, 0xCC)); + aStyleSet.SetLightColor(aStyle.maLightColor); + aStyleSet.SetLightBorderColor(aStyle.maLightBorderColor); + aStyleSet.SetShadowColor(aStyle.maShadowColor); + aStyleSet.SetDarkShadowColor(aStyle.maDarkShadowColor); + aStyleSet.SetButtonTextColor(Color(COL_BLACK)); + aStyleSet.SetButtonRolloverTextColor(Color(COL_BLACK)); + aStyleSet.SetRadioCheckTextColor(Color(COL_BLACK)); + aStyleSet.SetGroupTextColor(Color(COL_BLACK)); + aStyleSet.SetLabelTextColor(Color(COL_BLACK)); + aStyleSet.SetWindowColor(aStyle.maWindowColor); + aStyleSet.SetWindowTextColor(aStyle.maWindowTextColor); + aStyleSet.SetDialogColor(aStyle.maDialogColor); + aStyleSet.SetDialogTextColor(aStyle.maDialogTextColor); + aStyleSet.SetWorkspaceColor(Color(0xDF, 0xDF, 0xDE)); + aStyleSet.SetMonoColor(Color(COL_BLACK)); + aStyleSet.SetFieldColor(Color(COL_WHITE)); + aStyleSet.SetFieldTextColor(Color(COL_BLACK)); + aStyleSet.SetFieldRolloverTextColor(Color(COL_BLACK)); + aStyleSet.SetActiveColor(Color(COL_BLUE)); + aStyleSet.SetActiveTextColor(Color(COL_WHITE)); + aStyleSet.SetActiveBorderColor(Color(COL_LIGHTGRAY)); + 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.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.SetMenuHighlightTextColor(Color(COL_WHITE)); + aStyleSet.SetHighlightColor(aStyle.maHighlightColor); + aStyleSet.SetHighlightTextColor(aStyle.maHighlightTextColor); + aStyleSet.SetActiveTabColor(aStyle.maActiveTabColor); + aStyleSet.SetInactiveTabColor(aStyle.maInactiveTabColor); + aStyleSet.SetTabTextColor(Color(COL_BLACK)); + aStyleSet.SetTabRolloverTextColor(Color(COL_BLACK)); + aStyleSet.SetTabHighlightTextColor(Color(COL_BLACK)); + aStyleSet.SetDisableColor(Color(COL_GRAY)); + aStyleSet.SetHelpColor(Color(0xFF, 0xFF, 0xE0)); + aStyleSet.SetHelpTextColor(Color(COL_BLACK)); + aStyleSet.SetLinkColor(Color(COL_BLUE)); + aStyleSet.SetVisitedLinkColor(Color(0x00, 0x00, 0xCC)); + aStyleSet.SetToolTextColor(Color(COL_BLACK)); + aStyleSet.SetFontColor(Color(COL_BLACK)); + + rSettings.SetStyleSettings(aStyleSet); + + return true; + } + + return false; +} + } // end vcl namespace /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |