Add UNO command for 'Add Theme'

Change-Id: I0a2b5dcab5a889717082825e124e181527dadc19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198130
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 90910c7db4ba787595ae17f26710e1c6206f3ce4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198515
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Samuel Mehrbrodt
2026-02-02 10:27:15 +01:00
parent 0c896483f5
commit 984e8adab1
6 changed files with 59 additions and 2 deletions
+1
View File
@@ -485,6 +485,7 @@ class SvxZoomItem;
#define SID_ACCESSIBILITY_CHECK_ONLINE (SID_SFX_START + 814)
#define SID_THEME_DIALOG (SID_SFX_START + 815)
#define SID_REDACT_IMAGE (SID_SFX_START + 816)
#define SID_ADD_THEME (SID_SFX_START + 817)
// default-ids for configuration
#define SID_CONFIG TypedWhichId<SfxStringItem>(SID_SFX_START + 904)
+1 -2
View File
@@ -21,8 +21,7 @@ class ColorListBox;
namespace svx
{
class UNLESS_MERGELIBS(SVX_DLLPUBLIC) ThemeColorEditDialog final
: public weld::GenericDialogController
class SVX_DLLPUBLIC ThemeColorEditDialog final : public weld::GenericDialogController
{
private:
model::ColorSet maColorSet;
@@ -8084,6 +8084,14 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8
<value>1</value>
</prop>
</node>
<node oor:name=".uno:AddTheme" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Add Theme...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
<node oor:name=".uno:SidebarDeck.PropertyDeck" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Open the Properties Deck</value>
+5
View File
@@ -3043,6 +3043,11 @@ interface DrawView
ExecMethod = FuTemporary;
StateMethod = GetAttrState;
]
SID_ADD_THEME
[
ExecMethod = FuTemporary;
StateMethod = GetAttrState;
]
SID_ALIGN_PAGE
[
ExecMethod = FuTemporary ;
+27
View File
@@ -197,6 +197,8 @@
#include <theme/ThemeColorChanger.hxx>
#include <svx/dialog/ThemeDialog.hxx>
#include <svx/dialog/ThemeColorEditDialog.hxx>
#include <svx/ColorSets.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <ViewShellBase.hxx>
@@ -4279,6 +4281,31 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
break;
case SID_ADD_THEME:
{
// Create empty color set as starting point for new theme
auto pCurrentColorSet = std::make_shared<model::ColorSet>(OUString());
// Open ThemeColorEditDialog to create/edit the new color set
auto pSubDialog = std::make_shared<svx::ThemeColorEditDialog>(GetFrameWeld(), *pCurrentColorSet);
weld::DialogController::runAsync(pSubDialog, [pSubDialog](sal_uInt32 nResult) {
if (nResult != RET_OK)
return;
auto aColorSet = pSubDialog->getColorSet();
if (!aColorSet.getName().isEmpty())
{
// Add the new color set to the global collection
svx::ColorSets::get().insert(aColorSet);
}
});
Cancel();
rReq.Ignore();
}
break;
case SID_ATTR_GLOW_COLOR:
case SID_ATTR_GLOW_RADIUS:
case SID_ATTR_GLOW_TRANSPARENCY:
+17
View File
@@ -13310,6 +13310,23 @@ SfxVoidItem ThemeDialog SID_THEME_DIALOG
GroupId = SfxGroupId::Format;
]
SfxVoidItem AddTheme SID_ADD_THEME
()
[
AutoUpdate = FALSE,
FastCall = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
AccelConfig = TRUE,
MenuConfig = TRUE,
ToolBoxConfig = TRUE,
GroupId = SfxGroupId::Format;
]
SfxBoolItem AccessibilityCheckOnline SID_ACCESSIBILITY_CHECK_ONLINE
(SfxBoolItem Enable FN_PARAM_1)
[