summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-06-20 09:46:44 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-06-21 15:56:05 +0200
commit1cbf5cec4b189c71a11d0cbf62eed229d882620a (patch)
tree569be254b7d8a9586938608ee8018e06b6b2ec7d /include
parenta2f6c90c4fa983381ce8deef57e3a75ebf7b4f3a (diff)
sd theme: consider accent1 color when inserting shape with solid fill
Once a theme is defined for the master page of the current slide, PowerPoint inserts a shapes with their fill color & line color set based on that theme (so this color is master-page-specific), while Impress sets the fill & line color based on the default shape style. The Impress behavior has the benefit of doing the usual style-based formatting, but now a document-level style overwrites a (master-)slide-specific theme, which is inconsistent. Fix the problem by extending sd::FuConstruct::SetStyleSheet(): if we construct a shape with fill, then not only apply the style sheet, but also set the fill & line color based on the theme (if there is any). Note that this works both in case the shape is instantly created on click (LOK case) or when the user first draws a top-left -> bottom-right point pair to define the position / size of the shape. At the same time line colors don't support themes yet, so that color is just a plain value for now. Change-Id: Ic6ae8f91bd719bd80f2b56f12b001d29b0961e6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136138 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 486810603fb3f84847bb549004ed0394a2e22d0b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136156
Diffstat (limited to 'include')
-rw-r--r--include/svx/ColorSets.hxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index 07e24ee9302b..eace8ca2663c 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -69,6 +69,23 @@ public:
const ColorSet& getColorSet(std::u16string_view rName);
};
+/// Offsets into the color list of a theme.
+enum class ThemeColorType
+{
+ DK1 = 0,
+ LT1 = 1,
+ DK2 = 2,
+ LT2 = 3,
+ ACCENT1 = 4,
+ ACCENT2 = 5,
+ ACCENT3 = 6,
+ ACCENT4 = 7,
+ ACCENT5 = 8,
+ ACCENT6 = 9,
+ HLINK = 10,
+ FOLHLINK = 11,
+};
+
/// A named theme has a named color set.
class SVXCORE_DLLPUBLIC Theme
{
@@ -94,6 +111,8 @@ public:
void UpdateSdrPage(const SdrPage* pPage);
std::vector<Color> GetColors() const;
+
+ Color GetColor(ThemeColorType eType) const;
};
} // end of namespace svx