diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-11-24 13:11:18 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-02-01 10:27:52 +0100 |
commit | 490fcebb0dc160e56058a925e32f31ec7bcb6e4d (patch) | |
tree | b10e623d48b648bc89cc02c4c3dfe511ce43fa1d /vcl | |
parent | 1f847d09246a5bd437248234ddc32f1c491acdc7 (diff) |
jsdialog: sidebar: enable animation panel effects
- enable subcontrol .ui for jsdialogs in annimation panel
- optimize to not recreate widget on every sidebar refresh
- don't sent close message for whole sidebar when called from
subcontrol
This fixes widgets in annimation panel like: Direction listbox,
or other replacements for selecting color, font etc. for font effect
Change-Id: I5683ca9cefe384ed0d2a34d46936ddf4a9b45bce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125757
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129170
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/jsdialog/jsdialogbuilder.hxx | 9 | ||||
-rw-r--r-- | vcl/jsdialog/enabled.cxx | 3 | ||||
-rw-r--r-- | vcl/jsdialog/jsdialogbuilder.cxx | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 59462a92468c..e4f3227fd7ba 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -138,10 +138,17 @@ class JSDialogSender { std::unique_ptr<JSDialogNotifyIdle> mpIdleNotify; +protected: + bool m_bCanClose; // specifies if can send a close message + public: - JSDialogSender() = default; + JSDialogSender() + : m_bCanClose(true) + { + } JSDialogSender(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow, std::string sTypeOfJSON) + : m_bCanClose(true) { initializeSender(aNotifierWindow, aContentWindow, sTypeOfJSON); } diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index d39833c71d84..6de05a65c9eb 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -121,7 +121,8 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile) || rUIFile == u"svx/ui/inspectortextpanel.ui" || rUIFile == u"modules/swriter/ui/sidebarstylepresets.ui" || rUIFile == u"modules/swriter/ui/sidebartheme.ui" - || rUIFile == u"modules/swriter/ui/sidebartableedit.ui") + || rUIFile == u"modules/swriter/ui/sidebartableedit.ui" + || rUIFile == u"modules/simpress/ui/customanimationfragment.ui") return true; return false; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 08fd92f6a57d..f527867c81b4 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -324,7 +324,7 @@ void JSDialogSender::sendFullUpdate(bool bForce) void JSDialogSender::sendClose() { - if (!mpIdleNotify) + if (!mpIdleNotify || !m_bCanClose) return; mpIdleNotify->clearQueue(); @@ -539,6 +539,10 @@ JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIR } else { + // embedded fragments cannot send close message for whole sidebar + if (rUIFile == "modules/simpress/ui/customanimationfragment.ui") + m_bCanClose = false; + // builder for PanelLayout, get SidebarDockingWindow as m_aContentWindow m_aContentWindow = pRoot; for (int i = 0; i < 9 && m_aContentWindow; i++) |