From 6758db065d77bdebed54e5d3532796a2c3c24088 Mon Sep 17 00:00:00 2001 From: blendergeek Date: Tue, 5 Sep 2017 17:12:21 -0400 Subject: tdf#111834: hide useless background controls in Handout View MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia51c671f17dbb8cc36a73ee662c1c57e23e7818f Reviewed-on: https://gerrit.libreoffice.org/41968 Reviewed-by: Tamás Zolnai Tested-by: Tamás Zolnai --- sd/source/ui/sidebar/SlideBackground.cxx | 26 ++++++++++++++++++++++++-- sd/source/ui/sidebar/SlideBackground.hxx | 3 +++ 2 files changed, 27 insertions(+), 2 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 070b8e0119e8..447386de9e27 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -139,6 +139,7 @@ SlideBackground::SlideBackground( maDrawMasterContext(vcl::EnumContext::Application::Draw, vcl::EnumContext::Context::MasterPage), maImpressOtherContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::DrawPage), maImpressMasterContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::MasterPage), + maImpressHandoutContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::HandoutPage), mbTitle(false), meFieldUnit(lcl_GetFieldUnit()), m_nPageLeftMargin(0), @@ -153,10 +154,12 @@ SlideBackground::SlideBackground( //let the listbox shrink to any size so the sidebar isn't forced to grow to //the size of the longest master slide name in the document mpMasterSlide->set_width_request(0); + get(mpBackgroundLabel, "label3"); get(mpFillAttr, "fillattr1"); get(mpFillGrad, "fillattr2"); get(mpFillStyle, "fillstyle"); get(mpFillLB, "fillattr"); + get(mpInsertImage, "button2"); get(mpDspMasterBackground, "displaymasterbackground"); get(mpDspMasterObjects, "displaymasterobjects"); get(mpCloseMaster, "closemasterslide"); @@ -194,7 +197,8 @@ SlideBackground::~SlideBackground() bool SlideBackground::IsImpress() { return ( maContext == maImpressMasterContext || - maContext == maImpressOtherContext ); + maContext == maImpressOtherContext || + maContext == maImpressHandoutContext ); } void SlideBackground::Initialize() @@ -256,6 +260,18 @@ void SlideBackground::HandleContextChange( mpMasterSlide->Disable(); mpDspMasterBackground->Disable(); mpDspMasterObjects->Disable(); + mpFillStyle->Show(); + mpBackgroundLabel->Show(); + mpInsertImage->Show(); + } + else if ( maContext == maImpressHandoutContext ) + { + mpFillStyle->Hide(); + mpFillLB->Hide(); + mpFillAttr->Hide(); + mpFillGrad->Hide(); + mpBackgroundLabel->Hide(); + mpInsertImage->Hide(); } else if (maContext == maImpressOtherContext ) { @@ -264,6 +280,9 @@ void SlideBackground::HandleContextChange( mpMasterSlide->Enable(); mpDspMasterBackground->Enable(); mpDspMasterObjects->Enable(); + mpFillStyle->Show(); + mpBackgroundLabel->Show(); + mpInsertImage->Show(); } // else Draw or something else, do nothing } @@ -289,7 +308,8 @@ void SlideBackground::Update() { mpFillAttr->Hide(); mpFillGrad->Hide(); - mpFillLB->Show(); + if (maContext != maImpressHandoutContext) + mpFillLB->Show(); const Color aColor = GetColorSetOrDefault(); mpFillLB->SelectEntry(aColor); } @@ -520,10 +540,12 @@ void SlideBackground::dispose() mpPaperSizeBox.clear(); mpPaperOrientation.clear(); mpMasterSlide.clear(); + mpBackgroundLabel.clear(); mpFillAttr.clear(); mpFillGrad.clear(); mpFillStyle.clear(); mpFillLB.clear(); + mpInsertImage.clear(); mpDspMasterBackground.clear(); mpDspMasterObjects.clear(); mpMasterLabel.clear(); diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx index d8e871c0ef62..4463f233b80b 100644 --- a/sd/source/ui/sidebar/SlideBackground.hxx +++ b/sd/source/ui/sidebar/SlideBackground.hxx @@ -84,10 +84,12 @@ private: VclPtr mpPaperSizeBox; VclPtr mpPaperOrientation; VclPtr mpMasterSlide; + VclPtr mpBackgroundLabel; VclPtr mpFillStyle; VclPtr mpFillLB; VclPtr mpFillAttr; VclPtr mpFillGrad; + VclPtr