diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-05-19 16:19:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-05-19 21:37:35 +0200 |
commit | 9e27ac3ed8f2405a94bf07519ca7941731025e37 (patch) | |
tree | 2f009042a2b62d2289f2925bbbe849c1409ecdac /svx/source/tbxctrls | |
parent | 14d03bf37063fcf5f0641989b1d0c06c49fe75c2 (diff) |
use toggle instead of click for RadioButton
Change-Id: I8fb4a28f4be701858af0ae8e95ff0f45a5401490
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115821
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r-- | svx/source/tbxctrls/extrusioncontrols.cxx | 29 | ||||
-rw-r--r-- | svx/source/tbxctrls/extrusioncontrols.hxx | 7 | ||||
-rw-r--r-- | svx/source/tbxctrls/fontworkgallery.cxx | 27 |
3 files changed, 20 insertions, 43 deletions
diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index 65d407831ffc..60a060085f3a 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -142,8 +142,7 @@ ExtrusionDirectionWindow::ExtrusionDirectionWindow( mxDirectionSet->GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height()); mxDirectionSet->SetOutputSizePixel(aSize); - mxPerspective->connect_clicked(LINK(this, ExtrusionDirectionWindow, SelectToolbarMenuHdl)); - mxParallel->connect_clicked(LINK(this, ExtrusionDirectionWindow, SelectToolbarMenuHdl)); + mxPerspective->connect_toggled(LINK(this, ExtrusionDirectionWindow, SelectToolbarMenuHdl)); AddStatusListener( g_sExtrusionDirection ); AddStatusListener( g_sExtrusionProjection ); @@ -233,7 +232,7 @@ IMPL_LINK_NOARG(ExtrusionDirectionWindow, SelectValueSetHdl, ValueSet*, void) mxControl->EndPopupMode(); } -IMPL_LINK_NOARG(ExtrusionDirectionWindow, SelectToolbarMenuHdl, weld::Button&, void) +IMPL_LINK_NOARG(ExtrusionDirectionWindow, SelectToolbarMenuHdl, weld::ToggleButton&, void) { int nProjection = mxPerspective->get_active() ? 0 : 1; @@ -349,7 +348,7 @@ ExtrusionDepthWindow::ExtrusionDepthWindow(svt::PopupWindowController* pControl, mxDepth3->connect_toggled(LINK(this, ExtrusionDepthWindow, SelectHdl)); mxDepth4->connect_toggled(LINK(this, ExtrusionDepthWindow, SelectHdl)); mxInfinity->connect_toggled(LINK(this, ExtrusionDepthWindow, SelectHdl)); - mxCustom->connect_clicked(LINK(this, ExtrusionDepthWindow, ClickHdl)); + mxCustom->connect_toggled(LINK(this, ExtrusionDepthWindow, SelectHdl)); AddStatusListener( gsExtrusionDepth ); AddStatusListener( gsMetricUnit ); @@ -444,14 +443,9 @@ void ExtrusionDepthWindow::statusChanged( } } -IMPL_LINK_NOARG(ExtrusionDepthWindow, ClickHdl, weld::Button&, void) +IMPL_LINK_NOARG(ExtrusionDepthWindow, SelectHdl, weld::ToggleButton&, void) { - SelectHdl(*mxCustom); -} - -IMPL_LINK(ExtrusionDepthWindow, SelectHdl, weld::ToggleButton&, rButton, void) -{ - if (mbSettingValue || !rButton.get_active()) + if (mbSettingValue) return; if (mxCustom->get_active()) @@ -609,9 +603,7 @@ ExtrusionLightingWindow::ExtrusionLightingWindow(svt::PopupWindowController* pCo mxLightingSet->GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height()); mxLightingSet->SetOutputSizePixel(aSize); - mxBright->connect_clicked(LINK(this, ExtrusionLightingWindow, SelectToolbarMenuHdl)); - mxNormal->connect_clicked(LINK(this, ExtrusionLightingWindow, SelectToolbarMenuHdl)); - mxDim->connect_clicked(LINK(this, ExtrusionLightingWindow, SelectToolbarMenuHdl)); + mxBright->connect_toggled(LINK(this, ExtrusionLightingWindow, SelectToolbarMenuHdl)); AddStatusListener( g_sExtrusionLightingDirection ); AddStatusListener( g_sExtrusionLightingIntensity ); @@ -715,7 +707,7 @@ IMPL_LINK_NOARG(ExtrusionLightingWindow, SelectValueSetHdl, ValueSet*, void) mxControl->EndPopupMode(); } -IMPL_LINK_NOARG(ExtrusionLightingWindow, SelectToolbarMenuHdl, weld::Button&, void) +IMPL_LINK_NOARG(ExtrusionLightingWindow, SelectToolbarMenuHdl, weld::ToggleButton&, void) { int nLevel; if (mxBright->get_active()) @@ -805,10 +797,7 @@ ExtrusionSurfaceWindow::ExtrusionSurfaceWindow(svt::PopupWindowController* pCont , mxPlastic(m_xBuilder->weld_radio_button("plastic")) , mxMetal(m_xBuilder->weld_radio_button("metal")) { - mxWireFrame->connect_clicked(LINK(this, ExtrusionSurfaceWindow, SelectHdl)); - mxMatt->connect_clicked(LINK(this, ExtrusionSurfaceWindow, SelectHdl)); - mxPlastic->connect_clicked(LINK(this, ExtrusionSurfaceWindow, SelectHdl)); - mxMetal->connect_clicked(LINK(this, ExtrusionSurfaceWindow, SelectHdl)); + mxWireFrame->connect_toggled(LINK(this, ExtrusionSurfaceWindow, SelectHdl)); AddStatusListener( g_sExtrusionSurface ); } @@ -849,7 +838,7 @@ void ExtrusionSurfaceWindow::statusChanged( } } -IMPL_LINK_NOARG(ExtrusionSurfaceWindow, SelectHdl, weld::Button&, void) +IMPL_LINK_NOARG(ExtrusionSurfaceWindow, SelectHdl, weld::ToggleButton&, void) { sal_Int32 nSurface; if (mxWireFrame->get_active()) diff --git a/svx/source/tbxctrls/extrusioncontrols.hxx b/svx/source/tbxctrls/extrusioncontrols.hxx index 0a051e2c461d..440ef8874597 100644 --- a/svx/source/tbxctrls/extrusioncontrols.hxx +++ b/svx/source/tbxctrls/extrusioncontrols.hxx @@ -65,7 +65,7 @@ private: Image maImgDirection[9]; - DECL_LINK( SelectToolbarMenuHdl, weld::Button&, void ); + DECL_LINK( SelectToolbarMenuHdl, weld::ToggleButton&, void ); DECL_LINK( SelectValueSetHdl, ValueSet*, void ); void implSetDirection( sal_Int32 nSkew, bool bEnabled ); @@ -106,7 +106,6 @@ private: bool mbSettingValue; DECL_LINK( SelectHdl, weld::ToggleButton&, void ); - DECL_LINK( ClickHdl, weld::Button&, void ); void implFillStrings( FieldUnit eUnit ); void implSetDepth( double fDepth ); @@ -151,7 +150,7 @@ private: void implSetIntensity( int nLevel, bool bEnabled ); void implSetDirection( int nDirection, bool bEnabled ); - DECL_LINK( SelectToolbarMenuHdl, weld::Button&, void ); + DECL_LINK( SelectToolbarMenuHdl, weld::ToggleButton&, void ); DECL_LINK( SelectValueSetHdl, ValueSet*, void ); public: ExtrusionLightingWindow(svt::PopupWindowController* pControl, weld::Widget* pParentWindow); @@ -186,7 +185,7 @@ private: std::unique_ptr<weld::RadioButton> mxPlastic; std::unique_ptr<weld::RadioButton> mxMetal; - DECL_LINK( SelectHdl, weld::Button&, void ); + DECL_LINK( SelectHdl, weld::ToggleButton&, void ); void implSetSurface( int nSurface, bool bEnabled ); diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 3c256c89b773..f024e8524fdb 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -480,7 +480,6 @@ private: bool mbSettingValue; DECL_LINK( SelectHdl, weld::ToggleButton&, void ); - DECL_LINK( ClickHdl, weld::Button&, void ); void implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled ); void implSetKernCharacterPairs(bool bKernOnOff, bool bEnabled); @@ -503,12 +502,7 @@ FontworkCharacterSpacingWindow::FontworkCharacterSpacingWindow(svt::PopupWindowC , mxKernPairs(m_xBuilder->weld_check_button("kernpairs")) , mbSettingValue(false) { - mxVeryTight->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl)); - mxTight->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl)); mxNormal->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl)); - mxLoose->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl)); - mxVeryLoose->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl)); - mxCustom->connect_clicked(LINK(this, FontworkCharacterSpacingWindow, ClickHdl)); mxKernPairs->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl)); @@ -602,17 +596,12 @@ void FontworkCharacterSpacingWindow::statusChanged( const css::frame::FeatureSta } } -IMPL_LINK_NOARG(FontworkCharacterSpacingWindow, ClickHdl, weld::Button&, void) +IMPL_LINK_NOARG(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&, void) { - SelectHdl(*mxCustom); -} - -IMPL_LINK(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&, rButton, void) -{ - if (mbSettingValue || !rButton.get_active()) + if (mbSettingValue) return; - if (&rButton == mxCustom.get()) + if (mxCustom->get_active()) { Sequence< PropertyValue > aArgs( 1 ); aArgs[0].Name = OUString(gsFontworkCharacterSpacing).copy(5); @@ -622,7 +611,7 @@ IMPL_LINK(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&, rButto xControl->EndPopupMode(); xControl->dispatchCommand(".uno:FontworkCharacterSpacingDialog", aArgs); } - else if (&rButton == mxKernPairs.get()) + else if (mxKernPairs->get_active()) { Sequence< PropertyValue > aArgs( 1 ); aArgs[0].Name = OUString(gsFontworkKernCharacterPairs).copy(5); @@ -636,13 +625,13 @@ IMPL_LINK(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&, rButto else { sal_Int32 nCharacterSpacing; - if (&rButton == mxVeryTight.get()) + if (mxVeryTight->get_active()) nCharacterSpacing = 80; - else if (&rButton == mxTight.get()) + else if (mxTight->get_active()) nCharacterSpacing = 90; - else if (&rButton == mxLoose.get()) + else if (mxLoose->get_active()) nCharacterSpacing = 120; - else if (&rButton == mxVeryLoose.get()) + else if (mxVeryLoose->get_active()) nCharacterSpacing = 150; else nCharacterSpacing = 100; |