Resolves: tdf#95138 add tooltips to calc tabbar

Change-Id: I870c5dc1b81c642c4c7b70de10ecb927758ae29a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144216
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2022-12-15 13:54:03 +00:00
parent c0b59ad6e3
commit abdad61f12
4 changed files with 25 additions and 8 deletions
+6
View File
@@ -181,6 +181,12 @@
#define STR_TABBAR_PUSHBUTTON_MOVETOEND NC_("STR_TABBAR_PUSHBUTTON_MOVETOEND", "Move To End")
#define STR_TABBAR_PUSHBUTTON_ADDTAB NC_("STR_TABBAR_PUSHBUTTON_ADDTAB", "Add")
#define STR_TABBAR_HINT_MOVETOHOME_SHEETS NC_("STR_TABBAR_HINT_MOVETOHOME_SHEETS", "Scroll to first sheet")
#define STR_TABBAR_HINT_MOVELEFT_SHEETS NC_("STR_TABBAR_HINT_MOVELEFT_SHEETS", "Scroll to previous sheet")
#define STR_TABBAR_HINT_MOVERIGHT_SHEETS NC_("STR_TABBAR_HINT_MOVERIGHT_SHEETS", "Scroll to next sheet")
#define STR_TABBAR_HINT_MOVETOEND_SHEETS NC_("STR_TABBAR_HINT_MOVETOEND_SHEETS", "Scroll to last sheet")
#define STR_TABBAR_HINT_ADDTAB_SHEETS NC_("STR_TABBAR_HINT_ADDTAB_SHEETS", "Add sheet")
#define STR_SVT_ACC_RULER_HORZ_NAME NC_("STR_SVT_ACC_RULER_HORZ_NAME", "Horizontal Ruler")
#define STR_SVT_ACC_RULER_VERT_NAME NC_("STR_SVT_ACC_RULER_VERT_NAME", "Vertical Ruler")
+3 -2
View File
@@ -340,6 +340,7 @@ private:
bool mbInSelect : 1;
bool mbMirrored : 1;
bool mbScrollAlwaysEnabled : 1;
bool mbSheets;
Link<TabBar*,void> maSelectHdl;
Link<TabBar*,void> maSplitHdl;
@@ -347,7 +348,7 @@ private:
size_t maCurrentItemList;
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle, bool bSheets );
SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bBackground );
SVT_DLLPRIVATE void ImplGetColors(const StyleSettings& rStyleSettings,
Color& rFaceColor, Color& rFaceTextColor,
@@ -382,7 +383,7 @@ public:
static const sal_uInt16 APPEND;
static const sal_uInt16 PAGE_NOT_FOUND;
TabBar( vcl::Window* pParent, WinBits nWinStyle );
TabBar(vcl::Window* pParent, WinBits nWinStyle, bool bSheets = false);
virtual ~TabBar() override;
virtual void dispose() override;
+1 -1
View File
@@ -40,7 +40,7 @@
#include <comphelper/lok.hxx>
ScTabControl::ScTabControl( vcl::Window* pParent, ScViewData* pData )
: TabBar(pParent, WB_3DLOOK | WB_MINSCROLL | WB_SCROLL | WB_RANGESELECT | WB_MULTISELECT | WB_DRAG)
: TabBar(pParent, WB_3DLOOK | WB_MINSCROLL | WB_SCROLL | WB_RANGESELECT | WB_MULTISELECT | WB_DRAG, true)
, DropTargetHelper(this)
, DragSourceHelper(this)
, pViewData(pData)
+15 -5
View File
@@ -439,7 +439,7 @@ public:
std::shared_ptr<weld::ButtonPressRepeater> m_xPrevRepeater;
std::shared_ptr<weld::ButtonPressRepeater> m_xNextRepeater;
TabButtons(TabBar* pParent)
TabButtons(TabBar* pParent, bool bSheets)
: InterimItemWindow(pParent,
pParent->IsMirrored() ? OUString("svt/ui/tabbuttonsmirrored.ui")
: OUString("svt/ui/tabbuttons.ui"),
@@ -459,6 +459,15 @@ public:
m_xNextButton->set_accessible_name(SvtResId(STR_TABBAR_PUSHBUTTON_MOVERIGHT));
m_xLastButton->set_accessible_name(SvtResId(STR_TABBAR_PUSHBUTTON_MOVETOEND));
m_xAddButton->set_accessible_name(SvtResId(STR_TABBAR_PUSHBUTTON_ADDTAB));
if (bSheets)
{
m_xFirstButton->set_tooltip_text(SvtResId(STR_TABBAR_HINT_MOVETOHOME_SHEETS));
m_xPrevButton->set_tooltip_text(SvtResId(STR_TABBAR_HINT_MOVELEFT_SHEETS));
m_xNextButton->set_tooltip_text(SvtResId(STR_TABBAR_HINT_MOVERIGHT_SHEETS));
m_xLastButton->set_tooltip_text(SvtResId(STR_TABBAR_HINT_MOVETOEND_SHEETS));
m_xAddButton->set_tooltip_text(SvtResId(STR_TABBAR_HINT_ADDTAB_SHEETS));
}
}
void AdaptToHeight(int nHeight)
@@ -504,10 +513,10 @@ struct TabBar_Impl
}
};
TabBar::TabBar( vcl::Window* pParent, WinBits nWinStyle ) :
TabBar::TabBar( vcl::Window* pParent, WinBits nWinStyle, bool bSheets ) :
Window( pParent, (nWinStyle & WB_3DLOOK) | WB_CLIPCHILDREN )
{
ImplInit( nWinStyle );
ImplInit( nWinStyle, bSheets );
maCurrentItemList = 0;
}
@@ -526,7 +535,7 @@ void TabBar::dispose()
const sal_uInt16 TabBar::APPEND = ::std::numeric_limits<sal_uInt16>::max();
const sal_uInt16 TabBar::PAGE_NOT_FOUND = ::std::numeric_limits<sal_uInt16>::max();
void TabBar::ImplInit( WinBits nWinStyle )
void TabBar::ImplInit( WinBits nWinStyle, bool bSheets )
{
mpImpl.reset(new TabBar_Impl);
@@ -552,6 +561,7 @@ void TabBar::ImplInit( WinBits nWinStyle )
mbInSelect = false;
mbMirrored = false;
mbScrollAlwaysEnabled = false;
mbSheets = bSheets;
ImplInitControls();
@@ -782,7 +792,7 @@ void TabBar::ImplInitControls()
mpImpl->mpSizer.disposeAndClear();
}
mpImpl->mxButtonBox.disposeAndReset(VclPtr<TabButtons>::Create(this));
mpImpl->mxButtonBox.disposeAndReset(VclPtr<TabButtons>::Create(this, mbSheets));
Link<const CommandEvent&, void> aContextLink = LINK( this, TabBar, ContextMenuHdl );