An app which currently depends on malcontent-ui-0.pc or
MalcontentUi-0.gir will fail to compile or run, respectively, aganist
the GTK 4-ified version.
Bump the API version, which is used in both those names. This will also
(I think) allow the two versions of libmalcontent-ui to be
parallel-installed.
When validating the .ui files, we need to determine the path to GTK 4's
relaxng schema. Previously this was erroneously looked up in the prefix
of GTK 3, which malcontent otherwise doesn't depend on.
Define the GTK dependency once, and use that variable everywhere.
AdwPreferencesPage is intended to be used as the first widget
inside page. It has an AdwClamp and a scrolled window to handle
just that.
Putting it in the MctUserControls widget is undesired, because
it introduces an oddly positioned scrolled window in the parental
controls page of Initial Setup, and if we ever reintroduce this
widgetry in Settings, it would suffer from the same problem.
Remove AdwPreferencesPage from MctUserControls, and replace it
with a vertical box. Add an AdwPreferencesPage in malcontent-controls
to compensate for that.
The first call to act_user_manager_list_users() may lazily load
and notify the 'is-loaded' property, in which case we end up
indirectly recursing into reload_users(). Because we recurse
*after* purging carousel items, the same user is added twice:
once in the leaf recursion call, and once again in the call that
notified the 'is-loaded' property.
A simple workaround to this is purging carousel items after the
call to act_user_manager_list_users().
The CSS-based animation is incompatible with the layout machinery
of GTK4, and we can't easily reintroduce it without another major
surgery in the carousel code, so just drop it for now.
Now that the inner GtkStack has margins, it has an odd offset from
what we would expect. A better widget to use is the GtkRevealer,
which must cover the entire allocation, and therefore will always
produce the expected x offset.
There are overlays inside overlays and that is not playing well
with event delivery - the main box is eating away clicks from the
userlist avatars.
Remove all that, and the extra overlays, and just leave one simple
overlay handling the whole widgetry.
In GTK4, the replacement to accelerators like this are shortcut
controllers.
Add a global shortcut controller to the primary menu button, and
bind it to F10.
Make it an AdwBin subclass. Purge all GtkContainer usage, and expose
GTK4-inspired API to add items to the carousel, and also to control
the internal GtkRevealer.
This simultaneously allows us to remove a lot of code, and make
Malcontent more consistent with the rest of the system.
Port MctUserImage to use an AdwAvatar internally. Make it inherit
AdwBin since it has a single child now.
This was supposed to be a project-wide commit, but actually only
MctRestrictApplicationsDialog had APIs to be updated. MctUseImage
will undergo a major surgery soon, so it's left out.
GtkButton has an 'icon-name' property that greatly simplifies
setting up buttons. GtkMenuButton has a new 'always-show-arrow'
property that also allows us to simplify some code.
This simply changes namespaces. Fortunately, no further widgetry
changes will be necessary - all the widgets and APIs seem to have
an exact match in libadwaita.
This was simple, since few widgets have accessibility properties
manually set. The 'static' role doesn't exist anymore, and GtkLabel
handles everything for us, so we can just drop it.
In GTK4, can-focus usage is much more specific to widget subclasses,
and in almost all cases it's not necessary to set it.
Remove it everywhere, except in one case where it still needs to be
manually set to False.