diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-12 14:25:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-18 15:17:59 +0100 |
commit | f9cf66b39ea00afc66ae79ca46cd9071f3598cb8 (patch) | |
tree | 4b488119c57d9e1ea3250e55af2df8769dc014f0 /sfx2/inc | |
parent | 3b544a311d6ab22e1e04c45a841d5f24d5c6b325 (diff) |
weld the sidebar deck
Change-Id: Idc6710df7e59bcb5f61fca783e0cc0666cb13a1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112404
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/inc')
-rw-r--r-- | sfx2/inc/sidebar/DeckLayouter.hxx | 13 | ||||
-rw-r--r-- | sfx2/inc/sidebar/DeckTitleBar.hxx | 6 | ||||
-rw-r--r-- | sfx2/inc/sidebar/PanelTitleBar.hxx | 11 | ||||
-rw-r--r-- | sfx2/inc/sidebar/TitleBar.hxx | 32 | ||||
-rw-r--r-- | sfx2/inc/sidebar/UnoPanel.hxx | 2 |
5 files changed, 25 insertions, 39 deletions
diff --git a/sfx2/inc/sidebar/DeckLayouter.hxx b/sfx2/inc/sidebar/DeckLayouter.hxx index b84496cd6646..c814abd98921 100644 --- a/sfx2/inc/sidebar/DeckLayouter.hxx +++ b/sfx2/inc/sidebar/DeckLayouter.hxx @@ -20,27 +20,26 @@ #include <sfx2/sidebar/Panel.hxx> -class ScrollBar; -namespace vcl { class Window; } namespace tools { class Rectangle; } namespace sfx2::sidebar { +class DeckTitleBar; +class SidebarDockingWindow; + /** Helper for layouting the direct and indirect children of a deck like title bars, panels, and scroll bars. */ namespace DeckLayouter { void LayoutDeck ( + SidebarDockingWindow* pDockingWindow, const tools::Rectangle& rContentArea, sal_Int32& rMinimalWidth, sal_Int32& rMinimalHeight, SharedPanelContainer& rPanels, - vcl::Window& pDeckTitleBar, - vcl::Window& pScrollClipWindow, - vcl::Window& pScrollContainer, - vcl::Window& pFiller, - ScrollBar& pVerticalScrollBar); + DeckTitleBar& pDeckTitleBar, + weld::ScrolledWindow& pVerticalScrollBar); } } // end of namespace sfx2::sidebar diff --git a/sfx2/inc/sidebar/DeckTitleBar.hxx b/sfx2/inc/sidebar/DeckTitleBar.hxx index cad5dac3d8f4..1566b89675f9 100644 --- a/sfx2/inc/sidebar/DeckTitleBar.hxx +++ b/sfx2/inc/sidebar/DeckTitleBar.hxx @@ -23,14 +23,14 @@ namespace sfx2::sidebar { +class Deck; class GripWidget; class DeckTitleBar final : public TitleBar { public: - DeckTitleBar(const OUString& rsTitle, vcl::Window* pParentWindow, + DeckTitleBar(const OUString& rsTitle, weld::Builder& rBuilder, const std::function<void()>& rCloserAction); - virtual void dispose() override; virtual ~DeckTitleBar() override; virtual void SetTitle(const OUString& rsTitle) override; @@ -39,7 +39,7 @@ public: void SetCloserVisible(const bool bIsCloserVisible); tools::Rectangle GetDragArea(); - virtual void DataChanged(const DataChangedEvent& rEvent) override; + virtual void DataChanged() override; private: virtual void HandleToolBoxItemClick() override; diff --git a/sfx2/inc/sidebar/PanelTitleBar.hxx b/sfx2/inc/sidebar/PanelTitleBar.hxx index 64a77833dddd..8a90f8a79101 100644 --- a/sfx2/inc/sidebar/PanelTitleBar.hxx +++ b/sfx2/inc/sidebar/PanelTitleBar.hxx @@ -28,8 +28,7 @@ namespace sfx2::sidebar { class Panel; -class PanelTitleBar final - : public TitleBarBase +class PanelTitleBar final : public TitleBar { public: PanelTitleBar(const OUString& rsTitle, weld::Builder& rBuilder, Panel* pPanel); @@ -37,17 +36,12 @@ public: virtual void SetTitle (const OUString& rsTitle) override; virtual OUString GetTitle() const override; - virtual bool GetVisible() const override; void SetMoreOptionsCommand(const OUString& rsCommandName, const css::uno::Reference<css::frame::XFrame>& rxFrame, const css::uno::Reference<css::frame::XController>& rxController); void UpdateExpandedState(); - void Show(bool bShow) - { - mxTitlebar->set_visible(bShow); - } weld::Expander& GetExpander() { @@ -59,12 +53,11 @@ private: DECL_LINK(ExpandHdl, weld::Expander&, void); - std::unique_ptr<weld::Container> mxTitlebar; std::unique_ptr<weld::Expander> mxExpander; css::uno::Reference<css::frame::XToolbarController> mxController; - VclPtr<Panel> mpPanel; + Panel* mpPanel; OString msIdent; OUString msMoreOptionsCommand; }; diff --git a/sfx2/inc/sidebar/TitleBar.hxx b/sfx2/inc/sidebar/TitleBar.hxx index 425e859cc690..4672342ffec5 100644 --- a/sfx2/inc/sidebar/TitleBar.hxx +++ b/sfx2/inc/sidebar/TitleBar.hxx @@ -21,20 +21,24 @@ #include <sidebar/SidebarToolBox.hxx> #include <sfx2/sidebar/Theme.hxx> #include <sfx2/weldutils.hxx> -#include <vcl/InterimItemWindow.hxx> namespace sfx2::sidebar { -class TitleBarBase +class TitleBar { public: - TitleBarBase(weld::Builder& rBuilder, Theme::ThemeItem eThemeItem); - void reset(); - virtual ~TitleBarBase(); + TitleBar(weld::Builder& rBuilder, Theme::ThemeItem eThemeItem); + virtual ~TitleBar(); virtual void SetTitle (const OUString& rsTitle) = 0; virtual OUString GetTitle() const = 0; - virtual bool GetVisible() const = 0; + + virtual void DataChanged(); + + void Show(bool bShow); + bool GetVisible() const; + + Size get_preferred_size() const; void SetIcon(const css::uno::Reference<css::graphic::XGraphic>& rIcon); @@ -49,6 +53,7 @@ public: protected: weld::Builder& mrBuilder; + std::unique_ptr<weld::Container> mxTitlebar; std::unique_ptr<weld::Image> mxAddonImage; std::unique_ptr<weld::Toolbar> mxToolBox; std::unique_ptr<ToolbarUnoDispatcher> mxToolBoxController; @@ -57,20 +62,9 @@ protected: virtual void HandleToolBoxItemClick() = 0; DECL_LINK(SelectionHandler, const OString&, void); -}; - -class TitleBar : public InterimItemWindow - , public TitleBarBase -{ -public: - TitleBar(vcl::Window* pParentWindow, - const OUString& rUIXMLDescription, const OString& rID, - Theme::ThemeItem eThemeItem); - virtual void dispose() override; - virtual bool GetVisible() const override { return IsVisible(); } - virtual ~TitleBar() override; - virtual void DataChanged (const DataChangedEvent& rEvent) override; +private: + void SetBackground(); }; } // end of namespace sfx2::sidebar diff --git a/sfx2/inc/sidebar/UnoPanel.hxx b/sfx2/inc/sidebar/UnoPanel.hxx index 50d9aba2c0fa..2b1197eb95f7 100644 --- a/sfx2/inc/sidebar/UnoPanel.hxx +++ b/sfx2/inc/sidebar/UnoPanel.hxx @@ -60,7 +60,7 @@ private: const OUString mDeckId; VclPtr<sfx2::sidebar::Deck> mpDeck; - VclPtr<sfx2::sidebar::Panel> mpPanel; + std::weak_ptr<sfx2::sidebar::Panel> mxPanel; sal_Int32 GetMaxOrderIndex(sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer aPanels); sal_Int32 GetMinOrderIndex(sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer aPanels); |