Kaydet (Commit) 4c656c82 authored tarafından Tamás Zolnai's avatar Tamás Zolnai

tdf#111835: Hide Master slide / close master slide button in notes view

These buttons are designed for normal and master slide view.

Change-Id: Ifc093a1da7e2336a1a83332e893dbc619519aaba
Reviewed-on: https://gerrit.libreoffice.org/44635Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst d945bc45
...@@ -121,6 +121,7 @@ SlideBackground::SlideBackground( ...@@ -121,6 +121,7 @@ SlideBackground::SlideBackground(
maImpressOtherContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::DrawPage), maImpressOtherContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::DrawPage),
maImpressMasterContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::MasterPage), maImpressMasterContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::MasterPage),
maImpressHandoutContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::HandoutPage), maImpressHandoutContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::HandoutPage),
maImpressNotesContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::NotesPage),
mbTitle(false), mbTitle(false),
mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) ), mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) ),
mpPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ) ), mpPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ) ),
...@@ -182,7 +183,8 @@ bool SlideBackground::IsImpress() ...@@ -182,7 +183,8 @@ bool SlideBackground::IsImpress()
{ {
return ( maContext == maImpressMasterContext || return ( maContext == maImpressMasterContext ||
maContext == maImpressOtherContext || maContext == maImpressOtherContext ||
maContext == maImpressHandoutContext ); maContext == maImpressHandoutContext ||
maContext == maImpressNotesContext );
} }
void SlideBackground::Initialize() void SlideBackground::Initialize()
...@@ -253,16 +255,16 @@ void SlideBackground::HandleContextChange( ...@@ -253,16 +255,16 @@ void SlideBackground::HandleContextChange(
} }
else if ( maContext == maImpressHandoutContext ) else if ( maContext == maImpressHandoutContext )
{ {
mpCloseMaster->Hide();
mpEditMaster->Hide();
mpMasterSlide->Disable();
mpDspMasterBackground->Disable();
mpDspMasterObjects->Disable();
mpFillStyle->Hide(); mpFillStyle->Hide();
mpFillLB->Hide();
mpFillAttr->Hide();
mpFillGrad->Hide();
mpBackgroundLabel->Hide(); mpBackgroundLabel->Hide();
mpInsertImage->Hide(); mpInsertImage->Hide();
mpEditMaster->Hide();
mpCloseMaster->Hide();
} }
else if (maContext == maImpressOtherContext ) else if (maContext == maImpressOtherContext)
{ {
mpCloseMaster->Hide(); mpCloseMaster->Hide();
mpEditMaster->Show(); mpEditMaster->Show();
...@@ -273,6 +275,17 @@ void SlideBackground::HandleContextChange( ...@@ -273,6 +275,17 @@ void SlideBackground::HandleContextChange(
mpBackgroundLabel->Show(); mpBackgroundLabel->Show();
mpInsertImage->Show(); mpInsertImage->Show();
} }
else if (maContext == maImpressNotesContext)
{
mpCloseMaster->Hide();
mpEditMaster->Hide();
mpMasterSlide->Disable();
mpDspMasterBackground->Disable();
mpDspMasterObjects->Disable();
mpFillStyle->Show();
mpBackgroundLabel->Show();
mpInsertImage->Hide();
}
// Need to do a relayouting, otherwise the panel size is not updated after show / hide controls // Need to do a relayouting, otherwise the panel size is not updated after show / hide controls
sfx2::sidebar::Panel* pPanel = dynamic_cast<sfx2::sidebar::Panel*>(GetParent()); sfx2::sidebar::Panel* pPanel = dynamic_cast<sfx2::sidebar::Panel*>(GetParent());
if(pPanel) if(pPanel)
...@@ -286,7 +299,10 @@ void SlideBackground::HandleContextChange( ...@@ -286,7 +299,10 @@ void SlideBackground::HandleContextChange(
void SlideBackground::Update() void SlideBackground::Update()
{ {
const eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectedEntryPos(); eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectedEntryPos();
if(maContext == maImpressHandoutContext)
nPos = NONE;
SfxObjectShell* pSh = SfxObjectShell::Current(); SfxObjectShell* pSh = SfxObjectShell::Current();
if (!pSh) if (!pSh)
...@@ -305,8 +321,6 @@ void SlideBackground::Update() ...@@ -305,8 +321,6 @@ void SlideBackground::Update()
{ {
mpFillAttr->Hide(); mpFillAttr->Hide();
mpFillGrad->Hide(); mpFillGrad->Hide();
if (maContext != maImpressHandoutContext)
mpFillLB->Show();
const Color aColor = GetColorSetOrDefault(); const Color aColor = GetColorSetOrDefault();
mpFillLB->SelectEntry(aColor); mpFillLB->SelectEntry(aColor);
} }
...@@ -541,6 +555,20 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener, ...@@ -541,6 +555,20 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener,
else else
SetPanelTitle(SdResId(STR_SLIDE_NAME)); SetPanelTitle(SdResId(STR_SLIDE_NAME));
} }
else if ( maContext == maImpressNotesContext )
{
mpMasterLabel->SetText(SdResId(STR_MASTERSLIDE_NAME));
ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
if (pMainViewShell)
{
DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
if ( pDrawViewShell->GetEditMode() == EditMode::MasterPage)
SetPanelTitle(SdResId(STR_MASTERSLIDE_NAME));
else // EditMode::Page
SetPanelTitle(SdResId(STR_SLIDE_NAME));
}
}
mbTitle = true; mbTitle = true;
} }
} }
......
...@@ -128,6 +128,7 @@ private: ...@@ -128,6 +128,7 @@ private:
vcl::EnumContext maImpressOtherContext; vcl::EnumContext maImpressOtherContext;
vcl::EnumContext maImpressMasterContext; vcl::EnumContext maImpressMasterContext;
vcl::EnumContext maImpressHandoutContext; vcl::EnumContext maImpressHandoutContext;
vcl::EnumContext maImpressNotesContext;
bool mbTitle; bool mbTitle;
std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem; std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem; std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem;
......
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