Bug 163988 - weld Notebookbar (Support native widgets)
Summary: weld Notebookbar (Support native widgets)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
25.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Notebookbar-Theming
  Show dependency treegraph
 
Reported: 2024-11-22 10:04 UTC by Michael Weghorn
Modified: 2024-11-22 15:35 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot Notebookbar with gtk4 VCL plugin (47.04 KB, image/png)
2024-11-22 10:04 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weghorn 2024-11-22 10:04:14 UTC
Created attachment 197719 [details]
Screenshot Notebookbar with gtk4 VCL plugin

The Notebookbar currently uses custom VCL widgets and doesn't use the welding approach, which means it doesn't support the use of native toolkit widgets, like GTK widgets when using gtk3 or gtk4.

As a consequence, it doesn't adhere to the rest of the UI, which is in particular visible with the gtk4 VCL plugin on Linux.

For more background and ideas, see als the discussion in tdf#163947, in particular bug 163947 comment 8 through bug 163947 comment 14.

(Caolán McNamara in bug 163947 comment #14)
> > (In reply to Caolán McNamara from comment #9)
> > > a whole zoo of other weird and wonderful custom ... widgets
> > > (that I don't know why exactly exist or what difference they are from some
> > > more 'normal' widgets).
> > 
> > After looking into this a little further, the logic indeed seems to be
> > mostly in C++ code, and the preview seen in Glade also doesn't match what
> > you see when actually running LibreOffice. For example, the
> > "sfxlo-NotebookbarTabControl" control in sc/uiconfig/scalc/ui/notebookbar.ui
> > is implemented in a `NotebookbarTabControl` class
> > (sfx2/inc/notebookbar/NotebookbarTabControl.hxx).
> > It seems to be mostly a GtkNotebook with extra widgets left and right to the
> > tabs in the tab bar.
> > 
> > IIUC, the GtkNotebook concept of "action widgets" [1] would be comparable,
> > and if I set dummy ones in in Glade, I see extra widgets there. But since
> > the LO .ui file doesn't use them, they're of course not shown in the preview.
> > 
> > The VCL version looks quite odd in e.g. gtk4, so I wonder whether welding
> > notebookbar would generally be a desirable goal in the longer run - or
> > whether there's a specific reason for having "our own custom stuff", e.g. to
> > allow Notebookbar customization,...?
> > (The Notebookbar vcl widgets have more interesting special handling, which
> > might need some consideration in case of planning to weld all of these.)
> 
> Yeah, the welding began before the notebookbar began IIRC, and when I
> basically finished the normal cases this notebookbar had then grown into
> this other mountain of work which never really got looked at. Ideally it
> should be the same as everything else.
> 
> Some unpicking of the notebookbar is probably needed to see what the special
> widgets are for and if they just flag certain things that could be taken
> care of outside the .ui file or if they really indicate special widgets that
> gtk doesn't provide.

Steps to reproduce:

1) start Writer with the gtk4 VCL plugin (SAL_USE_VCLPLUGIN=gtk4) on Linux
2) enable notebookbar: "View" -> "User Interface", select "Tabbed" and confirm
3) Look at the notebookbar

Actual result (see attached screenshot)

The UI is inconsistent and doesn't match the GTK theme in use, e.g.
* currently active tab isn't indicated as usual
* background color of the notebookbar is mostly gray, but controls themselves use white

With gtk3, it's not as bad, because GTK 3 provides an API to render widgets to look similar to actual GTK widgets.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c06de26c4b83edad29a70a454dea20dcd0261a33
CPU threads: 32; OS: Linux 6.11; UI render: default; VCL: gtk4
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: CL threaded
Comment 1 Michael Weghorn 2024-11-22 10:08:26 UTC
Self-confirming based on the earlier discussion in tdf#163947.