include/sfx2/sidebar/TabBar.hxx | 13 ---------- sfx2/source/sidebar/TabBar.cxx | 52 ++++++++++++++++------------------------ translations | 2 - vcl/source/window/dockwin.cxx | 13 +++------- 4 files changed, 26 insertions(+), 54 deletions(-)
New commits: commit 265dad840da65377475e236ed7e031645d9e3138 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Jun 18 13:21:40 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Jun 27 16:42:33 2024 +0200 tdf#159835 sfx2 Connect SidebarController menu handlers earlier Instead of connecting the SidebarController handlers for handling activation of `TabBar` menu items every time in `TabBar::OnToolboxClicked` (which is the handler that gets called when clicking the menu button), do so once in the `TabBar` ctor. This also ensures that the handlers are connected before the menu shows for the first time, which is no longer true for the previous approach since commit f075fa01cb4f74185f13eb0a8d7f84cf1f47af49 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Tue Aug 22 10:26:32 2023 +0200 tdf#141101 tdf#101886 a11y: Restore previous focus on col/line popup close Now, clicking on the sidebar menu and selecting the "Undock" entry works to undock the first time, not only when opening the menu for the second time. Populating all menu entries before the menu gets opened for the first time still needs to be implemented separately. Change-Id: I7e5d5e511c2ce2c7304e8f88676970d76e6319df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169193 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> (cherry picked from commit 504e5501fce3f53d15b53f344c20e4404ff8f3db) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169248 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx index 6da0d507815f..6f922c34ea01 100644 --- a/include/sfx2/sidebar/TabBar.hxx +++ b/include/sfx2/sidebar/TabBar.hxx @@ -106,7 +106,6 @@ private: typedef ::std::vector<std::unique_ptr<Item>> ItemContainer; ItemContainer maItems; const ::std::function<void (const OUString& rsDeckId)> maDeckActivationFunctor; - PopupMenuSignalConnectFunction maPopupMenuSignalConnectFunction; void CreateTabItem(weld::Toolbar& rButton, const DeckDescriptor& rDeckDescriptor); css::uno::Reference<css::graphic::XGraphic> GetItemImage(const DeckDescriptor& rDeskDescriptor) const; diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx index a8afd1d4769d..35b3c80444a6 100644 --- a/sfx2/source/sidebar/TabBar.cxx +++ b/sfx2/source/sidebar/TabBar.cxx @@ -57,7 +57,6 @@ TabBar::TabBar(vcl::Window* pParentWindow, , mxContents(mxAuxBuilder->weld_widget("TabBarContents")) , mxMeasureBox(mxAuxBuilder->weld_widget("measure")) , maDeckActivationFunctor(std::move(aDeckActivationFunctor)) - , maPopupMenuSignalConnectFunction(std::move(aPopupMenuSignalConnectFunction)) , mrParentSidebarController(rParentSidebarController) { set_id("TabBar"); // for uitest @@ -72,6 +71,7 @@ TabBar::TabBar(vcl::Window* pParentWindow, mxMenuButton = mxAuxBuilder->weld_menu_button("menubutton"); mxMainMenu = mxAuxBuilder->weld_menu("mainmenu"); mxSubMenu = mxAuxBuilder->weld_menu("submenu"); + aPopupMenuSignalConnectFunction(*mxMainMenu, *mxSubMenu); gDefaultWidth = m_xContainer->get_preferred_size().Width(); @@ -415,8 +415,6 @@ IMPL_LINK_NOARG(TabBar, OnToolboxClicked, weld::Toggleable&, void) // No Restore or Customize options for LoKit. mxMainMenu->set_visible("customization", !comphelper::LibreOfficeKit::isActive()); - - maPopupMenuSignalConnectFunction(*mxMainMenu, *mxSubMenu); } void TabBar::EnableMenuButton(const bool bEnable) commit 6551e6160e60d05584f4fe5e6a11a4f1d639d945 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Jun 19 12:49:07 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Jun 27 16:42:08 2024 +0200 tdf#159835 Deduplicate a few lines in DockingWindow::SetFloatingMode They're the same for both branches. Change-Id: I73c3433fe3cfbb3eaa1b25cc2a76613d59d894a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169194 Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> Tested-by: Jenkins (cherry picked from commit d7aeaeafc32f78ca38942868f965bae0e6c376b1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169247 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 3f8853877b08..8d12b6658b0e 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -758,11 +758,6 @@ void DockingWindow::SetFloatingMode( bool bFloatMode ) pWin->SetMinOutputSizePixel( maMinOutSize ); pWin->SetMaxOutputSizePixel( mpImplData->maMaxOutSize ); - - ToggleFloatingMode(); - - if ( bVisible ) - Show(); } else { @@ -788,12 +783,12 @@ void DockingWindow::SetFloatingMode( bool bFloatMode ) mpWindowImpl->mpRealParent = pRealParent; mpFloatWin.disposeAndClear(); SetPosPixel( maDockPos ); + } - ToggleFloatingMode(); + ToggleFloatingMode(); - if ( bVisible ) - Show(); - } + if (bVisible) + Show(); } void DockingWindow::SetFloatStyle( WinBits nStyle ) commit a23edf01286db6131e9841887ff55bb6b333b28b Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Mon Jun 17 14:45:34 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Jun 27 16:41:45 2024 +0200 tdf#159835 sfx2: Simplify TabBar::OnToolboxClicked Now that the logic from `SidebarController::PopulatePopupMenus` has been moved here in Change-Id: I8236f2467239e6a2f485d468656e961478eeb09c Author: Michael Weghorn <m.wegh...@posteo.de> Date: Mon Jun 17 13:35:12 2024 +0200 tdf#159835 sfx2: Move logic to populate sidebar menus to TabBar as well, simplify `TabBar::OnToolboxClicked`: No longer use one loop to build a vector of entries and another to process these, but use a single loop for that instead. Drop the now unused `DeckMenuData` class. Change-Id: I884f3b70bb4d85b9a52421e9de6042cda80cfa0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169006 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins (cherry picked from commit ca364f8f16f0c64589d15e7bc44fe6eaebe8f5b2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169246 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx index 765dffc1435f..6da0d507815f 100644 --- a/include/sfx2/sidebar/TabBar.hxx +++ b/include/sfx2/sidebar/TabBar.hxx @@ -41,18 +41,6 @@ class TabBar final : public InterimItemWindow { friend class TabBarUIObject; public: - /** DeckMenuData has entries for display name, and a flag: - - isCurrentDeck for the deck selection data - - isEnabled for the show/hide menu - */ - class DeckMenuData - { - public: - OUString msDisplayName; - bool mbIsCurrentDeck; - bool mbIsActive; - bool mbIsEnabled; - }; typedef ::std::function<void ( weld::Menu& rMainMenu, weld::Menu& rSubMenu)> PopupMenuSignalConnectFunction; TabBar ( diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx index b764964012c0..a8afd1d4769d 100644 --- a/sfx2/source/sidebar/TabBar.cxx +++ b/sfx2/source/sidebar/TabBar.cxx @@ -344,23 +344,6 @@ IMPL_LINK_NOARG(TabBar, OnToolboxClicked, weld::Toggleable&, void) if (!mxMenuButton->get_active()) return; - std::vector<DeckMenuData> aMenuData; - - for (auto const& item : maItems) - { - std::shared_ptr<DeckDescriptor> xDeckDescriptor = mrParentSidebarController.GetResourceManager()->GetDeckDescriptor(item->msDeckId); - - if (!xDeckDescriptor) - continue; - - DeckMenuData aData; - aData.msDisplayName = xDeckDescriptor->msTitle; - aData.mbIsCurrentDeck = item->mxButton->get_item_active("toggle"); - aData.mbIsActive = !item->mbIsHidden; - aData.mbIsEnabled = item->mxButton->get_sensitive(); - aMenuData.push_back(aData); - } - for (int i = mxMainMenu->n_children() - 1; i >= 0; --i) { OUString sIdent = mxMainMenu->get_id(i); @@ -377,30 +360,39 @@ IMPL_LINK_NOARG(TabBar, OnToolboxClicked, weld::Toggleable&, void) // Add one entry for every tool panel element to individually make // them visible or hide them. sal_Int32 nIndex (0); - for (const auto& rItem : aMenuData) + for (auto const& rItem : maItems) { + std::shared_ptr<DeckDescriptor> xDeckDescriptor + = mrParentSidebarController.GetResourceManager()->GetDeckDescriptor(rItem->msDeckId); + + if (!xDeckDescriptor) + continue; + + const OUString sDisplayName = xDeckDescriptor->msTitle; OUString sIdent("select" + OUString::number(nIndex)); - mxMainMenu->insert(nIndex, sIdent, rItem.msDisplayName, - nullptr, nullptr, nullptr, TRISTATE_FALSE); - mxMainMenu->set_active(sIdent, rItem.mbIsCurrentDeck); - mxMainMenu->set_sensitive(sIdent, rItem.mbIsEnabled && rItem.mbIsActive); + const bool bCurrentDeck = rItem->mxButton->get_item_active(u"toggle"_ustr); + const bool bActive = !rItem->mbIsHidden; + const bool bEnabled = rItem->mxButton->get_sensitive(); + mxMainMenu->insert(nIndex, sIdent, sDisplayName, nullptr, nullptr, nullptr, TRISTATE_FALSE); + mxMainMenu->set_active(sIdent, bCurrentDeck); + mxMainMenu->set_sensitive(sIdent, bEnabled && bActive); if (!comphelper::LibreOfficeKit::isActive()) { - if (rItem.mbIsCurrentDeck) + if (bCurrentDeck) { // Don't allow the currently visible deck to be disabled. OUString sSubIdent("nocustomize" + OUString::number(nIndex)); - mxSubMenu->insert(nIndex, sSubIdent, rItem.msDisplayName, - nullptr, nullptr, nullptr, TRISTATE_FALSE); + mxSubMenu->insert(nIndex, sSubIdent, sDisplayName, nullptr, nullptr, nullptr, + TRISTATE_FALSE); mxSubMenu->set_active(sSubIdent, true); } else { OUString sSubIdent("customize" + OUString::number(nIndex)); - mxSubMenu->insert(nIndex, sSubIdent, rItem.msDisplayName, - nullptr, nullptr, nullptr, TRISTATE_TRUE); - mxSubMenu->set_active(sSubIdent, rItem.mbIsEnabled && rItem.mbIsActive); + mxSubMenu->insert(nIndex, sSubIdent, sDisplayName, nullptr, nullptr, nullptr, + TRISTATE_TRUE); + mxSubMenu->set_active(sSubIdent, bEnabled && bActive); } } commit 2dda2b3fe53455266df5b171d8f78c225d2a244f Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> AuthorDate: Thu Jun 27 16:41:40 2024 +0200 Commit: Gerrit Code Review <ger...@gerrit.libreoffice.org> CommitDate: Thu Jun 27 16:41:40 2024 +0200 Update git submodules * Update translations from branch 'libreoffice-24-2' to 8f2269089353b59fc42b4876a1736c4a54d936ea - update translations for 24.2.5 rc1 and force-fix errors using pocheck Change-Id: I8421753b547b21af95fdc22c1554d90fdd115bde diff --git a/translations b/translations index 8bde22939d49..8f2269089353 160000 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit 8bde22939d49fb6cebb30841b269b1625c07eb5a +Subproject commit 8f2269089353b59fc42b4876a1736c4a54d936ea