diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-05-20 10:36:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-05-20 15:33:00 +0200 |
commit | 92ed4d92fa2ff02a4c1f168aa17cf871a49c3633 (patch) | |
tree | afbe4cc0a15bb242ef3e59536e1e583542523abe /cui | |
parent | e292aa04980d0eac776619c9d37812ebff0a333c (diff) |
use toggle instead of click for RadioButton
Change-Id: I4f91a6f0fb1628a8907848d9d8dffd92d382ecaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115865
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/page.hxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 19 |
2 files changed, 9 insertions, 12 deletions
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index e3c5aa4ed268..fe43158e9424 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -136,7 +136,7 @@ private: DECL_LINK(LayoutHdl_Impl, weld::ComboBox&, void); DECL_LINK(GutterPositionHdl_Impl, weld::ComboBox&, void); DECL_LINK(PaperBinHdl_Impl, weld::Widget&, void); - DECL_LINK(SwapOrientation_Impl, weld::Button&, void); + DECL_LINK(SwapOrientation_Impl, weld::ToggleButton&, void); void SwapFirstValues_Impl( bool bSet ); DECL_LINK(BorderModify_Impl, weld::MetricSpinButton&, void); void InitHeadFoot_Impl( const SfxItemSet& rSet ); diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 729aef82bbfd..8562257a70db 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -316,8 +316,8 @@ void SvxPageDescPage::Init_Impl() m_xPaperSizeBox->connect_changed(LINK(this, SvxPageDescPage, PaperSizeSelect_Impl)); m_xPaperWidthEdit->connect_value_changed( LINK(this, SvxPageDescPage, PaperSizeModify_Impl)); m_xPaperHeightEdit->connect_value_changed(LINK(this, SvxPageDescPage, PaperSizeModify_Impl)); - m_xLandscapeBtn->connect_clicked(LINK(this, SvxPageDescPage, SwapOrientation_Impl)); - m_xPortraitBtn->connect_clicked(LINK(this, SvxPageDescPage, SwapOrientation_Impl)); + m_xLandscapeBtn->connect_toggled(LINK(this, SvxPageDescPage, SwapOrientation_Impl)); + m_xPortraitBtn->connect_toggled(LINK(this, SvxPageDescPage, SwapOrientation_Impl)); Link<weld::MetricSpinButton&, void> aLink = LINK(this, SvxPageDescPage, BorderModify_Impl); m_xLeftMarginEdit->connect_value_changed(aLink); @@ -465,14 +465,14 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) // tdf#130548 disable callbacks on the other of a pair of the radiogroup // when toggling its partner - m_xLandscapeBtn->connect_clicked(Link<weld::Button&, void>()); - m_xPortraitBtn->connect_clicked(Link<weld::Button&, void>()); + m_xLandscapeBtn->connect_toggled(Link<weld::ToggleButton&, void>()); + m_xPortraitBtn->connect_toggled(Link<weld::ToggleButton&, void>()); m_xLandscapeBtn->set_active(bLandscape); m_xPortraitBtn->set_active(!bLandscape); - m_xLandscapeBtn->connect_clicked(LINK(this, SvxPageDescPage, SwapOrientation_Impl)); - m_xPortraitBtn->connect_clicked(LINK(this, SvxPageDescPage, SwapOrientation_Impl)); + m_xLandscapeBtn->connect_toggled(LINK(this, SvxPageDescPage, SwapOrientation_Impl)); + m_xPortraitBtn->connect_toggled(LINK(this, SvxPageDescPage, SwapOrientation_Impl)); m_aBspWin.SetSize( Size( ConvertLong_Impl( aPaperSize.Width(), eUnit ), ConvertLong_Impl( aPaperSize.Height(), eUnit ) ) ); @@ -1010,12 +1010,9 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperSizeModify_Impl, weld::MetricSpinButton&, RangeHdl_Impl(); } -IMPL_LINK(SvxPageDescPage, SwapOrientation_Impl, weld::Button&, rBtn, void) +IMPL_LINK(SvxPageDescPage, SwapOrientation_Impl, weld::ToggleButton&, rBtn, void) { - if ( - !((!bLandscape && &rBtn == m_xLandscapeBtn.get()) || - (bLandscape && &rBtn == m_xPortraitBtn.get())) - ) + if (!rBtn.get_active()) return; bLandscape = m_xLandscapeBtn->get_active(); |