Development: Exchange Libreoffice "Main Frame" with a GTK4 one?

Just for documentation: @caolan answered this to me via #libreoffice-dev (06.12.2021, 10:57):

it is a gtk4 GtkWindow in --enable-gtk4, it doesn’t have client side decorations, except in RTL mode where it does actually use a GtkHeaderBar, but makes it looks like it doesn’t
so vcl/unx/gtk3/gtkframe.cxx has a gtk_header_bar_new new in it, but guarded with some conditions, remove the conditions and play around with that area

and there is no .ui file yet.

Will investigate from there on and see how far I can get :wink:

Sorry, this will be the first thing to be disabled. Flat design with widgets from mobile phones is an ergonomic no go.

So, investigated further and came up with a POC :slight_smile: (see attached image).

Does not use libadwaita but rather “default” set of gtk ui elements; nothing fancy, but as I pointed out, first “baby steps” (also for me figuring out the code).

I will go on play around more; in the meantime: What do you think?

1 Like

Can you add some form controls? In the “Form” menu you find a design mode button and form controls checkbox, radio button, numeric field (with spin button, please), a scroll bar, drop-down listbox, combo box etc. These are the weak points why I use to disable gtk in favour of the clear and functional generic set (win 95 style).

@Villeroy I will try my best :slight_smile: However please keep in mind that I just had the first look at the (vast) LO code just yesterday. But I will keep you posted. Maybe I / we can find a solution that works for both worlds. I am with you on the fact when there is a vast amount of subcategories for menus, a certain set of the old-school menubars would be better.

However, maybe the younger generation prefers the exact opposite (I am 32 myself :wink: so not in that category anymore). There are several interesting papers on how younger generations perceive work with the “regular” computer, e.g. this one: Kids who grew up with search engines could change STEM education forever - The Verge
Therefore, I currently try to think of ways on how to make at least certain actions “easier” and at the same time fancier looking, while making use of the new possibilities of the toolkits (e.g. GTK4). IMO it would be a great win for an open source office suite like libre office :slight_smile:

1 Like

For later reference, some of the talks @caolan @quikee and me had in the last couple of hours on #libreoffice-dev (citation):

@caolan

we have a uxdesign list The Libreoffice-ux-advise Archives and/or the ordinary bug tracker and follow QA/Bugzilla/Fields/Keywords - The Document Foundation Wiki to summon ux to have a look at an idea

@quikee

there is also #libreoffice-design:libera.chat where you can show to the ux people the idea

As was pointed out in #libreoffice-design channel, I created a bug ticket for that very matter. You can find it here: https://bugs.documentfoundation.org/show_bug.cgi?id=146085

Alright guys, I did it! Got libadwaita (Adw – 1) to work in LibreOffice GTK4 build :partying_face: Thx @caolan for hinting me at how to add new libraries to LO.

I tried to get interface done analogous to the mockup presented in https://bugs.documentfoundation.org/show_bug.cgi?id=115512.

Afterwards, you can see the pictures of the interface. Please let me know what you think so far :slight_smile: In general I am very pleased with this toolkit; especially that it is “just” in the beta state and already delivering so much nice functionality to use. E.g. as you will see in the pictures, I used light and dark themes and also made advantage of a TitleViewer that adjusts to the horizontal space that is left in the titlebar.

P.S.: @Villeroy do not fear that libadwaita is just for mobile devices; I have configured the interface in a way, that it will not take advantage of the small views.

2 Likes

2 Likes

2 Likes

2 Likes

2 Likes

2 Likes

2 Likes

And here is another version using the “old” style (in this case the Ubuntu 21.10 system theme).

2 Likes

So I was investigating a request from https://bugs.documentfoundation.org/show_bug.cgi?id=115512 about having the MenuBar in the HeaderBar integrated as e.g. VS Code does. To my surprise: I got this to work :smiley: I don’t know whether the GTK Designers had this in mind (using a GtkPopupMenuBar in a HeaderBar), but due to the fact that this is a GtkWidget, it works actually flawlessly.

I put some examples in the following screenshot. Additinally I put together a bunch of themes for better comparability (there is of course room of improvement, just POC).

Have fun :slight_smile:

2 Likes

These photos look amazing! I also saw your tweet with more photos. How do I try it out?

1 Like

Thx!

Currently you can not because I did not commit to upstream anything yet. I am sorting out the code and need the overcome problems (currently on how to dynamically load/update the menumodel for the file menu in the headerbar and so on. But once done I’ll commit to upstream.

For reference, this is the tweet with colors:

2 Likes

This is absolutely gorgeous. Can’t wait to see this running on my computer. Any idea when this should be pushed to upstream? Also I don’t know the institutional rules and relations between you guys, but what are the odds that your suggestion will be accepted? Also have you been able to solve your loading problem? In any case your work is awesome. Congratulations. Take care. JB

The first thing I add to a new installation of LibreOffice is

export SAL_USE_VCLPLUGIN=gen

This addition to the soffice start script disables all that lousy, dysfunctional Gtk bling.