summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-03-16 20:10:18 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-03-25 09:49:33 +0100
commit56d8007a197b095b09423c691a51515567648e80 (patch)
tree63ce068e98e368587e57e5e686dc09a27bd9ec74 /cui
parent473f2dec087288309cb169bf84c12124e1d7d7d1 (diff)
tdf#134734 tdf#141059 tdf#122508 cui,sw,xmloff: BackgroundFullSize
* add BackgroundFullSize property to PageProperties * add a checkbox on the SvxPageDescPage * marshal the item via SfxGrabBagItem to avoid changing svxids.hrc * add RES_BACKGROUND_FULL_SIZE item, pool default is "true" which is appropriate for Word import filters * ODF export: remove hard-coded export in XMLPageMasterExportPropMapper::ContextFilter() * use it in SwFrame::PaintSwFrameBackground() * fix painting of bitmaps by also using the page frame area in SwFrame::GetBackgroundBrush(), which was the reason why f006b6339e20af6a3fbd60d97d21590d4ebf5021 painted things inconsistently * force repaint in lcl_DescSetAttr()/SwFrame::UpdateAttrFrame() Change-Id: I4cb64f87c01d17c051936e9b8128395fbb8b4fe5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112594 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/page.hxx1
-rw-r--r--cui/source/tabpages/page.cxx16
-rw-r--r--cui/uiconfig/ui/pageformatpage.ui20
3 files changed, 37 insertions, 0 deletions
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx
index 1a2e8fb506c4..1d92d275d3a1 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_xBackgroundFullSizeCB;
std::unique_ptr<weld::Label> m_xInsideLbl;
std::unique_ptr<weld::Label> m_xOutsideLbl;
std::unique_ptr<weld::Label> m_xPrintRangeQueryText;
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index cc3cbcff0bb2..53dfe1e5cb5d 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_xBackgroundFullSizeCB(m_xBuilder->weld_check_button("checkBackgroundFullSize"))
// Strings stored in UI
, m_xInsideLbl(m_xBuilder->weld_label("labelInner"))
, m_xOutsideLbl(m_xBuilder->weld_label("labelOuter"))
@@ -382,6 +383,14 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
// Left.
m_xGutterPositionLB->set_active(0);
}
+ it = rGrabBagItem.GetGrabBag().find("BackgroundFullSize");
+ bool isBackgroundFullSize{};
+ if (it != rGrabBagItem.GetGrabBag().end())
+ {
+ it->second >>= isBackgroundFullSize;
+ m_xBackgroundFullSizeCB->set_active(isBackgroundFullSize);
+ m_xBackgroundFullSizeCB->show();
+ }
}
// general page data
@@ -563,6 +572,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
m_xHorzBox->save_state();
m_xAdaptBox->save_state();
m_xGutterPositionLB->save_value();
+ m_xBackgroundFullSizeCB->save_state();
CheckMarginEdits( true );
@@ -659,6 +669,12 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
aGrabBagItem.GetGrabBag()["GutterAtTop"] <<= bGutterAtTop;
bModified = true;
}
+ if (m_xBackgroundFullSizeCB->get_state_changed_from_saved())
+ {
+ bool const isBackgroundFullSize(m_xBackgroundFullSizeCB->get_active());
+ aGrabBagItem.GetGrabBag()["BackgroundFullSize"] <<= isBackgroundFullSize;
+ bModified = true;
+ }
if (bModified)
{
diff --git a/cui/uiconfig/ui/pageformatpage.ui b/cui/uiconfig/ui/pageformatpage.ui
index e7aa3f01f6e0..9332ebb0a204 100644
--- a/cui/uiconfig/ui/pageformatpage.ui
+++ b/cui/uiconfig/ui/pageformatpage.ui
@@ -706,6 +706,26 @@
<child>
<placeholder/>
</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>
+ <property name="receives_default">False</property>
+ <property name="no_show_all">True</property>
+ <property name="tooltip_text" translatable="yes" context="pageformatpage|checkBackgroundFullSize" comments="xdds">Any background will cover margins of the page as well</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="checkBackgroundFullSize-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|checkBackgroundFullSize">If enabled, then any background will cover the entire page, including margins. If disabled, any background will cover the page only inside the margins.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">8</property>
+ </packing>
+ </child>
</object>
</child>
<child type="label">