summaryrefslogtreecommitdiff
path: root/src/contacts-avatar.vala
Commit message (Collapse)AuthorAgeFilesLines
* avatar: set pixbuf to null if avatar is removednielsdg/avatar-buttonNiels De Graef2023-02-211-1/+3
| | | | | This fixes an issue where removing an avatar from a contact would not update the UI, as the current pixbuf would still keep being displayed.
* Introduce the concept of Contacts.ChunkNiels De Graef2022-09-031-13/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new class `Contacts.Chunk`. Just like libfolks, we see a contact as a collection of data, or to word it differently: a collection built up from "chunks" of information. The net result of adding this concept adds quite a bit of lines of code, but it does have some major benefits: * Rather than stuffing new properties into yet another if-else spread out over multiple places in contacts-utils (and quite a bit of other files), we can create a new subclass of `Contacts.Chunk` * This also goes for property-specific logic, which we can consolidate within their appropriate classes/files. * All of our logic is now unit-testable In the future, this would allow for more cleanups/features: * We can put the serialization code for each property inside the `Contacts.Chunk` * We can extend ContactSheet to show a vCard's information, before actually importing it into a Folks.Individual. * We can write unit tests on the set of chunks, rather than regularly having to deal with yet another regression in e.g. the birthday editor.
* Use selection and filter models to list contactsNiels De Graef2022-04-161-25/+24
| | | | | | | | | | | | | | | | | GTK4 added some interesting concepts on top of / in conjunction with list models, for example to map one list model on another by sorting and/or filtering. Another example is to use this with selections. This commit applies that concept to Contacts, which now uses the `Contacts.Store` to build a base list model on top of the `Folks.IndividualAggregator`, on top a sorted model (which can be adjusted to sort on First/Last name, and finally a filter model, to filter on the text in the search entry. Another reason to do this, is that it allows us to use a `Gtk.ListView` in the future. It's not possible to do so already due to the fact that we need to differentiate between "Favorites" and "Other Contacts", which needs extra API on Gtk.Listview side.
* editor: Make sure saving an avatar works againNiels De Graef2022-01-131-0/+8
|
* Port to GTK4 and libadwaitaNiels De Graef2022-01-121-37/+53
| | | | | | | | | | | | | | | | | | | | | This is a mega-commit which ports Contacts to GTK4 and libadwaita, the library which provides GNOME-specific widgets on top of GTK4. This change also now follows the new mockups of Contacts, which use a boxed list style to convey contact information. There is a minor set of known issues which we'll still need to solve later (preferably): * For now, taking a picture with your webcam is not implemented. In GTK3, we used to do this with Cheese, but this hasn't been ported to GTK4. Ideally, we could just directly use Pipewire though. * Some CRITICALs when we have some unexpectedly long names or property values * The delete button is gone for most properties. This probably needs to be rethough at the design level on how we want to deal with it. * We're still blocked a bit on libedataserverui not having a GTK4 port yet.
* Import only the Folks namspaceNiels De Graef2020-11-301-1/+0
| | | | | | | | | | | | | | | This commit removes all remaining occurrences `using Gtk;`, `using Gee;` and `using Hdy;`. There's a number of reasons why we're doing this, but to list a few: * The `Gtk` and `Hdy` namespaces have had issues before with types having the same name (ie HdyHeaderBar and GtkHeaderBar) which could suddenly break the build. * By omitting namespaces, it's harder to see for new contributors what the actual type is of a certain variable when they want to look up the API * In the long term, we want to get rid of Gee, as it's clear that it's not really maintained, and has some serious performance drawbacks.
* avatar: Use unowned references when castingNiels De Graef2020-11-071-5/+4
| | | | And don't use `using Gtk;`, since some names of types can clash.
* avatar: Use HdyAvatarChristopher Davis2020-10-041-75/+31
| | | | | | | | | | Makes Contacts.Avatar a wrapper around HdyAvatar. This allows us to drop our custom fallback and circular avatar code in favor of HdyAvatar. Fixes https://gitlab.gnome.org/GNOME/gnome-contacts/-/issues/183 Related to https://gitlab.gnome.org/GNOME/Initiatives/-/issues/20
* Use individual directlyJulian Sparber2019-11-041-16/+16
| | | | | | | | | | | | | | This removes most of the Contact class and makes use of the Individual of folks directly. The aim of this refactor is to make the code more readable. Since Individual provides most of the needed features the Contact class adds a complicated abstraction without any real benefit. Transform FakePersona a real Persona which can be used as a placeholder till folks returns the real Persona. Use SearchQuery to find the best matching contact when opening gnome-contacts with a e-mail address
* Avatar: use GNOME 3.32 avatar styles for fallbackJulian Sparber2019-07-251-58/+64
|
* Avatar: cache the fallback avatarJulian Sparber2019-07-251-7/+24
|
* Documentation: auto-build the valadoc docs.Niels De Graef2018-03-311-1/+1
| | | | | We won't them by defaul though, you have to explicitly set 'docs' to true when configuring meson.
* Avatar: Contact.individual is never null.Niels De Graef2018-01-241-2/+1
|
* Avatar: unnecessary Cairo save() and restore()Niels De Graef2018-01-241-4/+0
|
* Avatar: don't add a class style context.Niels De Graef2018-01-221-2/+0
| | | | | It won't work with the drawing area, so don't bother with all that extra code.
* Avatar: lazily load the Pixbuf of the avatar.Niels De Graef2018-01-221-12/+32
| | | | This should again decrease our memory usage in most cases.
* Avatar: load asynchronously.Niels De Graef2018-01-201-8/+6
| | | | This fixes [bug 657962](https://bugzilla.gnome.org/show_bug.cgi?id=657962).
* Avatar: remove redundant if-check.Niels De Graef2018-01-201-3/+0
|
* Avatar: also provide a fallback if contact == nullNiels De Graef2018-01-201-4/+2
|
* Avatar: cleaner UI.Niels De Graef2018-01-191-31/+80
| | | | | | * Always clip to a circle. * In case there is no avatar, use a specific color for each contact and draw a default icon on top if it.
* Avatar: don't use a button.wip/nielsdg/avatar-no-buttonNiels De Graef2018-01-181-29/+5
| | | | | | | Leave all the button logic out of it and just be a simple DrawingArea. NOTE: we temporarily lose our border because of this, but with the new avatars, this should no longer be a problem.
* Simplify Avatar stylingNiels De Graef2018-01-161-1/+3
|
* Rename ContactFrame to Avatar.Niels De Graef2018-01-161-0/+114
It's shorter *and* it's more obvious.