[gnome-music/wip/mschraal/gst-handle-async-done-3-32-backport: 3/3] disclistboxwidget: max-children-per-line property cannot be 0
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/gst-handle-async-done-3-32-backport: 3/3] disclistboxwidget: max-children-per-line property cannot be 0
- Date: Sun, 5 May 2019 17:53:31 +0000 (UTC)
commit 9b68927953be0d2981a2e117ce4d322e1cc82605
Author: Jean Felder <jfelder src gnome org>
Date: Sun Apr 14 23:50:03 2019 +0200
disclistboxwidget: max-children-per-line property cannot be 0
Since Gtk 4.24.8, the max-children-per-line property of a Gtk.FlowBox
cannot be equal to 0.
Fix the issue by setting an initial value of 1.
data/ui/DiscBox.ui | 2 +-
gnomemusic/widgets/disclistboxwidget.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/data/ui/DiscBox.ui b/data/ui/DiscBox.ui
index c869d46a..0dc45f91 100644
--- a/data/ui/DiscBox.ui
+++ b/data/ui/DiscBox.ui
@@ -32,7 +32,7 @@
<property name="valign">start</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
- <property name="max_children_per_line">0</property>
+ <property name="max_children_per_line">1</property>
<property name="selection_mode">none</property>
</object>
<packing>
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index b6a8ff46..3faa32c7 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -71,7 +71,7 @@ class DiscSongsFlowBox(Gtk.FlowBox):
"""
self._columns = columns
- children_n = len(self.get_children())
+ children_n = max(len(self.get_children()), 1)
if children_n % self._columns == 0:
max_per_line = children_n / self._columns
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]