diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-09-14 08:43:22 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-04-30 18:06:20 +0200 |
commit | 2587e5423657d9e25accfbb7391fdc1acfa033fe (patch) | |
tree | bd571aa2e0a7ccc0d7dc5da525c0efa3d8e81cf2 /sfx2 | |
parent | f669f332733bf80b0a32022e1351957089958ce2 (diff) |
sd: sidebars are now visible in LOOL
Change-Id: I7ceae056e3d6ce1c991fe1194faa8bebfd6aae1e
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/Deck.cxx | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index 90bbe1ed8b0b..ba6ac1f36c95 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -27,9 +27,13 @@ #include <sfx2/sidebar/Panel.hxx> #include <sfx2/sidebar/Tools.hxx> #include <sfx2/sidebar/Theme.hxx> +#include <sfx2/viewsh.hxx> +#include <sfx2/lokhelper.hxx> +#include <comphelper/lok.hxx> #include <vcl/dockwin.hxx> #include <vcl/scrbar.hxx> +#include <vcl/IDialogRenderable.hxx> #include <tools/svborder.hxx> using namespace css; @@ -58,6 +62,20 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow, mpVerticalScrollBar->SetScrollHdl(LINK(this, Deck, HandleVerticalScrollBarChange)); + if (comphelper::LibreOfficeKit::isActive()) + { + SetLOKNotifier(SfxViewShell::Current()); + + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + { + std::vector<vcl::LOKPayloadItem> aItems; + aItems.emplace_back("type", "deck"); + aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); + aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); + pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems); + } + } + #ifdef DEBUG SetText(OUString("Deck")); mpScrollClipWindow->SetText(OUString("ScrollClipWindow")); @@ -165,6 +183,20 @@ bool Deck::EventNotify(NotifyEvent& rEvent) return Window::EventNotify(rEvent); } +void Deck::Resize() +{ + Window::Resize(); + + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + { + std::vector<vcl::LOKPayloadItem> aItems; + aItems.emplace_back("type", "deck"); + aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); + aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); + pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems); + } +} + bool Deck::ProcessWheelEvent(CommandEvent const * pCommandEvent) { if ( ! mpVerticalScrollBar) @@ -215,6 +247,15 @@ void Deck::RequestLayout() DeckLayouter::LayoutDeck(GetContentArea(), mnMinimalWidth, maPanels, *GetTitleBar(), *mpScrollClipWindow, *mpScrollContainer, *mpFiller, *mpVerticalScrollBar); + + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + { + std::vector<vcl::LOKPayloadItem> aItems; + aItems.emplace_back("type", "deck"); + aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); + aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); + pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems); + } } vcl::Window* Deck::GetPanelParentWindow() @@ -261,6 +302,14 @@ void Deck::ShowPanel(const Panel& rPanel) mpScrollContainer->GetPosPixel().X(), -nNewThumbPos)); + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + { + std::vector<vcl::LOKPayloadItem> aItems; + aItems.emplace_back("type", "deck"); + aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); + aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); + pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems); + } } } |