diff options
-rw-r--r-- | vcl/headless/CustomWidgetDraw.cxx | 70 | ||||
-rw-r--r-- | vcl/headless/svpframe.cxx | 17 | ||||
-rw-r--r-- | vcl/headless/svpgdi.cxx | 7 | ||||
-rw-r--r-- | vcl/inc/WidgetDrawInterface.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/WidgetThemeLibrary.hxx | 20 | ||||
-rw-r--r-- | vcl/inc/headless/CustomWidgetDraw.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/headless/svpgdi.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkgdi.hxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 8 |
9 files changed, 133 insertions, 2 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: */ diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 0e7b1bed139c..4958b9d9421d 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -426,6 +426,23 @@ void SvpSalFrame::UpdateSettings( AllSettings& rSettings ) aStdFont.SetFontSize(Size(0, 12)); aStyleSettings.SetMenuFont(aStdFont); + + SvpSalGraphics* pGraphics = m_aGraphics.back(); + bool bFreeGraphics = false; + if (!pGraphics) + { + pGraphics = dynamic_cast<SvpSalGraphics*>(AcquireGraphics()); + if (!pGraphics) + { + SAL_WARN("vcl.gtk3", "Could not get graphics - unable to update settings"); + return; + } + bFreeGraphics = true; + } + pGraphics->updateSettings(rSettings); + + if (bFreeGraphics) + ReleaseGraphics(pGraphics); } rSettings.SetStyleSettings( aStyleSettings ); diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 8941faef5c18..4af25f82478d 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -1949,6 +1949,13 @@ bool SvpSalGraphics::getNativeControlRegion(ControlType eType, ControlPart ePart return false; } +void SvpSalGraphics::updateSettings(AllSettings& rSettings) +{ + if (hasWidgetDraw()) + { + m_pWidgetDraw->updateSettings(rSettings); + } +} namespace { diff --git a/vcl/inc/WidgetDrawInterface.hxx b/vcl/inc/WidgetDrawInterface.hxx index ce6c5d43babe..4d1ecce7a3fe 100644 --- a/vcl/inc/WidgetDrawInterface.hxx +++ b/vcl/inc/WidgetDrawInterface.hxx @@ -12,6 +12,8 @@ #define INCLUDED_VCL_INC_WIDGETDRAWINTERFACE_HXX #include <vcl/dllapi.h> +#include <vcl/salnativewidgets.hxx> +#include <vcl/settings.hxx> namespace vcl { @@ -91,6 +93,8 @@ public: tools::Rectangle& rNativeBoundingRegion, tools::Rectangle& rNativeContentRegion) = 0; + + virtual bool updateSettings(AllSettings& rSettings) = 0; }; } diff --git a/vcl/inc/WidgetThemeLibrary.hxx b/vcl/inc/WidgetThemeLibrary.hxx index 7d38112130c8..59692de60012 100644 --- a/vcl/inc/WidgetThemeLibrary.hxx +++ b/vcl/inc/WidgetThemeLibrary.hxx @@ -14,9 +14,27 @@ #include <cairo.h> #include <vcl/dllapi.h> #include <vcl/salnativewidgets.hxx> +#include <tools/color.hxx> namespace vcl { +struct WidgetDrawStyle +{ + Color maFaceColor; + Color maLightColor; + Color maLightBorderColor; + Color maShadowColor; + Color maDarkShadowColor; + Color maHighlightColor; + Color maHighlightTextColor; + Color maActiveTabColor; + Color maInactiveTabColor; + Color maWindowColor; + Color maWindowTextColor; + Color maDialogColor; + Color maDialogTextColor; +}; + struct ControlDrawParameters { ControlDrawParameters(cairo_t* i_pCairo, ControlPart i_ePart, ControlState i_eState) @@ -76,6 +94,8 @@ public: virtual bool drawListNet(ControlDrawParameters const& rParameters, long nWidth, long nHeight); virtual bool drawListHeader(ControlDrawParameters const& rParameters, long nWidth, long nHeight); + + virtual bool updateSettings(WidgetDrawStyle& rSettings); }; extern "C" vcl::WidgetThemeLibrary* CreateWidgetThemeLibrary(); diff --git a/vcl/inc/headless/CustomWidgetDraw.hxx b/vcl/inc/headless/CustomWidgetDraw.hxx index ce749ac15b63..89082803abc3 100644 --- a/vcl/inc/headless/CustomWidgetDraw.hxx +++ b/vcl/inc/headless/CustomWidgetDraw.hxx @@ -16,6 +16,7 @@ #include <WidgetDrawInterface.hxx> #include <WidgetThemeLibrary.hxx> #include <headless/svpgdi.hxx> +#include <vcl/settings.hxx> #include <memory> namespace vcl @@ -45,6 +46,8 @@ public: const ImplControlValue& aValue, const OUString& aCaption, tools::Rectangle& rNativeBoundingRegion, tools::Rectangle& rNativeContentRegion) override; + + bool updateSettings(AllSettings& rSettings) override; }; } // end vcl namespace diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index b8d20a548a6f..21b1b0537c8e 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -280,6 +280,8 @@ public: tools::Rectangle& rNativeBoundingRegion, tools::Rectangle& rNativeContentRegion) override; + virtual void updateSettings(AllSettings& rSettings); + #if ENABLE_CAIRO_CANVAS virtual bool SupportsCairo() const override; virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const override; diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index e5eaef3747c1..839ee9eaac45 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -120,6 +120,9 @@ public: const OUString& rCaption, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion ) override; + + virtual void updateSettings(AllSettings& rSettings) override; + #if ENABLE_CAIRO_CANVAS virtual bool SupportsCairo() const override; @@ -130,7 +133,6 @@ public: void WidgetQueueDraw() const; - void updateSettings( AllSettings& rSettings ); static void refreshFontconfig( GtkSettings *pSettings ); static void signalSettingsNotify( GObject*, GParamSpec *pSpec, gpointer ); diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index 1a1e280b08a8..af2b5fd0e1a0 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -2876,8 +2876,14 @@ vcl::Font pango_to_vcl(const PangoFontDescription* font, const css::lang::Locale return aFont; } -void GtkSalGraphics::updateSettings( AllSettings& rSettings ) +void GtkSalGraphics::updateSettings(AllSettings& rSettings) { + if (m_pWidgetDraw) + { + m_pWidgetDraw->updateSettings(rSettings); + return; + } + GtkStyleContext* pStyle = gtk_widget_get_style_context( mpWindow ); GtkSettings* pSettings = gtk_widget_get_settings( mpWindow ); StyleSettings aStyleSet = rSettings.GetStyleSettings(); |