diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 57b9094284ee..0d7293fc77eb 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include #include @@ -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 m_xControl; - std::unique_ptr m_xBuilder; - std::unique_ptr m_xTopLevel; std::unique_ptr m_xNoneButton; std::unique_ptr m_xLineSet; std::unique_ptr m_xLineSetWin; diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index a17172d5ca44..ef6334a856c9 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1399,9 +1399,8 @@ void SvtLineListBox::ImpGetLine( tools::Long nLine1, tools::Long nLine2, tools:: } SvtLineListBox::SvtLineListBox(std::unique_ptr 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(), 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 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 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) diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 8070bc708db7..2069890bad2a 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -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"