diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-21 09:05:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-21 15:13:58 +0100 |
commit | 59ebcdd732a74c0e4ec536921c13ff4f9577d4b0 (patch) | |
tree | 5f6bd451ea82a764e859d3f901027c55909df232 | |
parent | d460dc65525be7e5410978f80bda0cd0616b8d60 (diff) |
weld EmptyPanel
Change-Id: I17306b33f145c3b24a88a797c1a2133b19884f4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87121
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/svx/strings.hrc | 1 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/source/sidebar/EmptyPanel.cxx | 25 | ||||
-rw-r--r-- | svx/source/sidebar/EmptyPanel.hxx | 12 | ||||
-rw-r--r-- | svx/uiconfig/ui/sidebarempty.ui | 47 |
5 files changed, 55 insertions, 31 deletions
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index 02d249e64664..6bdb64c0efba 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -1272,7 +1272,6 @@ #define RID_SVXSTR_ZOOM_WHOLE_PAGE NC_("RID_SVXSTR_ZOOM_WHOLE_PAGE", "Entire Page") #define RID_SVXSTR_ZOOM_PAGE_WIDTH NC_("RID_SVXSTR_ZOOM_PAGE_WIDTH", "Page Width") #define RID_SVXSTR_ZOOM_OPTIMAL_VIEW NC_("RID_SVXSTR_ZOOM_OPTIMAL_VIEW", "Optimal View") -#define RID_SIDEBAR_EMPTY_PANEL_TEXT NC_("RID_SIDEBAR_EMPTY_PANEL_TEXT", "Properties for the task that you are performing are not available for the current selection") #define RID_SVXSTR_SEARCH_STYLES NC_("RID_SVXSTR_SEARCH_STYLES", "Including Styles") #define RID_SVXSTR_WRITER_STYLES NC_("RID_SVXSTR_WRITER_STYLES", "Paragraph St~yles") diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index 08b3ccb2dd5b..dd0ac621adcc 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -96,6 +96,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/savemodifieddialog \ svx/uiconfig/ui/selectionmenu \ svx/uiconfig/ui/sidebararea \ + svx/uiconfig/ui/sidebarempty \ svx/uiconfig/ui/sidebarshadow \ svx/uiconfig/ui/sidebargallery \ svx/uiconfig/ui/sidebargraphic \ diff --git a/svx/source/sidebar/EmptyPanel.cxx b/svx/source/sidebar/EmptyPanel.cxx index 23bf1ab2c17a..39704527deac 100644 --- a/svx/source/sidebar/EmptyPanel.cxx +++ b/svx/source/sidebar/EmptyPanel.cxx @@ -24,18 +24,9 @@ namespace svx::sidebar { EmptyPanel::EmptyPanel (vcl::Window* pParent) - : Control(pParent) - , maMessageControl(VclPtr<FixedText>::Create(this)) + : PanelLayout(pParent, "EmptyPanel", "svx/ui/sidebarempty.ui", nullptr, true) + , mxMessageControl(m_xBuilder->weld_label("message")) { - maMessageControl->SetText(SvxResId(RID_SIDEBAR_EMPTY_PANEL_TEXT)); - maMessageControl->setPosSizePixel(5, 5, 250, 15); - maMessageControl->SetStyle(WB_WORDBREAK); - maMessageControl->Show(); - - SetBackground(Wallpaper()); - - maMessageControl->Show(); - Show(); } EmptyPanel::~EmptyPanel() @@ -45,18 +36,10 @@ EmptyPanel::~EmptyPanel() void EmptyPanel::dispose() { - maMessageControl.disposeAndClear(); - Control::dispose(); + mxMessageControl.reset(); + PanelLayout::dispose(); } - -void EmptyPanel::Resize() -{ - const Size aSize (GetSizePixel()); - maMessageControl->SetSizePixel(aSize); -} - - } // end of namespace svx::sidebar /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/EmptyPanel.hxx b/svx/source/sidebar/EmptyPanel.hxx index 3fcd07e5910e..aa3e1a5b2f7b 100644 --- a/svx/source/sidebar/EmptyPanel.hxx +++ b/svx/source/sidebar/EmptyPanel.hxx @@ -19,10 +19,7 @@ #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_EMPTYPANEL_HXX #define INCLUDED_SVX_SOURCE_SIDEBAR_EMPTYPANEL_HXX -#include <vcl/window.hxx> -#include <vcl/ctrl.hxx> -#include <vcl/fixed.hxx> - +#include <svx/sidebar/PanelLayout.hxx> namespace svx { namespace sidebar { @@ -30,18 +27,15 @@ namespace svx { namespace sidebar { /** Display a panel that tells the user that the current deck is intentionally empty. */ -class EmptyPanel - : public Control +class EmptyPanel final : public PanelLayout { public: explicit EmptyPanel (vcl::Window* pParent); virtual ~EmptyPanel() override; virtual void dispose() override; - virtual void Resize() override; - private: - VclPtr<FixedText> maMessageControl; + std::unique_ptr<weld::Label> mxMessageControl; }; } } // end of namespace svx::sidebar diff --git a/svx/uiconfig/ui/sidebarempty.ui b/svx/uiconfig/ui/sidebarempty.ui new file mode 100644 index 000000000000..4a59d8f5592e --- /dev/null +++ b/svx/uiconfig/ui/sidebarempty.ui @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> +<interface domain="svx"> + <requires lib="gtk+" version="3.18"/> + <object class="GtkGrid" id="EmptyPanel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="border_width">6</property> + <child> + <object class="GtkGrid" id="container"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkLabel" id="message"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="label" translatable="yes" context="sidebarempty|RID_SIDEBAR_EMPTY_PANEL_TEXT">Properties for the task that you are performing are not available for the current selection"</property> + <property name="wrap">True</property> + <property name="max_width_chars">12</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <child internal-child="accessible"> + <object class="AtkObject" id="message-atkobject"> + <property name="AtkObject::accessible-role" translatable="no">static</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> +</interface> |