sc/source/ui/view/tabvwsh3.cxx | 25 +++++++++++++++++++++++++ sc/uiconfig/scalc/ui/notebookbar_online.ui | 23 +++++++++++++++++++++++ solenv/sanitizers/ui/modules/scalc.suppr | 1 + 3 files changed, 49 insertions(+)
New commits: commit 2e9980605574f1be8e773657cf4c8e18cadc6a64 Author: Banobe Pascal <[email protected]> AuthorDate: Wed Feb 4 02:26:04 2026 +0300 Commit: Szymon Kłos <[email protected]> CommitDate: Thu Feb 26 16:27:38 2026 +0100 sc: Add a Notebookbar widget for theme colors in Calc Signed-off-by: Banobe Pascal <[email protected]> Change-Id: I8addd1046d232bec1df42ccdc0ac823a25eb238f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199548 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 58c7c1472a53..5dd7a637882f 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -1604,6 +1604,31 @@ void ScTabViewShell::Execute( 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, this](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 with auto-rename if needed + svx::ColorSets::get().insert(aColorSet); + GetViewFrame().GetBindings().Invalidate(SID_ADD_THEME); + } + }); + + rReq.Ignore(); + } + break; + case SID_THEME_DIALOG: { MakeDrawLayer(); diff --git a/sc/uiconfig/scalc/ui/notebookbar_online.ui b/sc/uiconfig/scalc/ui/notebookbar_online.ui index 2a538a2fead7..46c26d27a336 100644 --- a/sc/uiconfig/scalc/ui/notebookbar_online.ui +++ b/sc/uiconfig/scalc/ui/notebookbar_online.ui @@ -147,6 +147,29 @@ <property name="position">3</property> </packing> </child> + <child> + <object class="sfxlo-NotebookbarToolBox" id="theme_colors_pane"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_start">5</property> + <child> + <object class="GtkToolButton" id="Theme-ThemeColorsPane"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="action_name">.uno:ThemeSelectorPanel</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> </object> <packing> <property name="left_attach">0</property> diff --git a/solenv/sanitizers/ui/modules/scalc.suppr b/solenv/sanitizers/ui/modules/scalc.suppr index bdc95e795200..840f926378ed 100644 --- a/solenv/sanitizers/ui/modules/scalc.suppr +++ b/solenv/sanitizers/ui/modules/scalc.suppr @@ -68,6 +68,7 @@ sc/uiconfig/scalc/ui/notebookbar_groups.ui://GtkLabel[@id='formatgrouplabel'] or sc/uiconfig/scalc/ui/notebookbar_groups.ui://GtkLabel[@id='tablegrouplabel'] orphan-label sc/uiconfig/scalc/ui/notebookbar_groups.ui://GtkLabel[@id='insertgrouplabel'] orphan-label sc/uiconfig/scalc/ui/notebookbar_groups.ui://GtkLabel[@id='imagegrouplabel'] orphan-label +sc/uiconfig/scalc/ui/notebookbar_online.ui://GtkToolButton[@id='Theme-ThemeColorsPane'] button-no-label sc/uiconfig/scalc/ui/managenamesdialog.ui://GtkLabel[@id='info'] orphan-label sc/uiconfig/scalc/ui/managenamesdialog.ui://GtkLabel[@id='label2'] orphan-label sc/uiconfig/scalc/ui/mergecellsdialog.ui://GtkLabel[@id='label'] orphan-label
