Kaydet (Commit) 7b39e822 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld OfaAutoFmtPrcntSet

Change-Id: Ib7c63c75e6b7b8cef0405d22d81658483dc9778b
Reviewed-on: https://gerrit.libreoffice.org/52769Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 2eef6fd6
......@@ -302,21 +302,19 @@ struct ImpUserData
/* */
/*********************************************************************/
class OfaAutoFmtPrcntSet : public ModalDialog
class OfaAutoFmtPrcntSet : public weld::GenericDialogController
{
VclPtr<MetricField> m_pPrcntMF;
std::unique_ptr<weld::MetricSpinButton> m_xPrcntMF;
public:
explicit OfaAutoFmtPrcntSet(vcl::Window* pParent)
: ModalDialog(pParent, "PercentDialog","cui/ui/percentdialog.ui")
explicit OfaAutoFmtPrcntSet(weld::Window* pParent)
: GenericDialogController(pParent, "cui/ui/percentdialog.ui", "PercentDialog")
, m_xPrcntMF(m_xBuilder->weld_metric_spin_button("margin", FUNIT_PERCENT))
{
get(m_pPrcntMF, "margin");
}
virtual ~OfaAutoFmtPrcntSet() override { disposeOnce(); }
virtual void dispose() override { m_pPrcntMF.clear(); ModalDialog::dispose(); }
MetricField& GetPrcntFld()
weld::MetricSpinButton& GetPrcntFld()
{
return *m_pPrcntMF;
return *m_xPrcntMF;
}
};
......@@ -744,11 +742,11 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl, Button*, void)
else if( MERGE_SINGLE_LINE_PARA == nSelEntryPos )
{
// dialog for per cent settings
ScopedVclPtrInstance< OfaAutoFmtPrcntSet > aDlg(this);
aDlg->GetPrcntFld().SetValue(nPercent);
if(RET_OK == aDlg->Execute())
OfaAutoFmtPrcntSet aDlg(GetFrameWeld());
aDlg.GetPrcntFld().set_value(nPercent, FUNIT_PERCENT);
if (aDlg.run() == RET_OK)
{
nPercent = static_cast<sal_uInt16>(aDlg->GetPrcntFld().GetValue());
nPercent = static_cast<sal_uInt16>(aDlg.GetPrcntFld().get_value(FUNIT_PERCENT));
sMargin = " " +
unicode::formatPercent(nPercent, Application::GetSettings().GetUILanguageTag());
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.4 -->
<interface domain="cui">
<!-- interface-requires gtk+ 3.0 -->
<requires lib="gtk+" version="3.0"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="value">77</property>
......@@ -11,6 +12,9 @@
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="percentdialog|PercentDialog">Combine</property>
<property name="modal">True</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
......@@ -76,11 +80,12 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkSpinButton" id="margin:0%">
<object class="GtkSpinButton" id="margin">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment1</property>
</object>
</child>
......@@ -109,5 +114,8 @@
<action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
</action-widgets>
<child>
<placeholder/>
</child>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment