diff options
author | Kshitij Pathania <kshitijpathania@gmail.com> | 2018-05-14 14:21:56 +0530 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2018-07-06 12:42:56 +0200 |
commit | 22211ce6e9f5947f644ef82dd07e99ebc9f8d8a1 (patch) | |
tree | 09284a87bfcbc0d66ad0a0089b285698446a5c8e /vcl/source/control | |
parent | 4b848a51e9b8bc59aeb327d5c8349a29b26c31dc (diff) |
tdf#112034 , tdf#107266 label color on basis of persona and persona
flipping is fixed.
Labelcolor not gets updated immediately but when statechanged function
triggers via executemethod things workwell.(like it triggers on changing
mode of notebookbar)
Change-Id: I755fb4ff434d7971112d2f0beb44ca09f4a7e0f1
Reviewed-on: https://gerrit.libreoffice.org/54301
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit e02b3b095e472646c58eecd36d5a27b056dcb99e)
Reviewed-on: https://gerrit.libreoffice.org/56990
Tested-by: Jenkins
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/notebookbar.cxx | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 54931df82557..6c04bcaf7423 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -13,6 +13,7 @@ #include <vcl/taskpanelist.hxx> #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/implbase.hxx> +#include <vcl/vclevent.hxx> /** * split from the main class since it needs different ref-counting mana @@ -165,17 +166,70 @@ void NotebookBar::DataChanged(const DataChangedEvent& rDCEvt) Control::DataChanged(rDCEvt); } +void NotebookBar::StateChanged(const StateChangedType nStateChange ) +{ + UpdateBackground(); + Control::StateChanged(nStateChange); + Invalidate(); +} + void NotebookBar::UpdateBackground() { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); const BitmapEx aPersona = rStyleSettings.GetPersonaHeader(); - + Wallpaper aWallpaper(aPersona); + aWallpaper.SetStyle(WallpaperStyle::TopRight); if (!aPersona.IsEmpty()) - SetBackground(Wallpaper(aPersona)); + { + SetBackground(aWallpaper); + UpdatePersonaSettings(); + SetSettings( PersonaSettings ); + } else - SetBackground(rStyleSettings.GetDialogColor()); + { + SetBackground(rStyleSettings.GetDialogColor()); + UpdateDefaultSettings(); + SetSettings( DefaultSettings ); + } Invalidate(tools::Rectangle(Point(0,0), GetSizePixel())); } +void NotebookBar::UpdateDefaultSettings() +{ + AllSettings aAllSettings( GetSettings() ); + StyleSettings aStyleSet( aAllSettings.GetStyleSettings() ); + + ::Color aTextColor = aStyleSet.GetFieldTextColor(); + aStyleSet.SetDialogTextColor( aTextColor ); + aStyleSet.SetButtonTextColor( aTextColor ); + aStyleSet.SetRadioCheckTextColor( aTextColor ); + aStyleSet.SetGroupTextColor( aTextColor ); + aStyleSet.SetLabelTextColor( aTextColor ); + aStyleSet.SetWindowTextColor( aTextColor ); + aStyleSet.SetTabTextColor(aTextColor); + aStyleSet.SetToolTextColor(aTextColor); + + aAllSettings.SetStyleSettings(aStyleSet); + DefaultSettings = aAllSettings; +} + +void NotebookBar::UpdatePersonaSettings() +{ + AllSettings aAllSettings( GetSettings() ); + StyleSettings aStyleSet( aAllSettings.GetStyleSettings() ); + + ::Color aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or(COL_BLACK ); + aStyleSet.SetDialogTextColor( aTextColor ); + aStyleSet.SetButtonTextColor( aTextColor ); + aStyleSet.SetRadioCheckTextColor( aTextColor ); + aStyleSet.SetGroupTextColor( aTextColor ); + aStyleSet.SetLabelTextColor( aTextColor ); + aStyleSet.SetWindowTextColor( aTextColor ); + aStyleSet.SetTabTextColor(aTextColor); + aStyleSet.SetToolTextColor(aTextColor); + + aAllSettings.SetStyleSettings(aStyleSet); + PersonaSettings = aAllSettings; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |