[Libreoffice-commits] core.git: 2 commits - include/vcl svx/source vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 28 12:33:44 UTC 2021


 include/vcl/jsdialog/executor.hxx |    2 ++
 include/vcl/weld.hxx              |    2 ++
 svx/source/tbxctrls/tbcontrl.cxx  |    6 +++++-
 vcl/jsdialog/executor.cxx         |   12 ++++++++++++
 vcl/jsdialog/jsdialogbuilder.cxx  |    8 ++++++--
 5 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit 90f9a35319b3fc5db3fb4714a4b78f2c46fb4f28
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Jun 21 17:21:11 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Jul 28 14:33:19 2021 +0200

    Don't steal focus from popup in online
    
    To avoid closing the popup when it is first time activated.
    
    Change-Id: I23abd691ecc271b46f1bfba041f247208200ba7e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117595
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119599
    Tested-by: Jenkins

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 1f2adef9fdfb..e7d1bcc356e7 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3849,7 +3849,11 @@ ColorListBox::ColorListBox(std::unique_ptr<weld::MenuButton> pControl, TopLevelP
 IMPL_LINK(ColorListBox, ToggleHdl, weld::Toggleable&, rButton, void)
 {
     if (rButton.get_active())
-        getColorWindow()->GrabFocus();
+    {
+        ColorWindow* pColorWindow = getColorWindow();
+        if (pColorWindow && !comphelper::LibreOfficeKit::isActive())
+            pColorWindow->GrabFocus();
+    }
 }
 
 ColorListBox::~ColorListBox()
commit 333f0cb495c64439ebd77e86a58297d455b71a13
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Jun 17 11:50:26 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Jul 28 14:33:05 2021 +0200

    jsdialog: handle popover close
    
    Change-Id: I8b5afe7438c57cfe0553475131bed1e3c4921f46
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117373
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119598
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx
index c6d7dceb60c7..787c4d5a0f54 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -54,6 +54,8 @@ public:
     {
         rSpinButton.signal_value_changed();
     }
+
+    static void trigger_closed(weld::Popover& rPopover) { rPopover.signal_closed(); }
 };
 
 namespace jsdialog
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 3e085e0af6aa..ee647b341e21 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2335,6 +2335,8 @@ public:
 
 class VCL_DLLPUBLIC Popover : virtual public Container
 {
+    friend class ::LOKTrigger;
+
 private:
     Link<weld::Popover&, void> m_aCloseHdl;
 
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 5675ec0b56f0..c1882d5a2d5b 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -397,6 +397,18 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
                 }
             }
         }
+        else if (sControlType == "popover")
+        {
+            auto pPopover = dynamic_cast<weld::Popover*>(pWidget);
+            if (pPopover)
+            {
+                if (sAction == "close")
+                {
+                    LOKTrigger::trigger_closed(*pPopover);
+                    return true;
+                }
+            }
+        }
         else if (sControlType == "radiobutton")
         {
             auto pRadioButton = dynamic_cast<weld::RadioButton*>(pWidget);
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index a0b17f23bf08..65414c46ed5f 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -909,7 +909,7 @@ std::unique_ptr<weld::MenuButton> JSInstanceBuilder::weld_menu_button(const OStr
 std::unique_ptr<weld::Popover> JSInstanceBuilder::weld_popover(const OString& id)
 {
     DockingWindow* pDockingWindow = m_xBuilder->get<DockingWindow>(id);
-    std::unique_ptr<weld::Popover> pRet(
+    std::unique_ptr<weld::Popover> pWeldWidget(
         pDockingWindow ? new JSPopover(this, pDockingWindow, this, false) : nullptr);
     if (pDockingWindow)
     {
@@ -927,7 +927,11 @@ std::unique_ptr<weld::Popover> JSInstanceBuilder::weld_popover(const OString& id
             initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
         }
     }
-    return pRet;
+
+    if (pWeldWidget)
+        RememberWidget("__POPOVER__", pWeldWidget.get());
+
+    return pWeldWidget;
 }
 
 weld::MessageDialog* JSInstanceBuilder::CreateMessageDialog(weld::Widget* pParent,


More information about the Libreoffice-commits mailing list