Convert SvtLineListBox to WeldToolbarPopup

Change-Id: I1849e40508a8754ec567da5913d3454571da5bee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149063
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150015
Tested-by: Jenkins
This commit is contained in:
Szymon Kłos
2023-04-04 20:38:11 +02:00
parent 65752e6498
commit fcb4e31983
3 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -20,6 +20,7 @@
#pragma once
#include <svtools/svtdllapi.h>
#include <svtools/toolbarmenu.hxx>
#include <editeng/borderline.hxx>
#include <vcl/idle.hxx>
#include <vcl/metric.hxx>
@@ -198,7 +199,7 @@ inline Color sameDistColor( Color /*rMain*/, Color rDefault )
class ValueSet;
class SVT_DLLPUBLIC SvtLineListBox
class SVT_DLLPUBLIC SvtLineListBox final : public WeldToolbarPopup
{
public:
typedef Color (*ColorFunc)(Color);
@@ -244,6 +245,8 @@ public:
void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
virtual void GrabFocus() override;
private:
SVT_DLLPRIVATE void ImpGetLine( tools::Long nLine1, tools::Long nLine2, tools::Long nDistance,
@@ -251,7 +254,6 @@ private:
SvxBorderLineStyle nStyle, BitmapEx& rBmp );
DECL_DLLPRIVATE_LINK(ValueSelectHdl, ValueSet*, void);
DECL_DLLPRIVATE_LINK(FocusHdl, weld::Widget&, void);
DECL_DLLPRIVATE_LINK(ToggleHdl, weld::Toggleable&, void);
DECL_DLLPRIVATE_LINK(NoneHdl, weld::Button&, void);
DECL_DLLPRIVATE_LINK(StyleUpdatedHdl, weld::Widget&, void);
@@ -264,8 +266,6 @@ private:
SvtLineListBox& operator =( const SvtLineListBox& ) = delete;
std::unique_ptr<weld::MenuButton> m_xControl;
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Widget> m_xTopLevel;
std::unique_ptr<weld::Button> m_xNoneButton;
std::unique_ptr<ValueSet> m_xLineSet;
std::unique_ptr<weld::CustomWeld> m_xLineSetWin;
+4 -6
View File
@@ -1399,9 +1399,8 @@ void SvtLineListBox::ImpGetLine( tools::Long nLine1, tools::Long nLine2, tools::
}
SvtLineListBox::SvtLineListBox(std::unique_ptr<weld::MenuButton> pControl)
: m_xControl(std::move(pControl))
, m_xBuilder(Application::CreateBuilder(m_xControl.get(), "svt/ui/linewindow.ui"))
, m_xTopLevel(m_xBuilder->weld_widget("line_popup_window"))
: WeldToolbarPopup(css::uno::Reference<css::frame::XFrame>(), pControl.get(), "svt/ui/linewindow.ui", "line_popup_window")
, m_xControl(std::move(pControl))
, m_xNoneButton(m_xBuilder->weld_button("none_line_button"))
, m_xLineSet(new ValueSet(nullptr))
, m_xLineSetWin(new weld::CustomWeld(*m_xBuilder, "lineset", *m_xLineSet))
@@ -1417,7 +1416,6 @@ SvtLineListBox::SvtLineListBox(std::unique_ptr<weld::MenuButton> pControl)
m_xNoneButton->connect_clicked(LINK(this, SvtLineListBox, NoneHdl));
m_xTopLevel->connect_focus_in(LINK(this, SvtLineListBox, FocusHdl));
m_xControl->set_popover(m_xTopLevel.get());
m_xControl->connect_toggled(LINK(this, SvtLineListBox, ToggleHdl));
m_xControl->connect_style_updated(LINK(this, SvtLineListBox, StyleUpdatedHdl));
@@ -1438,7 +1436,7 @@ SvtLineListBox::SvtLineListBox(std::unique_ptr<weld::MenuButton> pControl)
aVirDev->SetMapMode(MapMode(MapUnit::MapTwip));
}
IMPL_LINK_NOARG(SvtLineListBox, FocusHdl, weld::Widget&, void)
void SvtLineListBox::GrabFocus()
{
if (GetSelectEntryStyle() == SvxBorderLineStyle::NONE)
m_xNoneButton->grab_focus();
@@ -1449,7 +1447,7 @@ IMPL_LINK_NOARG(SvtLineListBox, FocusHdl, weld::Widget&, void)
IMPL_LINK(SvtLineListBox, ToggleHdl, weld::Toggleable&, rButton, void)
{
if (rButton.get_active())
FocusHdl(*m_xTopLevel);
GrabFocus();
}
IMPL_LINK_NOARG(SvtLineListBox, StyleUpdatedHdl, weld::Widget&, void)
+2
View File
@@ -238,6 +238,8 @@ bool isBuilderEnabledForPopup(std::u16string_view rUIFile)
|| rUIFile == u"modules/scalc/ui/filtersubdropdown.ui"
|| rUIFile == u"modules/scalc/ui/floatingborderstyle.ui"
|| rUIFile == u"modules/scalc/ui/floatinglinestyle.ui"
// svt
|| rUIFile == u"svt/ui/linewindow.ui"
// svx
|| rUIFile == u"svx/ui/colorwindow.ui"
|| rUIFile == u"svx/ui/currencywindow.ui"