summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/tbcontrl.cxx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2023-07-02 17:31:38 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2023-07-04 20:26:42 +0200
commit8ffb8e164d9d350a1b9887d0a75e0a82892008ee (patch)
tree1c96a2bc6d226d4a0b48db1f66da24ca1adaf278 /svx/source/tbxctrls/tbcontrl.cxx
parent203476b6676505acafd1c41561800afd9316a0f6 (diff)
tdf#154270 Sync toolbar button recent colors
As the last used color is stored per button instance, these will go out of sync with several buttons being visible (e.g. a toolbar and a sidebar, or a toolbar overflow popup), and will reset whenever the toolbar resets (e.g. change in selection, switch from print preview, or customization). Fix that by storing the last colors per-document, and notifying other buttons on changes. Keep the last color also stored per-button for now, as a fallback for reportdesign (which isn't sfx2 based). Change-Id: I866f1de5c8ff6f56c47dc4b6b5acf52957d4e6c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153943 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'svx/source/tbxctrls/tbcontrl.cxx')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx15
1 files changed, 2 insertions, 13 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 8833ed524d01..052d8558386b 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2226,7 +2226,7 @@ IMPL_LINK(ColorWindow, SelectHdl, ValueSet*, pColorSet, void)
mxPaletteManager->ReloadRecentColorSet(*mxRecentColorSet);
}
- maSelectedLink.Call(aNamedColor);
+ mxPaletteManager->SetSplitButtonColor(aNamedColor);
// deliberate take a copy here in case maMenuButton.set_inactive
// triggers a callback that destroys ourself
@@ -2272,7 +2272,7 @@ IMPL_LINK(ColorWindow, AutoColorClickHdl, weld::Button&, rButton, void)
mxRecentColorSet->SetNoSelection();
mpDefaultButton = &rButton;
- maSelectedLink.Call(aNamedColor);
+ mxPaletteManager->SetSplitButtonColor(aNamedColor);
// deliberate take a copy here in case maMenuButton.set_inactive
// triggers a callback that destroys ourself
@@ -3636,9 +3636,6 @@ std::unique_ptr<WeldToolbarPopup> SvxColorToolBoxControl::weldPopupWindow()
[this] { return GetParentFrame(); },
m_aColorSelectFunction);
- if ( m_bSplitButton )
- xPopover->SetSelectedHdl( LINK( this, SvxColorToolBoxControl, SelectedHdl ) );
-
return xPopover;
}
@@ -3661,9 +3658,6 @@ VclPtr<vcl::Window> SvxColorToolBoxControl::createVclPopupWindow( vcl::Window* p
[this] { return GetParentFrame(); },
m_aColorSelectFunction);
- if ( m_bSplitButton )
- xPopover->SetSelectedHdl( LINK( this, SvxColorToolBoxControl, SelectedHdl ) );
-
mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(getFrameInterface(), pParent,
std::move(xPopover), true);
@@ -3676,11 +3670,6 @@ VclPtr<vcl::Window> SvxColorToolBoxControl::createVclPopupWindow( vcl::Window* p
return mxInterimPopover;
}
-IMPL_LINK(SvxColorToolBoxControl, SelectedHdl, const NamedColor&, rColor, void)
-{
- m_xBtnUpdater->Update(rColor);
-}
-
void SvxColorToolBoxControl::statusChanged( const css::frame::FeatureStateEvent& rEvent )
{
ToolBox* pToolBox = nullptr;