summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-09-14 08:43:22 -0400
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-25 09:29:47 +0200
commit6cb3b009fc4e73cc0ea07d166c274f05306b0e75 (patch)
treec169f0768c7f04fc1f558c78125a84a978dd102e /sfx2
parentae2720ab206c2ff4a677e7fad147a3037f07a9be (diff)
sd: sidebars are now visible in LOOL
Change-Id: I7ceae056e3d6ce1c991fe1194faa8bebfd6aae1e Reviewed-on: https://gerrit.libreoffice.org/73500 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/Deck.cxx53
1 files changed, 53 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index e0405c9c279c..f26a643a083a 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -27,11 +27,15 @@
#include <sfx2/sidebar/Panel.hxx>
#include <sfx2/sidebar/Tools.hxx>
#include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/viewsh.hxx>
+#include <sfx2/lokhelper.hxx>
#include <vcl/event.hxx>
+#include <comphelper/lok.hxx>
#include <vcl/dockwin.hxx>
#include <vcl/scrbar.hxx>
#include <vcl/commandevent.hxx>
+#include <vcl/IDialogRenderable.hxx>
#include <tools/svborder.hxx>
#include <sal/log.hxx>
@@ -61,6 +65,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"));
@@ -76,6 +94,9 @@ Deck::~Deck()
void Deck::dispose()
{
+ if (comphelper::LibreOfficeKit::isActive())
+ ReleaseLOKNotifier();
+
SharedPanelContainer aPanels;
aPanels.swap(maPanels);
@@ -168,6 +189,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)
@@ -218,6 +253,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()
@@ -264,6 +308,15 @@ void Deck::ShowPanel(const Panel& rPanel)
Point(
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);
+ }
}
static const OUString GetWindowClassification(const vcl::Window* pWindow)