diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-12-22 10:40:58 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-12-22 12:21:40 +0100 |
commit | 60d7796624f1c56eb036d3e73d7f8a8216cce2a4 (patch) | |
tree | 893d2640f2dd63cf27ad530be7f695766dd64564 /svx | |
parent | 7bd62c00c58c6b1580df4bf5f44b083a50d9f673 (diff) |
sd theme: allow setting color effects in the sidebar
Which requires adding slot ids for the theme index / luminance
modulation / luminance offset. Also merge them on the sd/ side, similar
to what the character dialog does already.
Change-Id: I0ae1b4d315b2bd53c17522dbccab160e6208716b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127304
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r-- | svx/sdi/svx.sdi | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/PaletteManager.cxx | 14 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 11 |
3 files changed, 19 insertions, 8 deletions
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index f0314fe63360..84f959fc4e1b 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -1506,7 +1506,7 @@ SfxVoidItem ClearOutline SID_OUTLINE_DELETEALL SvxColorItem Color SID_ATTR_CHAR_COLOR -(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem Color SID_ATTR_CHAR_COLOR) +(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem Color SID_ATTR_CHAR_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff SID_ATTR_COLOR_LUM_OFF) [ AutoUpdate = TRUE, FastCall = FALSE, diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index c9ca2a3f70ab..cfc7eedeeeaf 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -32,6 +32,7 @@ #include <tbxcolorupdate.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> +#include <comphelper/sequence.hxx> #include <stack> #include <set> #include <officecfg/Office/Common.hxx> @@ -415,8 +416,15 @@ void PaletteManager::DispatchColorCommand(const OUString& aCommand, const svx::N INetURLObject aObj( aCommand ); - Sequence<PropertyValue> aArgs{ comphelper::makePropertyValue(aObj.GetURLPath(), - sal_Int32(rColor.m_aColor)) }; + std::vector<PropertyValue> aArgs{ + comphelper::makePropertyValue(aObj.GetURLPath(), sal_Int32(rColor.m_aColor)), + }; + if (rColor.m_nThemeIndex != -1) + { + aArgs.push_back(comphelper::makePropertyValue("ColorThemeIndex", rColor.m_nThemeIndex)); + aArgs.push_back(comphelper::makePropertyValue("ColorLumMod", rColor.m_nLumMod)); + aArgs.push_back(comphelper::makePropertyValue("ColorLumOff", rColor.m_nLumOff)); + } URL aTargetURL; aTargetURL.Complete = aCommand; @@ -426,7 +434,7 @@ void PaletteManager::DispatchColorCommand(const OUString& aCommand, const svx::N Reference<XDispatch> xDispatch = xDispatchProvider->queryDispatch(aTargetURL, OUString(), 0); if (xDispatch.is()) { - xDispatch->dispatch(aTargetURL, aArgs); + xDispatch->dispatch(aTargetURL, comphelper::containerToSequence(aArgs)); if (xFrame->getContainerWindow().is()) xFrame->getContainerWindow()->setFocus(); } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 5a09dfef037e..3f2c8f8b634a 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1966,15 +1966,18 @@ IMPL_LINK(ColorWindow, SelectHdl, ValueSet*, pColorSet, void) // triggers a callback that destroys ourself ColorSelectFunction aColorSelectFunction(maColorSelectFunction); OUString sCommand(maCommand); + // Same for querying IsTheme early. + bool bThemePaletteSelected = mxPaletteManager->IsThemePaletteSelected(); + sal_uInt16 nSelectedItemId = pColorSet->GetSelectedItemId(); maMenuButton.set_inactive(); auto aNamedThemedColor = svx::NamedThemedColor::FromNamedColor(aNamedColor); - if (mxPaletteManager->IsThemePaletteSelected()) + if (bThemePaletteSelected) { - PaletteManager::GetThemeIndexLumModOff( - pColorSet->GetSelectedItemId(), aNamedThemedColor.m_nThemeIndex, - aNamedThemedColor.m_nLumMod, aNamedThemedColor.m_nLumOff); + PaletteManager::GetThemeIndexLumModOff(nSelectedItemId, aNamedThemedColor.m_nThemeIndex, + aNamedThemedColor.m_nLumMod, + aNamedThemedColor.m_nLumOff); } aColorSelectFunction(sCommand, aNamedThemedColor); } |