Bug 101704 - Allow extensions to register their own button within a tab in the Notebookbar
Summary: Allow extensions to register their own button within a tab in the Notebookbar
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL: https://wiki.documentfoundation.org/D...
Whiteboard:
Keywords:
: 116532 122316 (view as bug list)
Depends on:
Blocks: Notebookbar
  Show dependency treegraph
 
Reported: 2016-08-24 16:40 UTC by Volga
Modified: 2019-02-14 14:55 UTC (History)
12 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volga 2016-08-24 16:40:22 UTC
As TDF Wiki page “Development/NotebookBar/Extensions”, an extension can register their own tabs in the Notebookbar. But this is not enough, LO should provide more APIs to allow extension to register not only own tab but also buttons within a tab as File, Home, Insert, etc. to give developers convenience if they don’t want to create a custom tab but want to just create a button.
Comment 1 Buovjaga 2016-10-12 11:07:54 UTC
I guess it's reasonable -> NEW
Comment 2 Buovjaga 2018-03-26 07:37:13 UTC
*** Bug 116532 has been marked as a duplicate of this bug. ***
Comment 3 Volga 2018-06-08 04:16:13 UTC
On this page you will see what happened if a MS Office add-in registered icons on Ribbon interface in Excel 2016:
https://docs.microsoft.com/en-us/office/dev/add-ins/design/add-in-commands
Comment 4 Roman Kuznetsov 2018-12-26 13:21:25 UTC
*** Bug 122316 has been marked as a duplicate of this bug. ***
Comment 5 jan d 2018-12-29 15:22:05 UTC
Is "adding button to existing toolbar" something that already works with current "old-style" toolbars? Or would extensions always create their own toolbar and add their button there? Could be relevant to keep very similar API for both toolbars and notebookbars and reuse an established (XML)format.
Comment 6 Volga 2018-12-30 10:57:14 UTC
(In reply to jan d from comment #5)
> Is "adding button to existing toolbar" something that already works with
> current "old-style" toolbars? 

Yes, the following extension works with this:
DCM Direct Colour Management
https://extensions.libreoffice.org/extensions/dcm-direct-colour-management
Firstly, I can see the special button after I install this extension. But when I switched to tabbed toolbar, the button is disappeared.

版本:6.2.0.1 (x64)
Build ID:0412ee99e862f384c1106d0841a950c4cfaa9df1
CPU 线程:4; 操作系统:Windows 10.0; UI 渲染:默认; VCL: win; 
区域语言:zh-CN (zh_CN); UI 语言: zh-CN
Calc: threaded
Comment 7 Gerhard Weydt 2018-12-31 17:38:41 UTC
If you look at the example on the page cited in comment #1, which in fact is only a proposal how it could look like when it will be developped, there is already included the request for buttons (simply search for button), even though the title does not state this. Otherwise, as I agree with you, the proposal would not be very helpful.
But there seems to be no realisation yet, at least I could not find one where I would think it should be placed, namely in parallel to menubar, toolbar etc.
You may also note that the text is dated 2016 and has not been edited since.
I would gladly add buttons to the notebokbars, even though I do not like seem, if I could.
Comment 8 andreas_k 2019-02-13 13:57:54 UTC
as there is not only tabbed toolbar the request for extension support in LibreOffice has to be more generic.


Idea
---------
when you have a look at the notebookbar*.ui files all uno commands are in an sfxlo-NotebookbarToolBox widget, because with an sfxlo-NotebookbarToolBox widget you can define the Toolbar Style (Text only, Icon only, Text below icons, Text beside icons) and the Icon size (no setting use the default setting which the user can change in LibO Settings, Large Toolbar, Menubar, ...)

So my request for extension support would be to define extensions with the sfxlo-NotebookbarToolBox widget.

Tabbed Toolbar: own Tab where you have sfxlo-NotebookbarToolBox with settings Text below Icons and Large Toolbar icon size

Tabbed compact Toolbar: own Tab where you have sfxlo-NotebookbarToolBox with settings Text beside Icons

Groupedbar compact Toolbar: own Group called extensions where you have sfxlo-NotebookbarToolBox with icons only layout

Implementation
--------------
sfxlo-NotebookbarToolBox widget have an specific name e.g. extension1, extension2, ... so everywhere an sfxlo-NotebookbarToolBox widget called extension1 was available in the .ui file the commands from the extension will be shown.

open issues:
- would be cool if the user can rearrange the extensions (define which is extension1, extension2, ...
- it's not possible to say specific command's are more importend and can than be arranged on the home tab.


Summery
---------
Use NotebookbarToolBox widget with an specific name would be an easy solution and will have an good first implementation, it wan't save all issues (like rearrange commands), but customize the notebookbar is another bug.
Comment 9 Pedro 2019-02-14 14:55:12 UTC
I am all for this. It would be essential to improve Notebookbar functionality. By having these functions we could probably even start considering making Notebookbar versions of the traditional layouts.