summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-09-20 00:06:52 +0200
committerJan Holesovsky <kendy@collabora.com>2018-11-09 18:42:31 +0100
commitb838e7e800d7c05bbe168a0eb8efa625d8b539cf (patch)
treef8fbce402bf47023abf95af43e1da367260a01d4 /vcl/inc
parent7d879658886cd73b38b12e5e6081bac7eda145d1 (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/inc')
-rw-r--r--vcl/inc/WidgetDrawInterface.hxx4
-rw-r--r--vcl/inc/WidgetThemeLibrary.hxx20
-rw-r--r--vcl/inc/headless/CustomWidgetDraw.hxx3
-rw-r--r--vcl/inc/headless/svpgdi.hxx2
-rw-r--r--vcl/inc/unx/gtk/gtkgdi.hxx4
5 files changed, 32 insertions, 1 deletions
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 );