diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-29 15:07:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-29 18:13:33 +0200 |
commit | 663ce5d0f89e9523183ed9ca4cbfcdacf9df4cc8 (patch) | |
tree | 72e8f6aa0e5020134ae2624cb6c12ae1ab66e30a | |
parent | 416cb76758719b88a4cdefe8c9d16131c35cfdf5 (diff) |
tdf#136520 allow color popdowns to be tearable again
Change-Id: Ic92ef5235662e1680aadb5666e05dad1bf808e9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103625
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/svtools/toolbarmenu.hxx | 2 | ||||
-rw-r--r-- | svtools/source/control/toolbarmenu.cxx | 7 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 6 | ||||
-rw-r--r-- | svx/uiconfig/ui/interimtearableparent.ui | 29 |
5 files changed, 41 insertions, 4 deletions
diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx index 95738fe93fa6..ced73974d7d4 100644 --- a/include/svtools/toolbarmenu.hxx +++ b/include/svtools/toolbarmenu.hxx @@ -93,7 +93,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); virtual void dispose() override; virtual ~InterimToolbarPopup() override; diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 04d782ec71fd..259115c90a98 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -174,8 +174,11 @@ 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) - : DockingWindow(pParent, "InterimDockParent", "svx/ui/interimdockparent.ui", rFrame) + std::unique_ptr<WeldToolbarPopup> xPopup, bool bTearable) + : DockingWindow(pParent, + !bTearable ? OString("InterimDockParent") : OString("InterimTearableParent"), + !bTearable ? OUString("svx/ui/interimdockparent.ui") : OUString("svx/ui/interimtearableparent.ui"), + rFrame) , m_xBox(get("box")) , m_xFrame(rFrame) , m_xBuilder(Application::CreateInterimBuilder(m_xBox.get(), "svx/ui/interimparent.ui", false)) diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index b04db125cb0e..a55e41358f00 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -86,6 +86,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 f64b0ba95435..6b0f393bf28a 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -3270,7 +3270,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> |