diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-04-24 15:10:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-04-25 10:05:51 +0200 |
commit | bff4282e1c0c7c1f32b93cf5175a721c8226d5de (patch) | |
tree | 9371d3a7ce2a82c96cdce7b5421d72a05c5f50e8 /cui | |
parent | b3d6c521c1e1fc6a1e84940c19cb2e18157e877f (diff) |
Resolves: tdf#154958 add an empty spin button to use for the unused case
instead of reusing the percentage one, which will set its min value
under gtk
Change-Id: I342f8f0588574c45c5752964b95232e419f752ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150943
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/paragrph.hxx | 1 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 24 | ||||
-rw-r--r-- | cui/uiconfig/ui/paraindentspacing.ui | 22 |
3 files changed, 36 insertions, 11 deletions
diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index 688602f122dc..2b6f26fd25d8 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -69,6 +69,7 @@ private: std::unique_ptr<weld::ComboBox> m_xLineDist; std::unique_ptr<weld::MetricSpinButton> m_xLineDistAtPercentBox; std::unique_ptr<weld::MetricSpinButton> m_xLineDistAtMetricBox; + std::unique_ptr<weld::MetricSpinButton> m_xLineDistAtPlaceHolderBox; std::unique_ptr<weld::Label> m_xLineDistAtLabel; std::unique_ptr<weld::Label> m_xAbsDist; diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index a873f0f8a584..8a3b443cae42 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -899,6 +899,7 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage(weld::Container* pPage, weld::Dia , m_xLineDist(m_xBuilder->weld_combo_box("comboLB_LINEDIST")) , m_xLineDistAtPercentBox(m_xBuilder->weld_metric_spin_button("spinED_LINEDISTPERCENT", FieldUnit::PERCENT)) , m_xLineDistAtMetricBox(m_xBuilder->weld_metric_spin_button("spinED_LINEDISTMETRIC", FieldUnit::CM)) + , m_xLineDistAtPlaceHolderBox(m_xBuilder->weld_metric_spin_button("spinED_BLANK", FieldUnit::CM)) , m_xLineDistAtLabel(m_xBuilder->weld_label("labelFT_LINEDIST")) , m_xAbsDist(m_xBuilder->weld_label("labelST_LINEDIST_ABS")) , m_xRegisterCB(m_xBuilder->weld_check_button("checkCB_REGISTER")) @@ -910,6 +911,8 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage(weld::Container* pPage, weld::Dia SetExchangeSupport(); m_xLineDistAtMetricBox->hide(); + m_xLineDistAtPlaceHolderBox->hide(); + m_xLineDistAtPlaceHolderBox->set_text(OUString()); Init_Impl(); m_aFLineIndent.set_min(-9999, FieldUnit::NONE); // is set to 0 on default @@ -1013,10 +1016,9 @@ IMPL_LINK(SvxStdParagraphTabPage, LineDistHdl_Impl, weld::ComboBox&, rBox, void) case LLINESPACE_15: case LLINESPACE_2: m_xLineDistAtLabel->set_sensitive(false); - m_xLineDistAtPercentBox->set_sensitive(false); - m_xLineDistAtPercentBox->set_text(OUString()); - m_xLineDistAtMetricBox->set_sensitive(false); - m_xLineDistAtMetricBox->set_text(OUString()); + m_xLineDistAtPercentBox->hide(); + m_xLineDistAtMetricBox->hide(); + m_xLineDistAtPlaceHolderBox->show(); break; case LLINESPACE_DURCH: @@ -1024,32 +1026,32 @@ IMPL_LINK(SvxStdParagraphTabPage, LineDistHdl_Impl, weld::ComboBox&, rBox, void) // limit MS min(10, aPageSize) m_xLineDistAtMetricBox->set_min(0, FieldUnit::NONE); - if (m_xLineDistAtMetricBox->get_text().isEmpty()) + if (m_xLineDistAtPlaceHolderBox->get_visible()) m_xLineDistAtMetricBox->set_value(m_xLineDistAtMetricBox->normalize(1), FieldUnit::NONE); + m_xLineDistAtPlaceHolderBox->hide(); m_xLineDistAtPercentBox->hide(); m_xLineDistAtMetricBox->show(); - m_xLineDistAtMetricBox->set_sensitive(true); m_xLineDistAtLabel->set_sensitive(true); break; case LLINESPACE_MIN: m_xLineDistAtMetricBox->set_min(0, FieldUnit::NONE); - if (m_xLineDistAtMetricBox->get_text().isEmpty()) + if (m_xLineDistAtPlaceHolderBox->get_visible()) m_xLineDistAtMetricBox->set_value(m_xLineDistAtMetricBox->normalize(10), FieldUnit::TWIP); + m_xLineDistAtPlaceHolderBox->hide(); m_xLineDistAtPercentBox->hide(); m_xLineDistAtMetricBox->show(); - m_xLineDistAtMetricBox->set_sensitive(true); m_xLineDistAtLabel->set_sensitive(true); break; case LLINESPACE_PROP: - if (m_xLineDistAtPercentBox->get_text().isEmpty()) + if (m_xLineDistAtPlaceHolderBox->get_visible()) m_xLineDistAtPercentBox->set_value(m_xLineDistAtPercentBox->normalize(100), FieldUnit::TWIP); + m_xLineDistAtPlaceHolderBox->hide(); m_xLineDistAtMetricBox->hide(); m_xLineDistAtPercentBox->show(); - m_xLineDistAtPercentBox->set_sensitive(true); m_xLineDistAtLabel->set_sensitive(true); break; case LLINESPACE_FIX: @@ -1061,9 +1063,9 @@ IMPL_LINK(SvxStdParagraphTabPage, LineDistHdl_Impl, weld::ComboBox&, rBox, void) // it is time for the default if (m_xLineDistAtMetricBox->get_value(FieldUnit::NONE) != nTemp) SetMetricValue( *m_xLineDistAtMetricBox, FIX_DIST_DEF, MapUnit::MapTwip ); // fix is only in Writer + m_xLineDistAtPlaceHolderBox->hide(); m_xLineDistAtPercentBox->hide(); m_xLineDistAtMetricBox->show(); - m_xLineDistAtMetricBox->set_sensitive(true); m_xLineDistAtLabel->set_sensitive(true); } break; diff --git a/cui/uiconfig/ui/paraindentspacing.ui b/cui/uiconfig/ui/paraindentspacing.ui index f58d24ae0de2..a11482a8b58a 100644 --- a/cui/uiconfig/ui/paraindentspacing.ui +++ b/cui/uiconfig/ui/paraindentspacing.ui @@ -2,6 +2,11 @@ <!-- Generated with glade 3.40.0 --> <interface domain="cui"> <requires lib="gtk+" version="3.20"/> + <object class="GtkAdjustment" id="adjustment1"> + <property name="upper">100</property> + <property name="step-increment">1</property> + <property name="page-increment">10</property> + </object> <object class="GtkAdjustment" id="adjustmentED_DIST"> <property name="upper">9999</property> <property name="step-increment">1</property> @@ -442,6 +447,22 @@ <property name="position">1</property> </packing> </child> + <child> + <object class="GtkSpinButton" id="spinED_BLANK"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">True</property> + <property name="activates-default">True</property> + <property name="truncate-multiline">True</property> + <property name="adjustment">adjustment1</property> + <property name="digits">1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> <packing> <property name="left-attach">1</property> @@ -520,6 +541,7 @@ <widget name="spinED_BOTTOMDIST"/> <widget name="spinED_LINEDISTPERCENT"/> <widget name="spinED_LINEDISTMETRIC"/> + <widget name="spinED_BLANK"/> </widgets> </object> </interface> |