Commit Graph

17 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto 9a35a09e24 malcontent-control: Update copyright headers
Append myself as the author of the files I've meaninfully changed.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto b25a4e2119 carousel: Simplify arrow handling
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.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 15172723dd carousel: Use revealer to calculate arrow offset
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.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 4887ded149 carousel: Replace size-allocate callback by a layout manager
GTK4 has no size-allocate signal anymore, but we can use a custom
layout manager to produce the same effect.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 1d20fc50c9 carousel: Improve carousel box
This makes the carousel look more like what it used to.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto b71b83f348 carousel: Port MctCarousel to GTK4
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.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 0fca70768a carousel: Make MctCarouselItem subclass GtkButton
And add a setter to its internal child.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto e088443645 carousel: use double to translate coordinates
That's what GTK4 expects now.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 8c170d11a2 project: Port GdkScreen to GdkDisplay
API looks about the same, just switching to 'display'.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto c39ffd45fc project: Remove unnecessary usage of gtk_widget_show()
Now that widgets are visible by default, no need to show them
after creating them. Also revove gtk_widget_show_all() which
doesn't exist in GTK4.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 631df4f1a5 project: Adapt to GtkBox API changes
GtkBox provides a different API surface, such as gtk_box_append()
and gtk_box_prepend(), so switch to that.
2022-07-20 19:23:12 -03:00
Philip Withnall 73d7c5e113 all: Fix various typos and incorrect terminology
Done using:
```
codespell \
    --builtin clear,rare,usage \
    --skip './po/*' --skip './help/*/*.po' --skip './.git/*' --skip './NEWS*' \
    --write-changes .
```
and then some manual checking and editing.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-06-18 13:51:35 +01:00
Philip Withnall 8027351f58 carousel: Lower CSS priority
Otherwise an application won’t be able to override the CSS installed by
libmalcontent-ui if this is ever moved into libmalcontent-ui.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-25 12:25:40 +00:00
Philip Withnall 00bb439f6e malcontent-control: Fix use of an uninitialised variable in the carousel
`dest_x` is not set if `gtk_widget_translate_coordinates()` fails, which
it can do before the widget is realised.

This fixes a valgrind warning, but doesn’t change any user-visible
behaviour as far as I can tell.

This has been upstreamed to gnome-control-center as
https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/691.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-03 17:29:17 +00:00
Philip Withnall 9e73c34664 malcontent-control: Fix some minor leaks in MctCarousel
Relevant chunks upstreamed in
https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/683.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:31:42 +00:00
Philip Withnall 2c043a6bd5 malcontent-control: Reformat and rename code from gnome-control-center
Make it fit in with the surrounding code style, and rename the classes
to `MctCarousel` and `MctUserControls`. List them in `meson.build` and
`POTFILES.in`. No other changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:31:42 +00:00
Philip Withnall aa6ece8a91 malcontent-control: Add widgets from gnome-control-center
Add `CcCarousel` and `CcAppPermissions` from gnome-control-center and
rename the files. None of the contents of the files have been changed
yet. The files are from git master of gnome-control-center on
2020-01-08.

`carousel.{c,h,ui}` are licensed under GPLv2+, and are copyright 2016
Red Hat, Inc. The original author was Felipe Borges.

`user-controls.{c,h,ui}` are licensed under GPLv3+, and are copyright
2018, 2019 Endless, Inc.

`gs-content-rating.{c,h}` are originally from gnome-software, are
licensed under GPLv2+, and are copyright 2015, 2016 Richard Hughes. He
was also the original author. These files are needed by
`user-controls.{c,h}`.

`user-image.{c,h}` are licensed under GPLv2+ and are copyright 2015, Red
Hat, Inc. The original author was Ondrej Holy.

This code will not stay as copy-paste code for too long. The ultimate
plan is to rework most of the widgets:
 • `CcCarousel`: Will be reworked to provide more information about the
   screen time usage of each user. It will become a summary widget as
   well as a selector.
 • `GsContentRating`: Will be abstracted out into libappstream-glib, or
   some other suitable library, where its implementation can be shared
   between gnome-software and malcontent.
 • `CcUserControls`: Will be reworked as the UI of malcontent evolves.
   Will also be removed from gnome-control-center once malcontent-control
   is released.
 • `CcUserImage`: As per `CcCarousel`, this will evolve into a new
   widget.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:28:21 +00:00