summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2022-07-29 00:36:18 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2022-08-30 13:08:03 +0200
commit4fb8c0d14cb2468f7336438004f699b9eb7e7e4a (patch)
treeaa3b9c92c1c86e9afae76246ef33ab8268f145de /sfx2
parent2958e4c92f15652c424765f02c87518011eb2406 (diff)
tdf#149741 tdf#149956 Make flipping work also in the sidebar
- Reset the icon each time, as there seems to be no easy way to retrieve the existing icon from a gtk widget in order to mirror it, like we used to do for vcl. Similar approach is currently taken in ToolboxButtonColorUpdaterBase::Update. - Store the flipping state also in GtkInstanceToolbar, similar to vcl's ToolBox. This seems to be the easiest way to make flipping not break on icon theme change, covering all 4 cases (ToolBarManager, SidebarToolBox, ToolbarUnoDispatcher, GenericToolbarController), w/o too involved changes in each. This might benefit from some refactoring later on, but should be good enough for now. - One unsolved problem is the appearance of flipped icons with svg themes, as the regular variant is handed to gtk directly, whereas the flipped one is loaded by us, resulting with a different (blurry) look. Change-Id: I48c16827b46fb75fd798a041851af6e2648ae8fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139021 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/toolbox/weldutils.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sfx2/source/toolbox/weldutils.cxx b/sfx2/source/toolbox/weldutils.cxx
index 5c1f1c58fa4f..25b173de633f 100644
--- a/sfx2/source/toolbox/weldutils.cxx
+++ b/sfx2/source/toolbox/weldutils.cxx
@@ -158,9 +158,10 @@ IMPL_LINK_NOARG(ToolbarUnoDispatcher, ChangedIconSizeHandler, LinkParamNone*, vo
for (int i = 0, nItems = m_pToolbar->get_n_items(); i < nItems; ++i)
{
- OUString sCommand = OUString::fromUtf8(m_pToolbar->get_item_ident(i));
- auto xImage(vcl::CommandInfoProvider::GetXGraphicForCommand(sCommand, m_xFrame, eSize));
- m_pToolbar->set_item_image(i, xImage);
+ OString sIdent(m_pToolbar->get_item_ident(i));
+ auto xImage(vcl::CommandInfoProvider::GetXGraphicForCommand(OUString::fromUtf8(sIdent),
+ m_xFrame, eSize));
+ m_pToolbar->set_item_image(sIdent, xImage);
}
for (auto const& it : maControllers)