summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/fontworkgallery.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-05-19 20:55:17 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-05-20 12:23:05 +0200
commit304b74784297df7cbd0762a2f468ba13b33402bd (patch)
tree915925e07d106a33dce5d8793efb7cb13c391adf /svx/source/tbxctrls/fontworkgallery.cxx
parent7a4fffb19fb3d573d9afd3f7136cd0e5b545b706 (diff)
use toggle instead of click for RadioButton
Change-Id: I8de3daf3799a78c63be2c560afa4a7cc02d63daa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115852 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/tbxctrls/fontworkgallery.cxx')
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx41
1 files changed, 28 insertions, 13 deletions
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index f024e8524fdb..5c6ac0d1bb7f 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -479,6 +479,7 @@ private:
std::unique_ptr<weld::CheckButton> mxKernPairs;
bool mbSettingValue;
+ DECL_LINK( KernSelectHdl, weld::ToggleButton&, void );
DECL_LINK( SelectHdl, weld::ToggleButton&, void );
void implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled );
@@ -502,9 +503,14 @@ 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_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl));
- mxKernPairs->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, SelectHdl));
+ mxKernPairs->connect_toggled(LINK(this, FontworkCharacterSpacingWindow, KernSelectHdl));
AddStatusListener( gsFontworkCharacterSpacing );
AddStatusListener( gsFontworkKernCharacterPairs );
@@ -596,11 +602,31 @@ void FontworkCharacterSpacingWindow::statusChanged( const css::frame::FeatureSta
}
}
-IMPL_LINK_NOARG(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&, void)
+IMPL_LINK_NOARG(FontworkCharacterSpacingWindow, KernSelectHdl, weld::ToggleButton&, void)
{
if (mbSettingValue)
return;
+ Sequence< PropertyValue > aArgs( 1 );
+ aArgs[0].Name = OUString(gsFontworkKernCharacterPairs).copy(5);
+ bool bKernOnOff = mxKernPairs->get_active();
+ aArgs[0].Value <<= bKernOnOff;
+
+ mxControl->dispatchCommand( gsFontworkKernCharacterPairs, aArgs );
+
+ implSetKernCharacterPairs(bKernOnOff, true);
+
+ mxControl->EndPopupMode();
+}
+
+IMPL_LINK(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&, rButton, void)
+{
+ if (!rButton.get_active())
+ return;
+
+ if (mbSettingValue)
+ return;
+
if (mxCustom->get_active())
{
Sequence< PropertyValue > aArgs( 1 );
@@ -611,17 +637,6 @@ IMPL_LINK_NOARG(FontworkCharacterSpacingWindow, SelectHdl, weld::ToggleButton&,
xControl->EndPopupMode();
xControl->dispatchCommand(".uno:FontworkCharacterSpacingDialog", aArgs);
}
- else if (mxKernPairs->get_active())
- {
- Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = OUString(gsFontworkKernCharacterPairs).copy(5);
- bool bKernOnOff = mxKernPairs->get_active();
- aArgs[0].Value <<= bKernOnOff;
-
- mxControl->dispatchCommand( gsFontworkKernCharacterPairs, aArgs );
-
- implSetKernCharacterPairs(bKernOnOff, true);
- }
else
{
sal_Int32 nCharacterSpacing;