diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-01-05 23:58:50 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-01-14 07:52:37 +0000 |
commit | 8bc22ed6899bcbafc3020f0af6c939019506a5fd (patch) | |
tree | 9e959570044676ad941fec5472c4815e3181fdef /include | |
parent | 08cae41f6f8cb8f9f592c0735d1285c0575d6e49 (diff) |
sw: rework ThemePanel, theme color ValueSet drawing as custom draw
Rework the ThemePanel to only work with theme colors, as fonts
are uing an old mock implemntation of themes. To do this properly
it is needed to remove the implementation for now.
The theme colors entries were rendered as a bitmap and then shown
in the ValueSet. This has the problem that it doesn't look sharp
on a HiDPI screen, so replace that with a ThemeColorValueSet, which
uses custom draw to render the theme color entries directly.
The ThemeColorValueSet was added to th svx component as it will be
used in other components as well.
Change-Id: I1a727ef4cf4be4e215db57ac33f571f43aaddc15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145087
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/dialog/ThemeColorValueSet.hxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/svx/dialog/ThemeColorValueSet.hxx b/include/svx/dialog/ThemeColorValueSet.hxx new file mode 100644 index 000000000000..4b70ed0f56db --- /dev/null +++ b/include/svx/dialog/ThemeColorValueSet.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include <svx/svxdllapi.h> +#include <sal/config.h> +#include <svtools/valueset.hxx> +#include <svx/ColorSets.hxx> + +namespace svx +{ +class SVX_DLLPUBLIC ThemeColorValueSet final : public ValueSet +{ + std::vector<std::reference_wrapper<const svx::ColorSet>> maColorSets; + +public: + ThemeColorValueSet() + : ValueSet(nullptr) + { + } + + void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + void UserDraw(const UserDrawEvent& rUserDrawEvent) override; + void StyleUpdated() override; + + void insert(svx::ColorSet const& rColorSet); +}; + +} // end svx namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |