sd/inc/strings.hrc | 10 ++++++++++ sd/source/ui/dlg/NavigatorChildWindow.cxx | 15 +++++++++++++++ sd/source/ui/dlg/navigatr.cxx | 21 +++++++++++++++++++++ sd/source/ui/inc/navigatr.hxx | 1 + sd/source/ui/sidebar/NavigatorWrapper.cxx | 1 + sd/uiconfig/simpress/ui/navigatorpanel.ui | 4 ---- 6 files changed, 48 insertions(+), 4 deletions(-)
New commits: commit 7dec55381d4e578a9455869a3c5bd27909d1ea01 Author: Jim Raykowski <[email protected]> AuthorDate: Mon Feb 16 00:30:30 2026 -0900 Commit: Jim Raykowski <[email protected]> CommitDate: Tue Feb 17 10:13:51 2026 +0100 tdf#90242 Use correct name in toolbox navigation buttons tooltips Makes 'Slide' or 'Page' be shown in the Navigator navigation toolbox button tooltips depending whether the Navigator is being used for Impress or Draw. Change-Id: I4301e2661130b9ef2e4312e0b7b395fc3b3edb45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199462 Reviewed-by: Jim Raykowski <[email protected]> Tested-by: Jenkins diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc index a4fcd5c79a47..f6a06e0b85db 100644 --- a/sd/inc/strings.hrc +++ b/sd/inc/strings.hrc @@ -482,4 +482,14 @@ #define STR_CLICKTOEXITPRESENTATION_TEXT NC_("STR_CLICKTOEXITPRESENTATION_TEXT", "Click to exit presentation...") #define STR_CLICKTOEXITPRESENTATION_TITLE NC_("STR_CLICKTOEXITPRESENTATION_TITLE", "Current Slide (end)") +// Navigator slide/page navigation toolbox items tooltips +#define STR_FIRST_SLIDE NC_("STR_FIRST_SLIDE", "First Slide") +#define STR_PREVIOUS_SLIDE NC_("STR_PREVIOUS_SLIDE", "Previous Slide") +#define STR_NEXT_SLIDE NC_("STR_NEXT_SLIDE", "Next Slide") +#define STR_LAST_SLIDE NC_("STR_LAST_SLIDE", "Last Slide") +#define STR_FIRST_PAGE NC_("STR_FIRST_PAGE", "First Page") +#define STR_PREVIOUS_PAGE NC_("STR_PREVIOUS_PAGE", "Previous Page") +#define STR_NEXT_PAGE NC_("STR_NEXT_PAGE", "Next Page") +#define STR_LAST_PAGE NC_("STR_LAST_PAGE", "Last Page") + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/dlg/NavigatorChildWindow.cxx b/sd/source/ui/dlg/NavigatorChildWindow.cxx index 42d07e80fef9..df580658baa3 100644 --- a/sd/source/ui/dlg/NavigatorChildWindow.cxx +++ b/sd/source/ui/dlg/NavigatorChildWindow.cxx @@ -25,6 +25,9 @@ #include <sfx2/sfxsids.hrc> #include <svl/eitem.hxx> #include <svl/itemset.hxx> +#include <drawdoc.hxx> +#include <ViewShellBase.hxx> +#include <DrawController.hxx> namespace sd { @@ -51,6 +54,18 @@ SdNavigatorFloat::SdNavigatorFloat(SfxBindings* _pBindings, SfxChildWindow* _pMg [_pBindings] () { return RequestNavigatorUpdate(_pBindings); }); SetMinOutputSizePixel(GetOptimalSize()); + + // Set the toolbox navigation button tooltips + // Tunnel through the controller to obtain a ViewShellBase. + css::uno::Reference<css::frame::XFrame> xFrame = _pBindings->GetActiveFrame(); + ViewShellBase* pViewShellBase = nullptr; + rtl::Reference<sd::DrawController> pController + = dynamic_cast<sd::DrawController*>(xFrame->getController().get()); + if (pController != nullptr) + pViewShellBase = pController->GetViewShellBase(); + if (pViewShellBase == nullptr) + throw css::uno::RuntimeException(u"can not get ViewShellBase for frame"_ustr); + m_xNavWin->SetToolBoxToolTips(pViewShellBase->GetDocument()); } void SdNavigatorFloat::Activate() diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 5c0b54b5a4ef..50d745a1ae93 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -55,6 +55,9 @@ #include <sdpage.hxx> +#include <sdresid.hxx> +#include <strings.hrc> + /** * SdNavigatorWin - FloatingWindow */ @@ -112,6 +115,24 @@ SdNavigatorWin::SdNavigatorWin(weld::Widget* pParent, SfxBindings* pInBindings, } } +void SdNavigatorWin::SetToolBoxToolTips(const SdDrawDocument* pDoc) +{ + if (pDoc->GetDocumentType() == DocumentType::Impress) + { + mxToolbox->set_item_tooltip_text(u"first"_ustr, SdResId(STR_FIRST_SLIDE)); + mxToolbox->set_item_tooltip_text(u"previous"_ustr, SdResId(STR_PREVIOUS_SLIDE)); + mxToolbox->set_item_tooltip_text(u"next"_ustr, SdResId(STR_NEXT_SLIDE)); + mxToolbox->set_item_tooltip_text(u"last"_ustr, SdResId(STR_LAST_SLIDE)); + } + else + { + mxToolbox->set_item_tooltip_text(u"first"_ustr, SdResId(STR_FIRST_PAGE)); + mxToolbox->set_item_tooltip_text(u"previous"_ustr, SdResId(STR_PREVIOUS_PAGE)); + mxToolbox->set_item_tooltip_text(u"next"_ustr, SdResId(STR_NEXT_PAGE)); + mxToolbox->set_item_tooltip_text(u"last"_ustr, SdResId(STR_LAST_PAGE)); + } +} + void SdNavigatorWin::FirstFocus() { // set focus to listbox, otherwise it is in the toolbox which is only useful diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx index d6497f189f3b..f112961b2d00 100644 --- a/sd/source/ui/inc/navigatr.hxx +++ b/sd/source/ui/inc/navigatr.hxx @@ -123,6 +123,7 @@ public: SD_DLLPUBLIC SdPageObjsTLV& GetObjects(); virtual void HandleContextChange(const vcl::EnumContext& eContext) override; + void SetToolBoxToolTips(const SdDrawDocument* pDoc); private: friend class SdNavigatorFloat; diff --git a/sd/source/ui/sidebar/NavigatorWrapper.cxx b/sd/source/ui/sidebar/NavigatorWrapper.cxx index 95d4a66ae14b..442d59e31bf4 100644 --- a/sd/source/ui/sidebar/NavigatorWrapper.cxx +++ b/sd/source/ui/sidebar/NavigatorWrapper.cxx @@ -32,6 +32,7 @@ NavigatorWrapper::NavigatorWrapper ( { SetUpdateRequestFunctor( [this] () { return this->UpdateNavigator(); }); + SetToolBoxToolTips(mrViewShellBase.GetDocument()); } css::ui::LayoutSize NavigatorWrapper::GetHeightForWidth (const sal_Int32) diff --git a/sd/uiconfig/simpress/ui/navigatorpanel.ui b/sd/uiconfig/simpress/ui/navigatorpanel.ui index e7ab687fdb7a..bbcb649b75f7 100644 --- a/sd/uiconfig/simpress/ui/navigatorpanel.ui +++ b/sd/uiconfig/simpress/ui/navigatorpanel.ui @@ -138,7 +138,6 @@ <child> <object class="GtkToolButton" id="first"> <property name="visible">True</property> - <property name="tooltip-text" translatable="yes" context="navigatorpanel|first|tooltip_text">First Slide</property> <property name="icon-name">sd/res/nv03.png</property> <child internal-child="accessible"> <object class="AtkObject" id="first-atkobject"> @@ -154,7 +153,6 @@ <child> <object class="GtkToolButton" id="previous"> <property name="visible">True</property> - <property name="tooltip-text" translatable="yes" context="navigatorpanel|previous|tooltip_text">Previous Slide</property> <property name="icon-name">sd/res/nv04.png</property> <child internal-child="accessible"> <object class="AtkObject" id="previous-atkobject"> @@ -170,7 +168,6 @@ <child> <object class="GtkToolButton" id="next"> <property name="visible">True</property> - <property name="tooltip-text" translatable="yes" context="navigatorpanel|next|tooltip_text">Next Slide</property> <property name="icon-name">sd/res/nv05.png</property> <child internal-child="accessible"> <object class="AtkObject" id="next-atkobject"> @@ -186,7 +183,6 @@ <child> <object class="GtkToolButton" id="last"> <property name="visible">True</property> - <property name="tooltip-text" translatable="yes" context="navigatorpanel|last|tooltip_text">Last Slide</property> <property name="icon-name">sd/res/nv06.png</property> <child internal-child="accessible"> <object class="AtkObject" id="last-atkobject">
