Kaydet (Commit) 1191ed85 authored tarafından Philippe Jung's avatar Philippe Jung Kaydeden (comit) Yousuf Philips

tdf#87822 Impress: hide common task toolbar in master view

When Master Slide or Master Notes are active,
hides the Common task toolbar as it it not usefull.

Change-Id: Ice07661bf203c029d733614e1eceb5ef3d0661f9
Reviewed-on: https://gerrit.libreoffice.org/16060Reviewed-by: 's avatarYousuf Philips <philipz85@hotmail.com>
Tested-by: 's avatarYousuf Philips <philipz85@hotmail.com>
üst 77df4faa
...@@ -126,6 +126,7 @@ public: ...@@ -126,6 +126,7 @@ public:
TBG_PERMANENT = TBG__FIRST, TBG_PERMANENT = TBG__FIRST,
TBG_FUNCTION, TBG_FUNCTION,
TBG_COMMON_TASK,
TBG_MASTER_MODE, TBG_MASTER_MODE,
TBG__LAST = TBG_MASTER_MODE TBG__LAST = TBG_MASTER_MODE
......
...@@ -999,9 +999,6 @@ void ToolBarRules::MainViewShellChanged (ViewShell::ShellType nShellType) ...@@ -999,9 +999,6 @@ void ToolBarRules::MainViewShellChanged (ViewShell::ShellType nShellType)
mpToolBarManager->AddToolBar( mpToolBarManager->AddToolBar(
ToolBarManager::TBG_PERMANENT, ToolBarManager::TBG_PERMANENT,
ToolBarManager::msOptionsToolBar); ToolBarManager::msOptionsToolBar);
mpToolBarManager->AddToolBar(
ToolBarManager::TBG_PERMANENT,
ToolBarManager::msCommonTaskToolBar);
mpToolBarManager->AddToolBar( mpToolBarManager->AddToolBar(
ToolBarManager::TBG_PERMANENT, ToolBarManager::TBG_PERMANENT,
ToolBarManager::msViewerToolBar); ToolBarManager::msViewerToolBar);
...@@ -1065,10 +1062,16 @@ void ToolBarRules::MainViewShellChanged (const ViewShell& rMainViewShell) ...@@ -1065,10 +1062,16 @@ void ToolBarRules::MainViewShellChanged (const ViewShell& rMainViewShell)
const DrawViewShell* pDrawViewShell const DrawViewShell* pDrawViewShell
= dynamic_cast<const DrawViewShell*>(&rMainViewShell); = dynamic_cast<const DrawViewShell*>(&rMainViewShell);
if (pDrawViewShell != NULL) if (pDrawViewShell != NULL)
{
if (pDrawViewShell->GetEditMode() == EM_MASTERPAGE) if (pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
mpToolBarManager->AddToolBar( mpToolBarManager->AddToolBar(
ToolBarManager::TBG_MASTER_MODE, ToolBarManager::TBG_MASTER_MODE,
ToolBarManager::msMasterViewToolBar); ToolBarManager::msMasterViewToolBar);
else
mpToolBarManager->AddToolBar(
ToolBarManager::TBG_COMMON_TASK,
ToolBarManager::msCommonTaskToolBar);
}
break; break;
} }
......
...@@ -363,14 +363,18 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) ...@@ -363,14 +363,18 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
// view. // view.
bool bShowMasterViewToolbar (meEditMode == EM_MASTERPAGE bool bShowMasterViewToolbar (meEditMode == EM_MASTERPAGE
&& GetShellType() != ViewShell::ST_HANDOUT); && GetShellType() != ViewShell::ST_HANDOUT);
bool bShowPresentationToolbar (meEditMode != EM_MASTERPAGE
&& GetShellType() != ViewShell::ST_HANDOUT);
// If the master view toolbar is not shown we hide it before // If the master view toolbar is not shown we hide it before
// switching the edit mode. // switching the edit mode.
if (::sd::ViewShell::mpImpl->mbIsInitialized if (::sd::ViewShell::mpImpl->mbIsInitialized
&& IsMainViewShell() && IsMainViewShell())
&& ! bShowMasterViewToolbar)
{ {
GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_MASTER_MODE); if ( !bShowMasterViewToolbar )
GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_MASTER_MODE);
if ( !bShowPresentationToolbar )
GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_COMMON_TASK);
} }
if (meEditMode == EM_PAGE) if (meEditMode == EM_PAGE)
...@@ -441,12 +445,16 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) ...@@ -441,12 +445,16 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
// If the master view toolbar is to be shown we turn it on after the // If the master view toolbar is to be shown we turn it on after the
// edit mode has been changed. // edit mode has been changed.
if (::sd::ViewShell::mpImpl->mbIsInitialized if (::sd::ViewShell::mpImpl->mbIsInitialized
&& IsMainViewShell() && IsMainViewShell())
&& bShowMasterViewToolbar)
{ {
GetViewShellBase().GetToolBarManager()->SetToolBar( if (bShowMasterViewToolbar)
ToolBarManager::TBG_MASTER_MODE, GetViewShellBase().GetToolBarManager()->SetToolBar(
ToolBarManager::msMasterViewToolBar); ToolBarManager::TBG_MASTER_MODE,
ToolBarManager::msMasterViewToolBar);
if (bShowPresentationToolbar)
GetViewShellBase().GetToolBarManager()->SetToolBar(
ToolBarManager::TBG_COMMON_TASK,
ToolBarManager::msCommonTaskToolBar);
} }
if ( ! mbIsLayerModeActive) if ( ! mbIsLayerModeActive)
......
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