summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/TabBar.cxx
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2018-08-26 18:01:09 -0800
committerCaolán McNamara <caolanm@redhat.com>2018-08-29 16:38:28 +0200
commit2c92b886b7538c4786a4d9a33cbcfe694daf1f62 (patch)
tree618e2aec5e5e37f6798035c10790ec75254ec3dc /sfx2/source/sidebar/TabBar.cxx
parent17d8f6b0d78c11ac40a335917b3576f13d1e1b9d (diff)
tdf#119461 Fix focus hidden on deck collapse
Makes Space key behavior the same as mouse click. Focus remains on the tab button when the deck collapses. Makes Enter key never collapses the deck but to open if collapsed and always place focus on the first panel title. Change-Id: Id6d7624e88b421dcfc62f3d0e79986f10c76a65d Reviewed-on: https://gerrit.libreoffice.org/59616 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source/sidebar/TabBar.cxx')
-rw-r--r--sfx2/source/sidebar/TabBar.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index a36a7f9306a9..9487e8079c7c 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -301,6 +301,18 @@ OUString const & TabBar::GetDeckIdForIndex (const sal_Int32 nIndex) const
return maItems[nIndex].msDeckId;
}
+sal_Int32 TabBar::GetDeckIndexForId (const OUString& rsDeckId)
+{
+ sal_Int32 nIndex(1);
+ for (auto const& item : maItems)
+ {
+ if (item.msDeckId == rsDeckId)
+ return nIndex;
+ nIndex++;
+ }
+ return 0;
+}
+
void TabBar::ToggleHideFlag (const sal_Int32 nIndex)
{
if (nIndex<0 || static_cast<size_t>(nIndex) >= maItems.size())