[gnome-music/wip/mschraal/gtk4-v3: 182/187] albumsview: Connect checkbox with listmodel selection
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/gtk4-v3: 182/187] albumsview: Connect checkbox with listmodel selection
- Date: Thu, 10 Feb 2022 10:42:30 +0000 (UTC)
commit cb0e9a5f5d07b232626c7de4df8bdce955a8291e
Author: Marinus Schraal <mschraal gnome org>
Date: Wed Feb 9 09:33:24 2022 +0100
albumsview: Connect checkbox with listmodel selection
This correctly changes the GtkListItem selected state.
gnomemusic/views/albumsview.py | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index 2df7e8d46..770dd62b6 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -213,3 +213,13 @@ class AlbumsView(Gtk.Stack):
"active", listitem.props.item, "selected",
GObject.BindingFlags.SYNC_CREATE
| GObject.BindingFlags.BIDIRECTIONAL)
+
+ def on_activated(widget, value):
+ if check.props.active:
+ self._selection_model.select_item(
+ listitem.get_position(), False)
+ else:
+ self._selection_model.unselect_item(
+ listitem.get_position())
+
+ check.connect("notify::active", on_activated)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]