diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2023-10-01 11:28:31 +0200 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2023-10-02 10:21:26 +0200 |
commit | 25d09bdb9f48313c000cc8ec8df60b1bb8efe2e6 (patch) | |
tree | 94a3781ede3e1f7a288f68d83adf5aa75f119e72 | |
parent | 0083083c8cd269446d0f2955ffe2f17bbc3bf22b (diff) |
tdf#87638 - Modify slide pane title in Impress/Draw based on edit mode
Change-Id: I0dd668324c32172144f29cf40c52e2b66e7895b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157444
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
-rw-r--r-- | sd/inc/strings.hrc | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/titledockwin.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/inc/titledockwin.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews1.cxx | 21 |
4 files changed, 31 insertions, 0 deletions
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc index 8438a9262a95..e3f5c45a5fcd 100644 --- a/sd/inc/strings.hrc +++ b/sd/inc/strings.hrc @@ -234,7 +234,9 @@ #define STR_PLACEHOLDER_DESCRIPTION_NOTES NC_("STR_PLACEHOLDER_DESCRIPTION_NOTES", "Notes Area") #define STR_UNDO_HANGULHANJACONVERSION NC_("STR_UNDO_HANGULHANJACONVERSION", "Hangul/Hanja Conversion") #define STR_LEFT_PANE_IMPRESS_TITLE NC_("STR_LEFT_PANE_IMPRESS_TITLE", "Slides") +#define STR_LEFT_PANE_IMPRESS_TITLE_MASTER NC_("STR_LEFT_PANE_IMPRESS_TITLE_MASTER", "Master Slides") #define STR_LEFT_PANE_DRAW_TITLE NC_("STR_LEFT_PANE_DRAW_TITLE", "Pages") +#define STR_LEFT_PANE_DRAW_TITLE_MASTER NC_("STR_LEFT_PANE_DRAW_TITLE_MASTER", "Master Pages") #define STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION NC_("STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION", "Preview not available") #define STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION NC_("STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION", "Preparing preview") #define STR_TASKPANEL_LAYOUT_MENU_TITLE NC_("STR_TASKPANEL_LAYOUT_MENU_TITLE", "Layouts") diff --git a/sd/source/ui/dlg/titledockwin.cxx b/sd/source/ui/dlg/titledockwin.cxx index 0550f05d2f8b..d545170da688 100644 --- a/sd/source/ui/dlg/titledockwin.cxx +++ b/sd/source/ui/dlg/titledockwin.cxx @@ -68,6 +68,12 @@ namespace sd SfxDockingWindow::dispose(); } + void TitledDockingWindow::SetTitle(const OUString& i_rText) + { + m_sTitle = i_rText; + Invalidate(); + } + void TitledDockingWindow::SetText( const OUString& i_rText ) { SfxDockingWindow::SetText( i_rText ); diff --git a/sd/source/ui/inc/titledockwin.hxx b/sd/source/ui/inc/titledockwin.hxx index bdbd386ba62a..5a880e268739 100644 --- a/sd/source/ui/inc/titledockwin.hxx +++ b/sd/source/ui/inc/titledockwin.hxx @@ -76,6 +76,8 @@ namespace sd */ Orientation GetOrientation() const; + void SetTitle(const OUString& i_rText); + private: // Window overridables virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& i_rArea) override; diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index f9378e1ec4fd..309a5d5ed3cc 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -71,6 +71,9 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <vcl/uitest/logger.hxx> #include <vcl/uitest/eventdescription.hxx> +#include <titledockwin.hxx> +#include <strings.hrc> +#include <sdresid.hxx> using namespace com::sun::star; @@ -393,6 +396,16 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) ConfigureAppBackgroundColor(); + // tdf#87638 - change slide pane title according to the edit mode + auto setLeftPaneTitleIfPaneExists + = [pViewShell = GetViewFrame()](sal_uInt16 nId, TranslateId aId) + { + if (auto* pChildWindow = pViewShell->GetChildWindow(nId)) + if (auto* pTitledDockingWindow + = static_cast<TitledDockingWindow*>(pChildWindow->GetWindow())) + pTitledDockingWindow->SetTitle(SdResId(aId)); + }; + if (meEditMode == EditMode::Page) { /****************************************************************** @@ -401,6 +414,10 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) maTabControl->Clear(); + // tdf#87638 - change slide pane title according to the edit mode + setLeftPaneTitleIfPaneExists(SID_LEFT_PANE_DRAW, STR_LEFT_PANE_DRAW_TITLE); + setLeftPaneTitleIfPaneExists(SID_LEFT_PANE_IMPRESS, STR_LEFT_PANE_IMPRESS_TITLE); + SdPage* pPage; sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind); @@ -431,6 +448,10 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) GetViewFrame()->SetChildWindow( AnimationChildWindow::GetChildWindowId(), false ); + // tdf#87638 - change slide pane title according to the edit mode + setLeftPaneTitleIfPaneExists(SID_LEFT_PANE_DRAW, STR_LEFT_PANE_DRAW_TITLE_MASTER); + setLeftPaneTitleIfPaneExists(SID_LEFT_PANE_IMPRESS, STR_LEFT_PANE_IMPRESS_TITLE_MASTER); + if (comphelper::LibreOfficeKit::isActive()) GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, ".uno:SlideMasterPage=true"); |