Thursday, 31 October 2019

Native GTK Dialogs in LibreOffice

LibreOffice Native GTK Dialog Status

The LibreOffice UI was traditionally implemented with its own VCL toolkit which via theming emulated the host desktop toolkit.

Then we migrated the file format the dialogs were described in to the GtkBuilder file format. But still implemented with VCL widgetry, though with additional GTK-alike layout widgets.

Then migrated the translation format to gettext .mo files, which added plural form translation support we had lacked.

Then incrementally migrated the code driving the dialogs to a new API with two implementations, one for VCL widgetry and one for GTK.


Over the last few major releases the GTK version of LibreOffice has increasingly had true GTK dialogs and less VCL dialogs and in master, as of this week, there are now no direct uses of the VCL dialog APIs.

There are still some non-dialog utility windows and other elements to port over, but dialogs are complete.

LibreOffice has a lot of UI. There are 1029 XML UI definition files in master. 480 definitions of a GtkDialog and 75 additional GtkMessageDialog definitions. The remainder of the files typically describe a single page of a Notebook, Assistant or Sidebar, often appearing in multiple dialogs.

Here are some gifs of a small set of the dialogs from master under Fedora 31, taken under Wayland with peek, showing some of the stock animations of the default GTK 3.24 Adwaita theme

The Writer Character dialog

Notebook, Color Selector MenuButton, and ToggleButton animations

The Calc Page dialog

SpinButtons and legacy Preview widgets hosted in a native dialog


The Writer Paragraph dialog

"Double Decker" Notebook and Scale widgets

The Writer AutoCorrect dialog

Smooth scrolling of huge Emoji autocorrect list

Chart 3D View dialog

Amusingly Over-engineered custom lighting direction widget


The Options dialog

TreeView, Overlay ScrollBar, fade in animation of CheckButtons


Friday, 22 June 2018

LibreOffice color selector as GTK widgets

Here's what the native GTK widget mode for the color picker looks like at the moment under Wayland. A GtkMenuButton displaying a color preview of the currently selected color and a GtkPopover containing the color selection widgetry.

While under X, because there the GtkPopover is constrained to its parents size, falling back to using a GtkWindow to contain the widgetry

Monday, 16 April 2018

Some Native GTK Dialogs in LibreOffice

When the GTK3 backend is active in current LibreOffice master (towards 6.1) some of the dialogs are now comprised of fully native GTK dialogs and widgetery. Instead of VCL widgetery themed to look like GTK, they're the real thing.

So for these dialogs this means f.e that the animated effects for radio and checkbuttons work, that the scrolling is overlay scrolling, and that the visual feedbacks that scrolling has reached its limit, or that available content is outside the scrolling region are shown. In the above demo, the GtkNotebook is the real thing.
I'm particularly pleased with the special character dialog because it has a custom character grid widget which comes with accessibility support which remains working when reworked as a native gtk widget with custom drawing and interaction callbacks.

Sunday, 4 March 2018

native GTK3 message dialogs

In LibreOffice 6.1, when the GTK3 backend is in use, the message dialogs are now native GTK3 message dialogs rather than vcl message dialogs using GTK theming.

So they are now true GTK dialogs and they look like...

while before they looked like...

We have 475 message dialogs directly instantiated in LibreOffice and 89 indirectly instantiated via GtkBuilder .ui files.

We've changed the format our dialog, etc. translations are stored in from our own legacy custom format to the more commonplace gettext .mo format. In the case of a message dialog described via a GtkBuilder .ui file, we now use GTK's own GtkBuilder to load the .ui, and GTK's own gettext integration to localize it from our new .mo format translations.

Thursday, 9 November 2017

gtk3 + broadway + libreoffice

Out of the box in Fedora 26 I see that our gtk3 version of LibreOffice mostly works under broadway so here's libreoffice displaying through firefox. Toolbar is toast, but dialogs and menus work.


broadwayd :5 &
firefox http://127.0.0.1:8085 &
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 soffice --nologo &

Monday, 23 October 2017

Discrepancy Report #107743

Short (1996) little article about a bug in the shuttle starboard manipulator arm display position.

Spoiler: A half-dozen pages of forms detail [the error] ... the most remarkable thing about the error and its paper trail. “There is no starboard manipulator arm”

Monday, 11 September 2017

Flickerless Gtk3 OpenGL Transitions

While I got OpenGL transitions working under Gtk3 at the end of last year basically matching the Gtk2/Generic OpenGL quality the transition into and out of the OpenGL sequence wasn't very satisfying. And with access to HiDPI it was clearly even worse with an unscaled image momentarily appearing before the correct one.

So here's the before and after of the improvements that landed on upstream master today. Just screen-recordings with built in ctrl+shift+alt+t under gnome3 and positioned side by side and clipped roughly together in pitivi