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>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -139,6 +139,7 @@ cui/uiconfig/ui/paragalignpage.ui://GtkLabel[@id='labelST_LEFTALIGN_ASIAN'] orph
|
||||
cui/uiconfig/ui/paraindentspacing.ui://GtkLabel[@id='labelST_LINEDIST_ABS'] orphan-label
|
||||
cui/uiconfig/ui/paraindentspacing.ui://GtkComboBoxText[@id='comboLB_LINEDIST'] no-labelled-by
|
||||
cui/uiconfig/ui/paraindentspacing.ui://GtkLabel[@id='labelFT_LINEDIST'] orphan-label
|
||||
cui/uiconfig/ui/paraindentspacing.ui://GtkSpinButton[@id='spinED_BLANK'] no-labelled-by
|
||||
cui/uiconfig/ui/paraindentspacing.ui://GtkSpinButton[@id='spinED_LINEDISTPERCENT'] no-labelled-by
|
||||
cui/uiconfig/ui/paraindentspacing.ui://GtkSpinButton[@id='spinED_LINEDISTMETRIC'] no-labelled-by
|
||||
cui/uiconfig/ui/password.ui://GtkLabel[@id='label1'] orphan-label
|
||||
|
||||
Reference in New Issue
Block a user