diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-04-01 10:09:45 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-04-01 12:42:53 +0200 |
commit | d48a4174708ce0850577dba76dccaf85c4f6ffa1 (patch) | |
tree | 70d7e7ec4ed2df41bbd1688236dfd1999a17f733 /cui | |
parent | a66653805782df67431c462bf8f890a154066cf0 (diff) |
tdf#140343 sw page rtl gutter margin: add UI
And extend SwFrame::UpdateAttrFrame() so that the layout is updated when
the UI mutates the doc model.
Change-Id: I4112388981187226f97ec39f4c44ffb3cc1e5253
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113440
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/page.hxx | 1 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 16 | ||||
-rw-r--r-- | cui/uiconfig/ui/pageformatpage.ui | 16 |
3 files changed, 32 insertions, 1 deletions
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index 1d92d275d3a1..e3c5aa4ed268 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -125,6 +125,7 @@ private: std::unique_ptr<weld::ComboBox> m_xRegisterLB; std::unique_ptr<weld::Label> m_xGutterPositionFT; std::unique_ptr<weld::ComboBox> m_xGutterPositionLB; + std::unique_ptr<weld::CheckButton> m_xRtlGutterCB; std::unique_ptr<weld::CheckButton> m_xBackgroundFullSizeCB; std::unique_ptr<weld::Label> m_xInsideLbl; std::unique_ptr<weld::Label> m_xOutsideLbl; diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 53dfe1e5cb5d..729aef82bbfd 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -179,6 +179,7 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController* , m_xRegisterLB(m_xBuilder->weld_combo_box("comboRegisterStyle")) , m_xGutterPositionFT(m_xBuilder->weld_label("labelGutterPosition")) , m_xGutterPositionLB(m_xBuilder->weld_combo_box("comboGutterPosition")) + , m_xRtlGutterCB(m_xBuilder->weld_check_button("checkRtlGutter")) , m_xBackgroundFullSizeCB(m_xBuilder->weld_check_button("checkBackgroundFullSize")) // Strings stored in UI , m_xInsideLbl(m_xBuilder->weld_label("labelInner")) @@ -383,6 +384,14 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) // Left. m_xGutterPositionLB->set_active(0); } + it = rGrabBagItem.GetGrabBag().find("RtlGutter"); + bool bRtlGutter{}; + if (it != rGrabBagItem.GetGrabBag().end()) + { + it->second >>= bRtlGutter; + m_xRtlGutterCB->set_active(bRtlGutter); + m_xRtlGutterCB->show(); + } it = rGrabBagItem.GetGrabBag().find("BackgroundFullSize"); bool isBackgroundFullSize{}; if (it != rGrabBagItem.GetGrabBag().end()) @@ -572,6 +581,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) m_xHorzBox->save_state(); m_xAdaptBox->save_state(); m_xGutterPositionLB->save_value(); + m_xRtlGutterCB->save_state(); m_xBackgroundFullSizeCB->save_state(); CheckMarginEdits( true ); @@ -669,6 +679,12 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet ) aGrabBagItem.GetGrabBag()["GutterAtTop"] <<= bGutterAtTop; bModified = true; } + if (m_xRtlGutterCB->get_state_changed_from_saved()) + { + bool const bRtlGutter(m_xRtlGutterCB->get_active()); + aGrabBagItem.GetGrabBag()["RtlGutter"] <<= bRtlGutter; + bModified = true; + } if (m_xBackgroundFullSizeCB->get_state_changed_from_saved()) { bool const isBackgroundFullSize(m_xBackgroundFullSizeCB->get_active()); diff --git a/cui/uiconfig/ui/pageformatpage.ui b/cui/uiconfig/ui/pageformatpage.ui index b6974eebc15d..3a28c29409a5 100644 --- a/cui/uiconfig/ui/pageformatpage.ui +++ b/cui/uiconfig/ui/pageformatpage.ui @@ -707,6 +707,20 @@ <placeholder/> </child> <child> + <object class="GtkCheckButton" id="checkRtlGutter"> + <property name="label" translatable="yes" context="pageformatpage|checkRtlGutter">Gutter on right side of page</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="no_show_all">True</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">8</property> + </packing> + </child> + <child> <object class="GtkCheckButton" id="checkBackgroundFullSize"> <property name="label" translatable="yes" context="pageformatpage|checkBackgroundFullSize">Background covers margins</property> <property name="can_focus">True</property> @@ -723,7 +737,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">8</property> + <property name="top_attach">9</property> </packing> </child> </object> |