[gnome-music/cherry-pick-cbee5094] Minor optimizations
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/cherry-pick-cbee5094] Minor optimizations
- Date: Sun, 8 Apr 2018 12:56:30 +0000 (UTC)
commit e147188f9abde5f1d8d7d9e3f3a4b2a8c6461bcf
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Mar 1 12:11:31 2018 -0300
Minor optimizations
By setting the main window's stack to not homogeneous, we won't try to
allocate all the views every time the window is allocated.
And by reducing the maximum number of albums per row, and knowing that
asymptotic complexity of the GtkFlowBox allocation is O(max²), we can
save some good hundreds of thousands of cycles too.
(cherry picked from commit cbee5094804970b1944d567bf347d6dc38a9d7c8)
gnomemusic/views/albumsview.py | 2 +-
gnomemusic/window.py | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index e402fab4..a753d603 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -77,7 +77,7 @@ class AlbumsView(BaseView):
homogeneous=True, hexpand=True, halign=Gtk.Align.FILL,
valign=Gtk.Align.START, selection_mode=Gtk.SelectionMode.NONE,
margin=18, row_spacing=12, column_spacing=6,
- min_children_per_line=1, max_children_per_line=25)
+ min_children_per_line=1, max_children_per_line=20)
self._view.get_style_context().add_class('content-view')
self._view.connect('child-activated', self._on_child_activated)
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 2d582b95..956d7ab4 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -220,6 +220,7 @@ class Window(Gtk.ApplicationWindow):
self._stack = Gtk.Stack(
transition_type=Gtk.StackTransitionType.CROSSFADE,
transition_duration=100,
+ homogeneous=False,
visible=True,
can_focus=False)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]