diff options
-rw-r--r-- | include/sfx2/sidebar/TabBar.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/sidebar/TabBar.cxx | 5 |
3 files changed, 17 insertions, 2 deletions
diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx index a6fcf6a33db4..1796094c3660 100644 --- a/include/sfx2/sidebar/TabBar.hxx +++ b/include/sfx2/sidebar/TabBar.hxx @@ -83,6 +83,9 @@ public: void UpdateFocusManager (FocusManager& rFocusManager); + /// Enables/Disables the menu button. Used by LoKit. + void EnableMenuButton(const bool bEnable); + private: css::uno::Reference<css::frame::XFrame> mxFrame; VclPtr<CheckBox> mpMenuButton; diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 2e89c5137aae..b560e01c2a14 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -974,7 +974,8 @@ SidebarController::CreatePopupMenu(const ::std::vector<TabBar::DeckMenuData>& rM FloatingWindow* pMenuWindow = dynamic_cast<FloatingWindow*>(pMenu->GetWindow()); if (pMenuWindow != nullptr) { - pMenuWindow->SetPopupModeFlags(pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose); + pMenuWindow->SetPopupModeFlags(pMenuWindow->GetPopupModeFlags() + | FloatWinPopupFlags::NoMouseUpClose); } // Create sub menu for customization (hiding of deck tabs), only on desktop. @@ -1008,6 +1009,7 @@ SidebarController::CreatePopupMenu(const ::std::vector<TabBar::DeckMenuData>& rM pCustomizationMenu->CheckItem(nSubMenuIndex, rItem.mbIsEnabled && rItem.mbIsActive); } } + ++nIndex; } @@ -1179,6 +1181,9 @@ void SidebarController::UpdateDeckOpenState() aNewSize.setWidth(mnSavedSidebarWidth); mpParentWindow->GetFloatingWindow()->SetPosSizePixel(aNewPos, aNewSize); + // Sidebar wide enought to render the menu; enable it. + if (comphelper::LibreOfficeKit::isActive()) + mpTabBar->EnableMenuButton(true); } } else @@ -1196,8 +1201,10 @@ void SidebarController::UpdateDeckOpenState() aNewSize.setWidth(nTabBarDefaultWidth); mpParentWindow->GetFloatingWindow()->SetPosSizePixel(aNewPos, aNewSize); + // Sidebar too narrow to render the menu; disable it. + if (comphelper::LibreOfficeKit::isActive()) + mpTabBar->EnableMenuButton(false); } - if (mnWidthOnSplitterButtonDown > nTabBarDefaultWidth) mnSavedSidebarWidth = mnWidthOnSplitterButtonDown; mpParentWindow->SetStyle(mpParentWindow->GetStyle() & ~WB_SIZEABLE); diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx index 8ca65efbadd7..9825a92eac10 100644 --- a/sfx2/source/sidebar/TabBar.cxx +++ b/sfx2/source/sidebar/TabBar.cxx @@ -411,6 +411,11 @@ IMPL_LINK_NOARG(TabBar, OnToolboxClicked, Button*, void) mpMenuButton->Check(false); } +void TabBar::EnableMenuButton(const bool bEnable) +{ + mpMenuButton->Enable(bEnable); +} + } } // end of namespace sfx2::sidebar /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |