diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-12-22 17:47:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-12-30 10:39:21 +0100 |
commit | c3b58a0de7b7dd08695fbc9ad96c573ea1305357 (patch) | |
tree | 9cd7dad35990d45095e28a4c8ca3ee6593ed6877 | |
parent | 3a3110564bcda4678fb804d01013e226fd2fbe93 (diff) |
weld AlignmentPropertyPanel
Change-Id: I3070f5e7b2d5f104f4eea9d3e2f700ce2d1e7375
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85721
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/source/ui/sidebar/AlignmentPropertyPanel.cxx | 293 | ||||
-rw-r--r-- | sc/source/ui/sidebar/AlignmentPropertyPanel.hxx | 52 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/sidebaralignment.ui | 122 | ||||
-rw-r--r-- | solenv/sanitizers/ui/modules/scalc.suppr | 4 | ||||
-rw-r--r-- | svtools/source/uno/generictoolboxcontroller.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 4 |
6 files changed, 219 insertions, 262 deletions
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx index e54e8bc1b16b..20e6fc76de0c 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx @@ -42,34 +42,39 @@ AlignmentPropertyPanel::AlignmentPropertyPanel( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings) - : PanelLayout(pParent, "AlignmentPropertyPanel", "modules/scalc/ui/sidebaralignment.ui", rxFrame), - maAlignHorControl(SID_H_ALIGNCELL, *pBindings, *this), - maLeftIndentControl(SID_ATTR_ALIGN_INDENT, *pBindings, *this), - maMergeCellControl(FID_MERGE_TOGGLE, *pBindings, *this), - maWrapTextControl(SID_ATTR_ALIGN_LINEBREAK, *pBindings, *this), - maAngleControl(SID_ATTR_ALIGN_DEGREES, *pBindings, *this), - maVrtStackControl(SID_ATTR_ALIGN_STACKED, *pBindings, *this), - maRefEdgeControl(SID_ATTR_ALIGN_LOCKPOS, *pBindings, *this), - mbMultiDisable(false), - maContext(), - mpBindings(pBindings) + : PanelLayout(pParent, "AlignmentPropertyPanel", "modules/scalc/ui/sidebaralignment.ui", rxFrame, true) + , mxFTLeftIndent(m_xBuilder->weld_label("leftindentlabel")) + , mxMFLeftIndent(m_xBuilder->weld_metric_spin_button("leftindent", FieldUnit::POINT)) + , mxCBXWrapText(m_xBuilder->weld_check_button("wraptext")) + , mxCBXMergeCell(m_xBuilder->weld_check_button("mergecells")) + , mxFtRotate(m_xBuilder->weld_label("orientationlabel")) + , mxMtrAngle(m_xBuilder->weld_metric_spin_button("orientationdegrees", FieldUnit::DEGREE)) + , mxRefEdgeBottom(m_xBuilder->weld_radio_button("bottom")) + , mxRefEdgeTop(m_xBuilder->weld_radio_button("top")) + , mxRefEdgeStd(m_xBuilder->weld_radio_button("standard")) + , mxCBStacked(m_xBuilder->weld_check_button("stacked")) + , mxTextOrientBox(m_xBuilder->weld_widget("textorientbox")) + , mxHorizontalAlign(m_xBuilder->weld_toolbar("horizontalalignment")) + , mxHorizontalAlignDispatch(new ToolbarUnoDispatcher(*mxHorizontalAlign, rxFrame)) + , mxVertAlign(m_xBuilder->weld_toolbar("verticalalignment")) + , mxVertAlignDispatch(new ToolbarUnoDispatcher(*mxVertAlign, rxFrame)) + , mxWriteDirection(m_xBuilder->weld_toolbar("writedirection")) + , mxWriteDirectionDispatch(new ToolbarUnoDispatcher(*mxWriteDirection, rxFrame)) + , mxIndentButtons(m_xBuilder->weld_toolbar("indentbuttons")) + , mxIndentButtonsDispatch(new ToolbarUnoDispatcher(*mxIndentButtons, rxFrame)) + , maAlignHorControl(SID_H_ALIGNCELL, *pBindings, *this) + , maLeftIndentControl(SID_ATTR_ALIGN_INDENT, *pBindings, *this) + , maMergeCellControl(FID_MERGE_TOGGLE, *pBindings, *this) + , maWrapTextControl(SID_ATTR_ALIGN_LINEBREAK, *pBindings, *this) + , maAngleControl(SID_ATTR_ALIGN_DEGREES, *pBindings, *this) + , maVrtStackControl(SID_ATTR_ALIGN_STACKED, *pBindings, *this) + , maRefEdgeControl(SID_ATTR_ALIGN_LOCKPOS, *pBindings, *this) + , mbMultiDisable(false) + , mbSettingToggles(false) + , maContext() + , mpBindings(pBindings) { - get(mpFTLeftIndent, "leftindentlabel"); - get(mpMFLeftIndent, "leftindent"); - get(mpCBXWrapText, "wraptext"); - get(mpCBXMergeCell, "mergecells"); - get(mpFtRotate, "orientationlabel"); - get(mpMtrAngle, "orientationdegrees"); - get(mpRefEdgeBottom, "bottom"); - get(mpRefEdgeTop, "top"); - get(mpRefEdgeStd, "standard"); - get(mpCBStacked, "stacked"); - get(mpTextOrientBox , "textorientbox"); - Initialize(); - - mpFTLeftIndent->SetBackground(Wallpaper()); - mpFtRotate->SetBackground(Wallpaper()); } AlignmentPropertyPanel::~AlignmentPropertyPanel() @@ -79,17 +84,26 @@ AlignmentPropertyPanel::~AlignmentPropertyPanel() void AlignmentPropertyPanel::dispose() { - mpFTLeftIndent.clear(); - mpMFLeftIndent.clear(); - mpCBXWrapText.clear(); - mpCBXMergeCell.clear(); - mpFtRotate.clear(); - mpMtrAngle.clear(); - mpCBStacked.clear(); - mpRefEdgeBottom.clear(); - mpRefEdgeTop.clear(); - mpRefEdgeStd.clear(); - mpTextOrientBox.clear(); + mxIndentButtonsDispatch.reset(); + mxIndentButtons.reset(); + mxWriteDirectionDispatch.reset(); + mxWriteDirection.reset(); + mxVertAlignDispatch.reset(); + mxVertAlign.reset(); + mxHorizontalAlignDispatch.reset(); + mxHorizontalAlign.reset(); + + mxFTLeftIndent.reset(); + mxMFLeftIndent.reset(); + mxCBXWrapText.reset(); + mxCBXMergeCell.reset(); + mxFtRotate.reset(); + mxMtrAngle.reset(); + mxCBStacked.reset(); + mxRefEdgeBottom.reset(); + mxRefEdgeTop.reset(); + mxRefEdgeStd.reset(); + mxTextOrientBox.reset(); maAlignHorControl.dispose(); maLeftIndentControl.dispose(); @@ -104,121 +118,83 @@ void AlignmentPropertyPanel::dispose() void AlignmentPropertyPanel::Initialize() { - mpFTLeftIndent->Disable(); - mpMFLeftIndent->Disable(); - Link<Edit&,void> aLink = LINK(this, AlignmentPropertyPanel, MFLeftIndentMdyHdl); - mpMFLeftIndent->SetModifyHdl ( aLink ); + mxFTLeftIndent->set_sensitive(false); + mxMFLeftIndent->set_sensitive(false); + Link<weld::MetricSpinButton&,void> aLink = LINK(this, AlignmentPropertyPanel, MFLeftIndentMdyHdl); + mxMFLeftIndent->connect_value_changed( aLink ); - mpCBXMergeCell->SetClickHdl ( LINK(this, AlignmentPropertyPanel, CBOXMergnCellClkHdl) ); + mxCBXMergeCell->connect_toggled( LINK(this, AlignmentPropertyPanel, CBOXMergnCellClkHdl) ); - mpCBXWrapText->SetClickHdl ( LINK(this, AlignmentPropertyPanel, CBOXWrapTextClkHdl) ); + mxCBXWrapText->connect_toggled( LINK(this, AlignmentPropertyPanel, CBOXWrapTextClkHdl) ); //rotation - mpMtrAngle->SetModifyHdl(LINK( this, AlignmentPropertyPanel, AngleModifiedHdl)); - mpMtrAngle->EnableAutocomplete( false ); - mpCBStacked->SetClickHdl(LINK(this, AlignmentPropertyPanel, ClickStackHdl)); - - Link<Button*,void> aLink2 = LINK(this, AlignmentPropertyPanel, ReferenceEdgeHdl); - mpRefEdgeBottom->SetClickHdl(aLink2); - mpRefEdgeTop->SetClickHdl(aLink2); - mpRefEdgeStd->SetClickHdl(aLink2); - - mpMtrAngle->InsertValue(0, FieldUnit::CUSTOM); - mpMtrAngle->InsertValue(45, FieldUnit::CUSTOM); - mpMtrAngle->InsertValue(90, FieldUnit::CUSTOM); - mpMtrAngle->InsertValue(135, FieldUnit::CUSTOM); - mpMtrAngle->InsertValue(180, FieldUnit::CUSTOM); - mpMtrAngle->InsertValue(225, FieldUnit::CUSTOM); - mpMtrAngle->InsertValue(270, FieldUnit::CUSTOM); - mpMtrAngle->InsertValue(315, FieldUnit::CUSTOM); - mpMtrAngle->SetDropDownLineCount(mpMtrAngle->GetEntryCount()); + mxMtrAngle->connect_value_changed(LINK( this, AlignmentPropertyPanel, AngleModifiedHdl)); + mxCBStacked->connect_toggled(LINK(this, AlignmentPropertyPanel, ClickStackHdl)); + + Link<weld::ToggleButton&,void> aLink2 = LINK(this, AlignmentPropertyPanel, ReferenceEdgeHdl); + mxRefEdgeBottom->connect_toggled(aLink2); + mxRefEdgeTop->connect_toggled(aLink2); + mxRefEdgeStd->connect_toggled(aLink2); } -IMPL_LINK( AlignmentPropertyPanel, ReferenceEdgeHdl, Button*, pControl, void ) +IMPL_LINK(AlignmentPropertyPanel, ReferenceEdgeHdl, weld::ToggleButton&, rToggle, void) { + if (mbSettingToggles) + return; SvxRotateMode eMode; - if(pControl == mpRefEdgeBottom) + if (&rToggle == mxRefEdgeBottom.get() && mxRefEdgeBottom->get_active()) eMode = SVX_ROTATE_MODE_BOTTOM; - else if(pControl == mpRefEdgeTop) + else if (&rToggle == mxRefEdgeTop.get() && mxRefEdgeTop->get_active()) eMode = SVX_ROTATE_MODE_TOP; - else + else if (&rToggle == mxRefEdgeStd.get() && mxRefEdgeStd->get_active()) eMode = SVX_ROTATE_MODE_STANDARD; - SvxRotateModeItem aItem(eMode,ATTR_ROTATE_MODE); + else + return; + SvxRotateModeItem aItem(eMode, ATTR_ROTATE_MODE); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_ALIGN_LOCKPOS, SfxCallMode::RECORD, { &aItem }); } -IMPL_LINK_NOARG( AlignmentPropertyPanel, AngleModifiedHdl, Edit&, void ) +IMPL_LINK_NOARG( AlignmentPropertyPanel, AngleModifiedHdl, weld::MetricSpinButton&, void ) { - OUString sTmp = mpMtrAngle->GetText(); - if (sTmp.isEmpty()) - return; - sal_Unicode nChar = sTmp[0]; - if( nChar == '-' ) - { - if (sTmp.getLength() < 2) - return; - nChar = sTmp[1]; - } - - if( (nChar < '0') || (nChar > '9') ) - return; - - const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); - - // Do not check that the entire string was parsed up to its end, there may - // be a degree symbol following the number. Note that this also means that - // the number recognized just stops at any non-matching character. - /* TODO: we could check for the degree symbol stop if there are no other - * cases with different symbol characters in any language? */ - rtl_math_ConversionStatus eStatus; - double fTmp = rLocaleWrapper.stringToDouble( sTmp, false, &eStatus, nullptr); - if (eStatus != rtl_math_ConversionStatus_Ok) - return; - - FormatDegrees(fTmp); - - sal_Int64 nTmp = static_cast<sal_Int64>(fTmp)*100; - ScRotateValueItem aAngleItem(static_cast<sal_uInt32>(nTmp)); + sal_uInt32 nAngle = mxMtrAngle->get_value(FieldUnit::DEGREE) * 100; + ScRotateValueItem aAngleItem(nAngle); GetBindings()->GetDispatcher()->ExecuteList( SID_ATTR_ALIGN_DEGREES, SfxCallMode::RECORD, { &aAngleItem }); } -IMPL_LINK_NOARG( AlignmentPropertyPanel, ClickStackHdl, Button*, void ) + +IMPL_LINK_NOARG( AlignmentPropertyPanel, ClickStackHdl, weld::ToggleButton&, void ) { - bool bVertical = mpCBStacked->IsChecked(); + bool bVertical = mxCBStacked->get_active(); ScVerticalStackCell aStackItem(bVertical); GetBindings()->GetDispatcher()->ExecuteList( SID_ATTR_ALIGN_STACKED, SfxCallMode::RECORD, { &aStackItem }); } -IMPL_LINK_NOARG(AlignmentPropertyPanel, MFLeftIndentMdyHdl, Edit&, void) + +IMPL_LINK_NOARG(AlignmentPropertyPanel, MFLeftIndentMdyHdl, weld::MetricSpinButton&, void) { - mpCBXWrapText->EnableTriState(false); - sal_uInt16 nVal = static_cast<sal_uInt16>(mpMFLeftIndent->GetValue()); - ScIndentItem aItem(static_cast<sal_uInt16>(CalcToUnit(nVal, MapUnit::MapTwip))); + sal_uInt16 nVal = mxMFLeftIndent->get_value(FieldUnit::NONE); + ScIndentItem aItem(static_cast<sal_uInt16>(CalcToUnit(nVal, MapUnit::MapTwip))); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_ALIGN_INDENT, SfxCallMode::RECORD, { &aItem }); } -IMPL_LINK_NOARG(AlignmentPropertyPanel, CBOXMergnCellClkHdl, Button*, void) +IMPL_LINK_NOARG(AlignmentPropertyPanel, CBOXMergnCellClkHdl, weld::ToggleButton&, void) { - bool bState = mpCBXMergeCell->IsChecked(); + bool bState = mxCBXMergeCell->get_active(); - //Modified - //SfxBoolItem aItem( FID_MERGE_TOGGLE , bState); - //GetBindings()->GetDispatcher()->Execute(FID_MERGE_TOGGLE, SfxCallMode::RECORD, &aItem, false, 0L); - if(bState) + if( bState) GetBindings()->GetDispatcher()->Execute(FID_MERGE_ON, SfxCallMode::RECORD); else GetBindings()->GetDispatcher()->Execute(FID_MERGE_OFF, SfxCallMode::RECORD); GetBindings()->Invalidate(FID_MERGE_TOGGLE,true); - //modified end } -IMPL_LINK_NOARG(AlignmentPropertyPanel, CBOXWrapTextClkHdl, Button*, void) +IMPL_LINK_NOARG(AlignmentPropertyPanel, CBOXWrapTextClkHdl, weld::ToggleButton&, void) { - bool bState = mpCBXWrapText->IsChecked(); + bool bState = mxCBXWrapText->get_active(); ScLineBreakCell aItem(bState); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_ALIGN_LINEBREAK, SfxCallMode::RECORD, { &aItem }); @@ -274,17 +250,17 @@ void AlignmentPropertyPanel::NotifyItemUpdate( if( meHorAlignState == SvxCellHorJustify::Repeat ) { - mpFtRotate->Disable(); - mpMtrAngle->Disable(); + mxFtRotate->set_sensitive(false); + mxMtrAngle->set_sensitive(false); } else { - mpFtRotate->Enable(!mbMultiDisable); - mpMtrAngle->Enable(!mbMultiDisable); + mxFtRotate->set_sensitive(!mbMultiDisable); + mxMtrAngle->set_sensitive(!mbMultiDisable); } - mpFTLeftIndent->Enable( meHorAlignState == SvxCellHorJustify::Left ); - mpMFLeftIndent->Enable( meHorAlignState == SvxCellHorJustify::Left ); + mxFTLeftIndent->set_sensitive( meHorAlignState == SvxCellHorJustify::Left ); + mxMFLeftIndent->set_sensitive( meHorAlignState == SvxCellHorJustify::Left ); } break; case SID_ATTR_ALIGN_INDENT: @@ -292,128 +268,93 @@ void AlignmentPropertyPanel::NotifyItemUpdate( { const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pState); sal_uInt16 nVal = pItem->GetValue(); - mpMFLeftIndent->SetValue( CalcToPoint(nVal, MapUnit::MapTwip, 1) ); + mxMFLeftIndent->set_value( CalcToPoint(nVal, MapUnit::MapTwip, 1), FieldUnit::NONE ); } else { - mpMFLeftIndent->SetValue(0); - mpMFLeftIndent->SetText(OUString()); + mxMFLeftIndent->set_value(0, FieldUnit::NONE); + mxMFLeftIndent->set_text(OUString()); } break; case FID_MERGE_TOGGLE: if(eState >= SfxItemState::DEFAULT && dynamic_cast<const SfxBoolItem*>( pState) ) { - mpCBXMergeCell->Enable(); + mxCBXMergeCell->set_sensitive(true); const SfxBoolItem* pItem = static_cast<const SfxBoolItem*>(pState); - mpCBXMergeCell->Check(pItem->GetValue()); + mxCBXMergeCell->set_active(pItem->GetValue()); } else { - mpCBXMergeCell->Check(false); - mpCBXMergeCell->Disable(); + mxCBXMergeCell->set_active(false); + mxCBXMergeCell->set_sensitive(false); } break; case SID_ATTR_ALIGN_LINEBREAK: if(eState == SfxItemState::DISABLED) { - mpCBXWrapText->EnableTriState(false); - mpCBXWrapText->Check(false); - mpCBXWrapText->Disable(); + mxCBXWrapText->set_active(false); + mxCBXWrapText->set_sensitive(false); } else { - mpCBXWrapText->Enable(); + mxCBXWrapText->set_sensitive(true); if(eState >= SfxItemState::DEFAULT && dynamic_cast<const ScLineBreakCell*>( pState) ) { - mpCBXWrapText->EnableTriState(false); const ScLineBreakCell* pItem = static_cast<const ScLineBreakCell*>(pState); - mpCBXWrapText->Check(pItem->GetValue()); + mxCBXWrapText->set_active(pItem->GetValue()); } else if(eState == SfxItemState::DONTCARE) { - mpCBXWrapText->EnableTriState(); - mpCBXWrapText->SetState(TRISTATE_INDET); + mxCBXWrapText->set_state(TRISTATE_INDET); } } break; case SID_ATTR_ALIGN_STACKED: if (eState >= SfxItemState::DEFAULT) { - mpCBStacked->EnableTriState(false); const SfxBoolItem* pStackItem = static_cast<const ScVerticalStackCell*>(pState); mbMultiDisable = pStackItem->GetValue(); - mpCBStacked->Check(mbMultiDisable); - mpTextOrientBox->Enable(!mbMultiDisable); + mxCBStacked->set_active(mbMultiDisable); + mxTextOrientBox->set_sensitive(!mbMultiDisable); } else { mbMultiDisable = true; - mpTextOrientBox->Disable(); - mpCBStacked->EnableTriState(); - mpCBStacked->SetState(TRISTATE_INDET); + mxTextOrientBox->set_sensitive(false); + mxCBStacked->set_state(TRISTATE_INDET); } break; case SID_ATTR_ALIGN_LOCKPOS: if( eState >= SfxItemState::DEFAULT) { + mbSettingToggles = true; const SvxRotateModeItem* pItem = static_cast<const SvxRotateModeItem*>(pState); SvxRotateMode eMode = pItem->GetValue(); if(eMode == SVX_ROTATE_MODE_BOTTOM) { - mpRefEdgeBottom->SetState(true); - mpRefEdgeTop->SetState(false); - mpRefEdgeStd->SetState(false); + mxRefEdgeBottom->set_state(TRISTATE_TRUE); } else if(eMode == SVX_ROTATE_MODE_TOP) { - mpRefEdgeBottom->SetState(false); - mpRefEdgeStd->SetState(false); - mpRefEdgeTop->SetState(true); + mxRefEdgeTop->set_state(TRISTATE_TRUE); } else if(eMode == SVX_ROTATE_MODE_STANDARD) { - mpRefEdgeBottom->SetState(false); - mpRefEdgeTop->SetState(false); - mpRefEdgeStd->SetState(true); + mxRefEdgeStd->set_state(TRISTATE_TRUE); } + mbSettingToggles = false; } break; case SID_ATTR_ALIGN_DEGREES: if (eState >= SfxItemState::DEFAULT) { long nTmp = static_cast<const ScRotateValueItem*>(pState)->GetValue(); - mpMtrAngle->SetValue( nTmp / 100); //wj - switch(nTmp) - { - case 0: - mpMtrAngle->SelectEntryPos(0); - break; - case 4500: - mpMtrAngle->SelectEntryPos(1); - break; - case 9000: - mpMtrAngle->SelectEntryPos(2); - break; - case 13500: - mpMtrAngle->SelectEntryPos(3); - break; - case 18000: - mpMtrAngle->SelectEntryPos(4); - break; - case 22500: - mpMtrAngle->SelectEntryPos(5); - break; - case 27000: - mpMtrAngle->SelectEntryPos(6); - break; - case 31500: - mpMtrAngle->SelectEntryPos(7); - } + mxMtrAngle->set_value(nTmp / 100, FieldUnit::DEGREE); } else { - mpMtrAngle->SetText( OUString() ); + mxMtrAngle->set_text( OUString() ); } break; } diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx index 71c8d7efafd4..5087fdda7814 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx @@ -21,11 +21,8 @@ #include <sfx2/sidebar/ControllerItem.hxx> #include <sfx2/sidebar/IContextChangeReceiver.hxx> +#include <sfx2/weldutils.hxx> #include <svx/sidebar/PanelLayout.hxx> -#include <vcl/fixed.hxx> -#include <vcl/button.hxx> -#include <vcl/layout.hxx> -#include <vcl/field.hxx> namespace sc { namespace sidebar { @@ -63,17 +60,29 @@ public: private: //ui controls - VclPtr<FixedText> mpFTLeftIndent; - VclPtr<MetricField> mpMFLeftIndent; - VclPtr<CheckBox> mpCBXWrapText; - VclPtr<CheckBox> mpCBXMergeCell; - VclPtr<FixedText> mpFtRotate; - VclPtr<MetricBox> mpMtrAngle; - VclPtr<RadioButton> mpRefEdgeBottom; - VclPtr<RadioButton> mpRefEdgeTop; - VclPtr<RadioButton> mpRefEdgeStd; - VclPtr<CheckBox> mpCBStacked; - VclPtr<VclHBox> mpTextOrientBox; + std::unique_ptr<weld::Label> mxFTLeftIndent; + std::unique_ptr<weld::MetricSpinButton> mxMFLeftIndent; + std::unique_ptr<weld::CheckButton> mxCBXWrapText; + std::unique_ptr<weld::CheckButton> mxCBXMergeCell; + std::unique_ptr<weld::Label> mxFtRotate; + std::unique_ptr<weld::MetricSpinButton> mxMtrAngle; + std::unique_ptr<weld::RadioButton> mxRefEdgeBottom; + std::unique_ptr<weld::RadioButton> mxRefEdgeTop; + std::unique_ptr<weld::RadioButton> mxRefEdgeStd; + std::unique_ptr<weld::CheckButton> mxCBStacked; + std::unique_ptr<weld::Widget> mxTextOrientBox; + + std::unique_ptr<weld::Toolbar> mxHorizontalAlign; + std::unique_ptr<ToolbarUnoDispatcher> mxHorizontalAlignDispatch; + + std::unique_ptr<weld::Toolbar> mxVertAlign; + std::unique_ptr<ToolbarUnoDispatcher> mxVertAlignDispatch; + + std::unique_ptr<weld::Toolbar> mxWriteDirection; + std::unique_ptr<ToolbarUnoDispatcher> mxWriteDirectionDispatch; + + std::unique_ptr<weld::Toolbar> mxIndentButtons; + std::unique_ptr<ToolbarUnoDispatcher> mxIndentButtonsDispatch; ::sfx2::sidebar::ControllerItem maAlignHorControl; ::sfx2::sidebar::ControllerItem maLeftIndentControl; @@ -84,16 +93,17 @@ private: ::sfx2::sidebar::ControllerItem maRefEdgeControl; bool mbMultiDisable : 1; + bool mbSettingToggles : 1; vcl::EnumContext maContext; SfxBindings* const mpBindings; - DECL_LINK( MFLeftIndentMdyHdl, Edit&, void ); - DECL_LINK( CBOXMergnCellClkHdl, Button*, void ); - DECL_LINK( CBOXWrapTextClkHdl, Button*, void ); - DECL_LINK( AngleModifiedHdl, Edit&, void ); - DECL_LINK( ClickStackHdl, Button*, void ); - DECL_LINK( ReferenceEdgeHdl, Button*, void ); + DECL_LINK( MFLeftIndentMdyHdl, weld::MetricSpinButton&, void ); + DECL_LINK( CBOXMergnCellClkHdl, weld::ToggleButton&, void ); + DECL_LINK( CBOXWrapTextClkHdl, weld::ToggleButton&, void ); + DECL_LINK( AngleModifiedHdl, weld::MetricSpinButton&, void ); + DECL_LINK( ClickStackHdl, weld::ToggleButton&, void ); + DECL_LINK( ReferenceEdgeHdl, weld::ToggleButton&, void ); void Initialize(); static void FormatDegrees(double& dTmp); diff --git a/sc/uiconfig/scalc/ui/sidebaralignment.ui b/sc/uiconfig/scalc/ui/sidebaralignment.ui index e1107325eb12..808bc2633776 100644 --- a/sc/uiconfig/scalc/ui/sidebaralignment.ui +++ b/sc/uiconfig/scalc/ui/sidebaralignment.ui @@ -1,22 +1,30 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sc"> <requires lib="gtk+" version="3.18"/> - <requires lib="LibreOffice" version="1.0"/> + <object class="GtkAdjustment" id="adjustmentIndent"> + <property name="upper">990</property> + <property name="step_increment">10</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustmentSpinDegrees"> + <property name="upper">359</property> + <property name="step_increment">5</property> + </object> <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="pixbuf">svx/res/lo03.png</property> + <property name="icon_name">svx/res/lo03.png</property> </object> <object class="GtkImage" id="image2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="pixbuf">svx/res/lo02.png</property> + <property name="icon_name">svx/res/lo02.png</property> </object> <object class="GtkImage" id="image3"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="pixbuf">svx/res/lo01.png</property> + <property name="icon_name">svx/res/lo01.png</property> </object> <object class="GtkGrid" id="AlignmentPropertyPanel"> <property name="visible">True</property> @@ -36,60 +44,58 @@ <property name="can_focus">False</property> <property name="spacing">6</property> <child> - <object class="sfxlo-SidebarToolBox" id="horizontalalignment"> + <object class="GtkToolbar" id="horizontalalignment"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_tooltip">True</property> <property name="tooltip_text" translatable="yes" context="sidebaralignment|horizontalalignment|tooltip_text">Horizontal Alignment</property> <property name="halign">start</property> + <property name="toolbar_style">icons</property> <property name="show_arrow">False</property> + <property name="icon_size">2</property> <child> - <object class="GtkToolButton" id="substleft"> + <object class="GtkToggleToolButton" id=".uno:AlignLeft"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="action_name">.uno:AlignLeft</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> <child> - <object class="GtkToolButton" id="substcenter"> + <object class="GtkToggleToolButton" id=".uno:AlignHorizontalCenter"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="action_name">.uno:AlignHorizontalCenter</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> <child> - <object class="GtkToolButton" id="substright"> + <object class="GtkToggleToolButton" id=".uno:AlignRight"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="action_name">.uno:AlignRight</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> <child> - <object class="GtkToolButton" id="substjustify"> + <object class="GtkToggleToolButton" id=".uno:AlignBlock"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="action_name">.uno:AlignBlock</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> </object> @@ -100,46 +106,45 @@ </packing> </child> <child> - <object class="sfxlo-SidebarToolBox" id="verticalalignment"> + <object class="GtkToolbar" id="verticalalignment"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="tooltip_text" translatable="yes" context="sidebaralignment|verticalalignment|tooltip_text">Vertical Alignment</property> <property name="halign">end</property> + <property name="toolbar_style">icons</property> <property name="show_arrow">False</property> + <property name="icon_size">2</property> <child> - <object class="GtkToolButton" id="verttop"> + <object class="GtkToggleToolButton" id=".uno:AlignTop"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="action_name">.uno:AlignTop</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> <child> - <object class="GtkToolButton" id="vertcenter"> + <object class="GtkToggleToolButton" id=".uno:AlignVCenter"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="action_name">.uno:AlignVCenter</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> <child> - <object class="GtkToolButton" id="vertbottom"> + <object class="GtkToggleToolButton" id=".uno:AlignBottom"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="action_name">.uno:AlignBottom</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> </object> @@ -151,34 +156,34 @@ </packing> </child> <child> - <object class="sfxlo-SidebarToolBox" id="writedirection"> + <object class="GtkToolbar" id="writedirection"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="toolbar_style">icons</property> <property name="show_arrow">False</property> + <property name="icon_size">2</property> <child> - <object class="GtkToolButton" id="lefttoright"> + <object class="GtkToggleToolButton" id=".uno:ParaLeftToRight"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="is_important">True</property> - <property name="action_name">.uno:ParaLeftToRight</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> <child> - <object class="GtkToolButton" id="righttoleft"> + <object class="GtkToggleToolButton" id=".uno:ParaRightToLeft"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="is_important">True</property> - <property name="action_name">.uno:ParaRightToLeft</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> </object> @@ -213,34 +218,34 @@ <property name="can_focus">False</property> <property name="column_spacing">6</property> <child> - <object class="sfxlo-SidebarToolBox" id="indentbuttons"> + <object class="GtkToolbar" id="indentbuttons"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="toolbar_style">icons</property> <property name="show_arrow">False</property> + <property name="icon_size">2</property> <child> - <object class="GtkToolButton" id="incrementindent"> + <object class="GtkToolButton" id=".uno:IncrementIndent"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="is_important">True</property> - <property name="action_name">.uno:IncrementIndent</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> <child> - <object class="GtkToolButton" id="decrementindent"> + <object class="GtkToolButton" id=".uno:DecrementIndent"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="is_important">True</property> - <property name="action_name">.uno:DecrementIndent</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> </packing> </child> </object> @@ -255,7 +260,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="sidebaralignment|leftindentlabel">_Indent:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">leftindent:0pt</property> + <property name="mnemonic_widget">leftindent</property> <property name="xalign">0</property> </object> <packing> @@ -271,16 +276,14 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="leftindent:0pt"> + <object class="GtkSpinButton" id="leftindent"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_tooltip">True</property> <property name="tooltip_text" translatable="yes" context="sidebaralignment|leftindent|tooltip_text">Indents from the left edge.</property> - <accessibility> - <relation type="labelled-by" target="leftindentlabel"/> - </accessibility> + <property name="adjustment">adjustmentIndent</property> <child internal-child="accessible"> - <object class="AtkObject" id="leftindent:0pt-atkobject"> + <object class="AtkObject" id="leftindent-atkobject"> <property name="AtkObject::accessible-name" translatable="yes" context="sidebaralignment|leftindent-atkobject">Left Indent</property> </object> </child> @@ -310,10 +313,10 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="use_underline">True</property> <property name="has_tooltip">True</property> <property name="tooltip_text" translatable="yes" context="sidebaralignment|mergecells|tooltip_text">Joins the selected cells into one.</property> <property name="halign">start</property> + <property name="use_underline">True</property> <property name="xalign">0</property> <property name="image_position">right</property> <property name="draw_indicator">True</property> @@ -330,10 +333,10 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="use_underline">True</property> <property name="has_tooltip">True</property> <property name="tooltip_text" translatable="yes" context="sidebaralignment|wraptext|tooltip_text">Wrap texts automatically.</property> <property name="halign">start</property> + <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> </object> @@ -369,6 +372,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="sidebaralignment|orientationlabel">Text _orientation:</property> <property name="use_underline">True</property> + <property name="mnemonic_widget">orientationdegrees</property> <property name="xalign">0</property> </object> <packing> @@ -378,16 +382,15 @@ </packing> </child> <child> - <object class="VclComboBoxNumeric" id="orientationdegrees:0degrees"> + <object class="GtkSpinButton" id="orientationdegrees"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_tooltip">True</property> <property name="tooltip_text" translatable="yes" context="sidebaralignment|orientationdegrees|tooltip_text">Select the angle for rotation.</property> - <accessibility> - <relation type="labelled-by" target="orientationlabel"/> - </accessibility> + <property name="adjustment">adjustmentSpinDegrees</property> + <property name="wrap">True</property> <child internal-child="accessible"> - <object class="AtkObject" id="orientationdegrees:0degrees-atkobject"> + <object class="AtkObject" id="orientationdegrees-atkobject"> <property name="AtkObject::accessible-name" translatable="yes" context="sidebaralignment|orientationdegrees-atkobject">Text Orientation</property> </object> </child> @@ -409,12 +412,13 @@ <property name="can_focus">True</property> <property name="focus_on_click">False</property> <property name="receives_default">False</property> - <property name="use_underline">True</property> <property name="tooltip_text" translatable="yes" context="sidebaralignment|bottom|tooltip_text">Text Extension From Lower Cell Border</property> <property name="image">image3</property> + <property name="use_underline">True</property> <property name="xalign">0</property> <property name="always_show_image">True</property> <property name="draw_indicator">False</property> + <property name="group">standard</property> </object> <packing> <property name="expand">False</property> @@ -428,12 +432,13 @@ <property name="can_focus">True</property> <property name="focus_on_click">False</property> <property name="receives_default">False</property> - <property name="use_underline">True</property> <property name="tooltip_text" translatable="yes" context="sidebaralignment|top|tooltip_text">Text Extension From Upper Cell Border</property> <property name="image">image2</property> + <property name="use_underline">True</property> <property name="xalign">0</property> <property name="always_show_image">True</property> <property name="draw_indicator">False</property> + <property name="group">standard</property> </object> <packing> <property name="expand">False</property> @@ -447,11 +452,12 @@ <property name="can_focus">True</property> <property name="focus_on_click">False</property> <property name="receives_default">False</property> - <property name="use_underline">True</property> <property name="tooltip_text" translatable="yes" context="sidebaralignment|standard|tooltip_text">Text Extension Inside Cell</property> <property name="image">image1</property> + <property name="use_underline">True</property> <property name="xalign">0</property> <property name="always_show_image">True</property> + <property name="active">True</property> <property name="draw_indicator">False</property> </object> <packing> diff --git a/solenv/sanitizers/ui/modules/scalc.suppr b/solenv/sanitizers/ui/modules/scalc.suppr index 41587fb489c4..bc40f73a89a3 100644 --- a/solenv/sanitizers/ui/modules/scalc.suppr +++ b/solenv/sanitizers/ui/modules/scalc.suppr @@ -186,10 +186,6 @@ sc/uiconfig/scalc/ui/scenariodialog.ui://GtkLabel[@id='onft'] orphan-label sc/uiconfig/scalc/ui/searchresults.ui://GtkLabel[@id='lbSearchResults'] orphan-label sc/uiconfig/scalc/ui/sharedocumentdlg.ui://GtkLabel[@id='warning'] orphan-label sc/uiconfig/scalc/ui/showchangesdialog.ui://GtkEntry[@id='range'] no-labelled-by -sc/uiconfig/scalc/ui/sidebaralignment.ui://GtkSpinButton[@id='leftindent:0pt'] missing-label-for -sc/uiconfig/scalc/ui/sidebaralignment.ui://GtkSpinButton[@id='leftindent:0pt'] labelled-by-and-mnemonic -sc/uiconfig/scalc/ui/sidebaralignment.ui://GtkLabel[@id='orientationlabel'] orphan-label -sc/uiconfig/scalc/ui/sidebaralignment.ui://VclComboBoxNumeric[@id='orientationdegrees:0degrees'] missing-label-for sc/uiconfig/scalc/ui/solverdlg.ui://GtkLabel[@id='targetlabel'] orphan-label sc/uiconfig/scalc/ui/solverdlg.ui://GtkLabel[@id='result'] orphan-label sc/uiconfig/scalc/ui/solverdlg.ui://GtkLabel[@id='changelabel'] orphan-label diff --git a/svtools/source/uno/generictoolboxcontroller.cxx b/svtools/source/uno/generictoolboxcontroller.cxx index e126ec8b68a1..570805632b53 100644 --- a/svtools/source/uno/generictoolboxcontroller.cxx +++ b/svtools/source/uno/generictoolboxcontroller.cxx @@ -192,12 +192,14 @@ void GenericToolboxController::statusChanged( const FeatureStateEvent& Event ) if ( Event.State >>= bValue ) { // Boolean, treat it as checked/unchecked - m_pToolbox->set_item_active( sId, bValue ); + m_pToolbox->set_item_active(sId, bValue); } else if ( Event.State >>= aStrValue ) { - m_pToolbox->set_item_label( sId, aStrValue ); + m_pToolbox->set_item_label(sId, aStrValue); } + else + m_pToolbox->set_item_active(sId, false); } } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 05e0b89efad0..1f9815839f24 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -7144,7 +7144,9 @@ public: else { GtkToolButton* pToolButton = m_aMap.find(rIdent)->second; - gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(pToolButton), bActive); + assert(GTK_IS_TOGGLE_TOOL_BUTTON(pToolButton) || !bActive); + if (GTK_IS_TOGGLE_TOOL_BUTTON(pToolButton)) + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(pToolButton), bActive); } enable_item_notify_events(); |