Kaydet (Commit) 87084436 authored tarafından Philippe Jung's avatar Philippe Jung Kaydeden (comit) Katarina Behrens

tdf#97119 Make TabBarVisible configuration persistant

Now the TabBarVisible status persist between LO quit/relaunch. It is also taking into accoutn when opening a (existing/new) presentation.
Fixes the incorrect toolbar button status
Moves the two buttons on Standard bar, in the PageSetup/SlideMasterPage group.
ShowTabBar button is also enabled but not selected by default.

Change-Id: Idd9ab15efebc2bf43bc827afaa1eb1457b39deec
Reviewed-on: https://gerrit.libreoffice.org/21541Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst ff163f16
...@@ -559,6 +559,16 @@ ...@@ -559,6 +559,16 @@
</info> </info>
<value>150</value> <value>150</value>
</prop> </prop>
<prop oor:name="TabBarVisible" oor:type="xs:boolean" oor:nillable="false">
<!-- OldPath: -->
<!-- OldLocation: -->
<!-- UIHints: is the TabBar visible on top of the slide panel -->
<info>
<desc>Indicates whether the tab bar should be visible on top of the slide panel.</desc>
<label>Tab bar is visible</label>
</info>
<value>false</value>
</prop>
<group oor:name="TextObject"> <group oor:name="TextObject">
<info> <info>
<desc>Contains text editing related configuration items.</desc> <desc>Contains text editing related configuration items.</desc>
......
...@@ -428,6 +428,7 @@ SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, bool bUseConfig ) : ...@@ -428,6 +428,7 @@ SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, bool bUseConfig ) :
bEnablePresenterScreen( true), bEnablePresenterScreen( true),
bSolidDragging( true ), bSolidDragging( true ),
bSummationOfParagraphs( false ), bSummationOfParagraphs( false ),
bTabBarVisible( true ),
bShowUndoDeleteWarning( true ), bShowUndoDeleteWarning( true ),
bSlideshowRespectZOrder( true ), bSlideshowRespectZOrder( true ),
bShowComments( true ), bShowComments( true ),
...@@ -460,6 +461,7 @@ bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const ...@@ -460,6 +461,7 @@ bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const
IsEnableSdremote() == rOpt.IsEnableSdremote() && IsEnableSdremote() == rOpt.IsEnableSdremote() &&
IsEnablePresenterScreen() == rOpt.IsEnablePresenterScreen()&& IsEnablePresenterScreen() == rOpt.IsEnablePresenterScreen()&&
IsSummationOfParagraphs() == rOpt.IsSummationOfParagraphs() && IsSummationOfParagraphs() == rOpt.IsSummationOfParagraphs() &&
IsTabBarVisible() == rOpt.IsTabBarVisible() &&
IsSolidDragging() == rOpt.IsSolidDragging() && IsSolidDragging() == rOpt.IsSolidDragging() &&
IsShowUndoDeleteWarning() == rOpt.IsShowUndoDeleteWarning() && IsShowUndoDeleteWarning() == rOpt.IsShowUndoDeleteWarning() &&
IsSlideshowRespectZOrder() == rOpt.IsSlideshowRespectZOrder() && IsSlideshowRespectZOrder() == rOpt.IsSlideshowRespectZOrder() &&
...@@ -513,7 +515,8 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) ...@@ -513,7 +515,8 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, sal_uLong& rCount )
"PenColor", "PenColor",
"PenWidth", "PenWidth",
"Start/EnableSdremote", "Start/EnableSdremote",
"Start/EnablePresenterScreen" "Start/EnablePresenterScreen",
"TabBarVisible"
}; };
rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? SAL_N_ELEMENTS(aPropNames) : 14 ); rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? SAL_N_ELEMENTS(aPropNames) : 14 );
...@@ -574,6 +577,10 @@ bool SdOptionsMisc::ReadData( const Any* pValues ) ...@@ -574,6 +577,10 @@ bool SdOptionsMisc::ReadData( const Any* pValues )
if( pValues[25].hasValue() ) if( pValues[25].hasValue() )
SetEnablePresenterScreen( *static_cast<sal_Bool const *>(pValues[ 25 ].getValue()) ); SetEnablePresenterScreen( *static_cast<sal_Bool const *>(pValues[ 25 ].getValue()) );
if( pValues[26].hasValue() ) {
SetTabBarVisible( *static_cast<sal_Bool const *>(pValues[ 26 ].getValue()) );
}
} }
return true; return true;
...@@ -615,6 +622,7 @@ bool SdOptionsMisc::WriteData( Any* pValues ) const ...@@ -615,6 +622,7 @@ bool SdOptionsMisc::WriteData( Any* pValues ) const
pValues[ 23 ] <<= GetPresentationPenWidth(); pValues[ 23 ] <<= GetPresentationPenWidth();
pValues[ 24 ] <<= IsEnableSdremote(); pValues[ 24 ] <<= IsEnableSdremote();
pValues[ 25 ] <<= IsEnablePresenterScreen(); pValues[ 25 ] <<= IsEnablePresenterScreen();
pValues[ 26 ] <<= IsTabBarVisible();
} }
return true; return true;
...@@ -642,6 +650,7 @@ SdOptionsMiscItem::SdOptionsMiscItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd ...@@ -642,6 +650,7 @@ SdOptionsMiscItem::SdOptionsMiscItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd
maOptionsMisc.SetEnableSdremote( pOpts->IsEnableSdremote() ); maOptionsMisc.SetEnableSdremote( pOpts->IsEnableSdremote() );
maOptionsMisc.SetEnablePresenterScreen( pOpts->IsEnablePresenterScreen() ); maOptionsMisc.SetEnablePresenterScreen( pOpts->IsEnablePresenterScreen() );
maOptionsMisc.SetSummationOfParagraphs( pOpts->IsSummationOfParagraphs() ); maOptionsMisc.SetSummationOfParagraphs( pOpts->IsSummationOfParagraphs() );
maOptionsMisc.SetTabBarVisible( pOpts->IsTabBarVisible() );
maOptionsMisc.SetShowUndoDeleteWarning( pOpts->IsShowUndoDeleteWarning() ); maOptionsMisc.SetShowUndoDeleteWarning( pOpts->IsShowUndoDeleteWarning() );
maOptionsMisc.SetPrinterIndependentLayout( pOpts->GetPrinterIndependentLayout() ); maOptionsMisc.SetPrinterIndependentLayout( pOpts->GetPrinterIndependentLayout() );
maOptionsMisc.SetDefaultObjectSizeWidth( pOpts->GetDefaultObjectSizeWidth() ); maOptionsMisc.SetDefaultObjectSizeWidth( pOpts->GetDefaultObjectSizeWidth() );
...@@ -718,6 +727,8 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const ...@@ -718,6 +727,8 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const
pOpts->SetEnableSdremote( maOptionsMisc.IsEnableSdremote() ); pOpts->SetEnableSdremote( maOptionsMisc.IsEnableSdremote() );
pOpts->SetEnablePresenterScreen( maOptionsMisc.IsEnablePresenterScreen() ); pOpts->SetEnablePresenterScreen( maOptionsMisc.IsEnablePresenterScreen() );
pOpts->SetSummationOfParagraphs( maOptionsMisc.IsSummationOfParagraphs() ); pOpts->SetSummationOfParagraphs( maOptionsMisc.IsSummationOfParagraphs() );
pOpts->SetTabBarVisible( maOptionsMisc.IsTabBarVisible() );
pOpts->SetSolidDragging( maOptionsMisc.IsSolidDragging() ); pOpts->SetSolidDragging( maOptionsMisc.IsSolidDragging() );
pOpts->SetShowUndoDeleteWarning( maOptionsMisc.IsShowUndoDeleteWarning() ); pOpts->SetShowUndoDeleteWarning( maOptionsMisc.IsShowUndoDeleteWarning() );
pOpts->SetPrinterIndependentLayout( maOptionsMisc.GetPrinterIndependentLayout() ); pOpts->SetPrinterIndependentLayout( maOptionsMisc.GetPrinterIndependentLayout() );
......
...@@ -207,6 +207,7 @@ private: ...@@ -207,6 +207,7 @@ private:
bool bEnablePresenterScreen : 1; // Misc/Start/EnablePresenterDisplay bool bEnablePresenterScreen : 1; // Misc/Start/EnablePresenterDisplay
bool bSolidDragging : 1; // Misc/ModifyWithAttributes bool bSolidDragging : 1; // Misc/ModifyWithAttributes
bool bSummationOfParagraphs : 1; // misc/SummationOfParagraphs bool bSummationOfParagraphs : 1; // misc/SummationOfParagraphs
bool bTabBarVisible : 1; // Misc/TabBarVisible
bool bShowUndoDeleteWarning : 1; // Misc/ShowUndoDeleteWarning bool bShowUndoDeleteWarning : 1; // Misc/ShowUndoDeleteWarning
// #i75315# // #i75315#
bool bSlideshowRespectZOrder : 1; // Misc/SlideshowRespectZOrder bool bSlideshowRespectZOrder : 1; // Misc/SlideshowRespectZOrder
...@@ -216,6 +217,7 @@ private: ...@@ -216,6 +217,7 @@ private:
bool bPreviewChangedEffects; bool bPreviewChangedEffects;
bool bPreviewTransitions; bool bPreviewTransitions;
sal_Int32 mnDisplay; sal_Int32 mnDisplay;
sal_Int32 mnPenColor; sal_Int32 mnPenColor;
...@@ -256,6 +258,7 @@ public: ...@@ -256,6 +258,7 @@ public:
bool IsEnablePresenterScreen() const { Init(); return bEnablePresenterScreen; } bool IsEnablePresenterScreen() const { Init(); return bEnablePresenterScreen; }
bool IsSolidDragging() const { Init(); return bSolidDragging; } bool IsSolidDragging() const { Init(); return bSolidDragging; }
bool IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs; }; bool IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs; };
bool IsTabBarVisible() const { Init(); return bTabBarVisible; };
/** Return the currently selected printer independent layout mode. /** Return the currently selected printer independent layout mode.
@return @return
...@@ -294,6 +297,7 @@ public: ...@@ -294,6 +297,7 @@ public:
void SetEnableSdremote( bool bOn = true ) { if( bEnableSdremote != bOn ) { OptionsChanged(); bEnableSdremote = bOn; } } void SetEnableSdremote( bool bOn = true ) { if( bEnableSdremote != bOn ) { OptionsChanged(); bEnableSdremote = bOn; } }
void SetEnablePresenterScreen( bool bOn = true ) { if( bEnablePresenterScreen != bOn ) { OptionsChanged(); bEnablePresenterScreen = bOn; } } void SetEnablePresenterScreen( bool bOn = true ) { if( bEnablePresenterScreen != bOn ) { OptionsChanged(); bEnablePresenterScreen = bOn; } }
void SetSummationOfParagraphs( bool bOn = true ){ if ( bOn != bSummationOfParagraphs ) { OptionsChanged(); bSummationOfParagraphs = bOn; } } void SetSummationOfParagraphs( bool bOn = true ){ if ( bOn != bSummationOfParagraphs ) { OptionsChanged(); bSummationOfParagraphs = bOn; } }
void SetTabBarVisible( bool bOn = true ){ if ( bOn != bTabBarVisible ) { OptionsChanged(); bTabBarVisible = bOn; } }
/** Set the printer independent layout mode. /** Set the printer independent layout mode.
@param nOn @param nOn
The default value is to switch printer independent layout on, The default value is to switch printer independent layout on,
......
...@@ -59,6 +59,8 @@ ...@@ -59,6 +59,8 @@
#include "Window.hxx" #include "Window.hxx"
#include "framework/ConfigurationController.hxx" #include "framework/ConfigurationController.hxx"
#include "DocumentRenderer.hxx" #include "DocumentRenderer.hxx"
#include "sdattr.hxx"
#include "optsitem.hxx"
#include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/awt/XWindow.hpp>
...@@ -367,8 +369,10 @@ void ViewShellBase::LateInit (const OUString& rsDefaultView) ...@@ -367,8 +369,10 @@ void ViewShellBase::LateInit (const OUString& rsDefaultView)
if (pFrameView != nullptr) if (pFrameView != nullptr)
pFrameView->SetViewShellTypeOnLoad(pViewShell->GetShellType()); pFrameView->SetViewShellTypeOnLoad(pViewShell->GetShellType());
} }
// Hide the TabBar // Show/Hide the TabBar
mpImpl->SetUserWantsTabBar(false); SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDocument()->GetDocumentType());
bool bIsTabBarVisible = pOptions->IsTabBarVisible();
mpImpl->SetUserWantsTabBar( bIsTabBarVisible );
} }
std::shared_ptr<ViewShellManager> ViewShellBase::GetViewShellManager() const std::shared_ptr<ViewShellManager> ViewShellBase::GetViewShellManager() const
...@@ -636,9 +640,14 @@ void ViewShellBase::Execute (SfxRequest& rRequest) ...@@ -636,9 +640,14 @@ void ViewShellBase::Execute (SfxRequest& rRequest)
break; break;
case SID_TOGGLE_TABBAR_VISIBILITY: case SID_TOGGLE_TABBAR_VISIBILITY:
mpImpl->SetUserWantsTabBar(!mpImpl->GetUserWantsTabBar()); {
SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDocument()->GetDocumentType());
bool bIsTabBarVisible = pOptions->IsTabBarVisible();
pOptions->SetTabBarVisible( !bIsTabBarVisible );
mpImpl->SetUserWantsTabBar( !bIsTabBarVisible );
rRequest.Done(); rRequest.Done();
break; }
break;
// draw // draw
case SID_DRAWINGMODE: case SID_DRAWINGMODE:
...@@ -1305,9 +1314,6 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet) ...@@ -1305,9 +1314,6 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet)
{ {
} }
// Determine the state for the resource.
bState = xConfiguration->hasResource(xResourceId);
// Take the master page mode into account. // Take the master page mode into account.
switch (nItemId) switch (nItemId)
{ {
......
...@@ -41,9 +41,6 @@ ...@@ -41,9 +41,6 @@
<toolbar:toolbaritem xlink:href=".uno:Undo"/> <toolbar:toolbaritem xlink:href=".uno:Undo"/>
<toolbar:toolbaritem xlink:href=".uno:Redo"/> <toolbar:toolbaritem xlink:href=".uno:Redo"/>
<toolbar:toolbarseparator/> <toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:DisplayMode"/>
<toolbar:toolbaritem xlink:href=".uno:ToggleTabBarVisibility" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/>
<toolbar:toolbaritem xlink:href=".uno:SpellDialog"/> <toolbar:toolbaritem xlink:href=".uno:SpellDialog"/>
<toolbar:toolbaritem xlink:href=".uno:SpellOnline" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:SpellOnline" toolbar:visible="false"/>
...@@ -65,6 +62,8 @@ ...@@ -65,6 +62,8 @@
<toolbar:toolbaritem xlink:href=".uno:AnimationEffects"/> <toolbar:toolbaritem xlink:href=".uno:AnimationEffects"/>
<toolbar:toolbaritem xlink:href=".uno:InsertDraw"/> <toolbar:toolbaritem xlink:href=".uno:InsertDraw"/>
<toolbar:toolbarseparator/> <toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:DisplayMode"/>
<toolbar:toolbaritem xlink:href=".uno:ToggleTabBarVisibility"/>
<toolbar:toolbaritem xlink:href=".uno:PageSetup"/> <toolbar:toolbaritem xlink:href=".uno:PageSetup"/>
<toolbar:toolbaritem xlink:href=".uno:SlideMasterPage"/> <toolbar:toolbaritem xlink:href=".uno:SlideMasterPage"/>
<toolbar:toolbarseparator/> <toolbar:toolbarseparator/>
......
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