summaryrefslogtreecommitdiff
path: root/sfx2/source/notebookbar
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2022-06-06 22:50:14 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2022-06-13 18:47:01 +0200
commit9bc1ffa2153d2474b023e0860d3c9c68ee18727b (patch)
tree8dc9f3ac544442591af48b5e66b6fde4b09920d7 /sfx2/source/notebookbar
parent0f01b42e73af0e0baa57a353554a53d936c4f5e2 (diff)
tdf#125040 Make single mode toolbar context aware
This patch modifies the "Standard (Single Mode)" toolbar to have an optional context-aware section, given that a corresponding singlemode-<context-name>.xml files exist. This is a lot like the "Contextual Single" NB, except that it's implemented with regular toolbars, so docking/ customization/extensions/uno api etc. are all working. In addition, the "Single Toolbar" mode was modified to not show any other contextual toolbar. (But of course the single mode toolbar itself is perfectly usable outside of this mode.) Change-Id: Id746d9df59340a81962a8689b132941deea54b6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135591 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sfx2/source/notebookbar')
-rw-r--r--sfx2/source/notebookbar/SfxNotebookBar.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 451c94cf3966..ec1f5bf33c0d 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -221,7 +221,7 @@ void SfxNotebookBar::UnlockNotebookBar()
m_bLock = false;
}
-bool SfxNotebookBar::IsActive()
+bool SfxNotebookBar::IsActive(bool bConsiderSingleToolbar)
{
if (m_bHide)
return false;
@@ -265,6 +265,9 @@ bool SfxNotebookBar::IsActive()
OUString aActive = comphelper::getString( aAppNode.getNodeValue( "Active" ) );
+ if (bConsiderSingleToolbar && aActive == "Single")
+ return true;
+
if (comphelper::LibreOfficeKit::isActive() && aActive == "notebookbar_online.ui")
return true;