include/svtools/toolbarmenu.hxx          |    2 +-
 svtools/source/control/toolbarmenu.cxx   |    6 ++++--
 svx/UIConfig_svx.mk                      |    1 +
 svx/source/tbxctrls/tbcontrl.cxx         |    6 +++++-
 svx/uiconfig/ui/interimtearableparent.ui |   29 +++++++++++++++++++++++++++++
 5 files changed, 40 insertions(+), 4 deletions(-)

New commits:
commit 48f27cbca68c2e00c081ed240b6dd0851ab85458
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Sep 29 15:07:50 2020 +0100
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Wed Sep 30 04:31:22 2020 +0200

    tdf#136520 allow color popdowns to be tearable again
    
    Change-Id: Ic92ef5235662e1680aadb5666e05dad1bf808e9d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103626
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx
index c08da7e9c899..f50a8359831c 100644
--- a/include/svtools/toolbarmenu.hxx
+++ b/include/svtools/toolbarmenu.hxx
@@ -125,7 +125,7 @@ private:
     std::unique_ptr<WeldToolbarPopup> m_xPopup;
 public:
     InterimToolbarPopup(const css::uno::Reference<css::frame::XFrame>& rFrame, 
vcl::Window* pParent,
-                        std::unique_ptr<WeldToolbarPopup> xPopup);
+                        std::unique_ptr<WeldToolbarPopup> xPopup, bool 
bTearable = false);
     weld::Container* getContainer() { return m_xContainer.get(); }
     virtual void dispose() override;
     virtual ~InterimToolbarPopup() override;
diff --git a/svtools/source/control/toolbarmenu.cxx 
b/svtools/source/control/toolbarmenu.cxx
index da45acfbddf6..c96dba998c7e 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -223,8 +223,10 @@ IMPL_LINK_NOARG(ToolbarPopupContainer, FocusHdl, 
weld::Widget&, void)
 }
 
 InterimToolbarPopup::InterimToolbarPopup(const 
css::uno::Reference<css::frame::XFrame>& rFrame, vcl::Window* pParent,
-                                         std::unique_ptr<WeldToolbarPopup> 
xPopup)
-    : ToolbarPopup(rFrame, pParent, "InterimDockParent", 
"svx/ui/interimdockparent.ui")
+                                         std::unique_ptr<WeldToolbarPopup> 
xPopup, bool bTearable)
+    : ToolbarPopup(rFrame, pParent,
+                   !bTearable ? OString("InterimDockParent") : 
OString("InterimTearableParent"),
+                   !bTearable ? OUString("svx/ui/interimdockparent.ui") : 
OUString("svx/ui/interimtearableparent.ui"))
     , m_xBox(get("box"))
     , m_xBuilder(Application::CreateInterimBuilder(m_xBox.get(), 
"svx/ui/interimparent.ui"))
     , m_xContainer(m_xBuilder->weld_container("container"))
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index fdc7d1b3bc52..2d7986074b54 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -83,6 +83,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
        svx/uiconfig/ui/inspectortextpanel \
        svx/uiconfig/ui/interimdockparent \
        svx/uiconfig/ui/interimparent \
+       svx/uiconfig/ui/interimtearableparent \
        svx/uiconfig/ui/labelbox \
        svx/uiconfig/ui/lightingwindow \
        svx/uiconfig/ui/linkwarndialog \
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 2cb126483faa..8780b03f2d6e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3293,7 +3293,11 @@ VclPtr<vcl::Window> 
SvxColorToolBoxControl::createVclPopupWindow( vcl::Window* p
         xPopover->SetSelectedHdl( LINK( this, SvxColorToolBoxControl, 
SelectedHdl ) );
 
     mxInterimPopover = 
VclPtr<InterimToolbarPopup>::Create(getFrameInterface(), pParent,
-        std::move(xPopover));
+        std::move(xPopover), true);
+
+    auto aProperties = 
vcl::CommandInfoProvider::GetCommandProperties(m_aCommandURL, m_sModuleName);
+    OUString aWindowTitle = 
vcl::CommandInfoProvider::GetLabelForCommand(aProperties);
+    mxInterimPopover->SetText(aWindowTitle);
 
     mxInterimPopover->Show();
 
diff --git a/svx/uiconfig/ui/interimtearableparent.ui 
b/svx/uiconfig/ui/interimtearableparent.ui
new file mode 100644
index 000000000000..910472c2c258
--- /dev/null
+++ b/svx/uiconfig/ui/interimtearableparent.ui
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.36.0 -->
+<interface domain="svx">
+  <requires lib="gtk+" version="3.18"/>
+  <object class="GtkWindow" id="InterimTearableParent">
+    <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="border_width">4</property>
+    <property name="resizable">False</property>
+    <property name="destroy_with_parent">True</property>
+    <property name="type_hint">dock</property>
+    <property name="skip_pager_hint">True</property>
+    <child>
+      <object class="GtkBox" id="box">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">6</property>
+        <child>
+          <placeholder/>
+        </child>
+      </object>
+    </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
+  </object>
+</interface>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to