[gnome-music/wip/mschraal/window-template: 1/2] window: Extend template usage



commit 4faa79364b7255f1e81eda298968e92eb9a6fa6b
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri Apr 17 16:00:41 2020 +0200

    window: Extend template usage
    
    With pygobject#257 being fixed it is possible to make a further step in
    templating Window.

 data/ui/Window.ui    | 12 +++++++++++-
 gnomemusic/window.py | 13 ++++---------
 meson.build          |  2 +-
 3 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/data/ui/Window.ui b/data/ui/Window.ui
index 62059ebf..c381c1f9 100644
--- a/data/ui/Window.ui
+++ b/data/ui/Window.ui
@@ -4,7 +4,7 @@
     <property name="default-height">500</property>
     <property name="default-width">300</property>
     <child>
-      <object class="GtkBox" id="_box">
+      <object class="GtkBox">
         <property name="orientation">vertical</property>
         <property name="visible">True</property>
         <child>
@@ -20,11 +20,21 @@
                 <property name="visible">True</property>
               </object>
             </child>
+            <child type="overlay">
+              <object class="NotificationsPopup" id="notifications_popup">
+                <property name="halign">center</property>
+                <property name="transition-type">slide-down</property>
+                <property name="valign">start</property>
+              </object>
+            </child>
           </object>
         </child>
         <child>
           <object class="SelectionToolbar" id="_selection_toolbar"/>
         </child>
+        <child>
+          <object class="PlayerToolbar" id="_player_toolbar"/>
+        </child>
       </object>
     </child>
   </template>
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index bcdae2f8..f9ad95b5 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -38,8 +38,8 @@ from gnomemusic.views.searchview import SearchView
 from gnomemusic.views.songsview import SongsView
 from gnomemusic.views.playlistsview import PlaylistsView
 from gnomemusic.widgets.headerbar import HeaderBar
-from gnomemusic.widgets.notificationspopup import NotificationsPopup
-from gnomemusic.widgets.playertoolbar import PlayerToolbar
+from gnomemusic.widgets.notificationspopup import NotificationsPopup  # noqa
+from gnomemusic.widgets.playertoolbar import PlayerToolbar  # noqa: F401
 from gnomemusic.widgets.playlistdialog import PlaylistDialog
 from gnomemusic.widgets.searchheaderbar import SearchHeaderBar
 from gnomemusic.widgets.selectiontoolbar import SelectionToolbar  # noqa: F401
@@ -55,8 +55,9 @@ class Window(Gtk.ApplicationWindow):
     selected_items_count = GObject.Property(type=int, default=0, minimum=0)
     selection_mode = GObject.Property(type=bool, default=False)
 
-    _box = Gtk.Template.Child()
+    notifications_popup = Gtk.Template.Child()
     _overlay = Gtk.Template.Child()
+    _player_toolbar = Gtk.Template.Child()
     _selection_toolbar = Gtk.Template.Child()
     _stack = Gtk.Template.Child()
 
@@ -121,10 +122,6 @@ class Window(Gtk.ApplicationWindow):
         self._search.connect(
             "notify::search-mode-active", self._on_search_mode_changed)
 
-        self.notifications_popup = NotificationsPopup()
-        self._overlay.add_overlay(self.notifications_popup)
-
-        self._player_toolbar = PlayerToolbar()
         self._player_toolbar.props.player = self._player
 
         self._headerbar.connect(
@@ -167,8 +164,6 @@ class Window(Gtk.ApplicationWindow):
         # bottom line of the searchbar
         self._stack.get_style_context().add_class('background')
 
-        self._box.pack_end(self._player_toolbar, False, False, 0)
-
         self.set_titlebar(self._headerbar_stack)
 
         self._selection_toolbar.connect(
diff --git a/meson.build b/meson.build
index 9bd65331..67193757 100644
--- a/meson.build
+++ b/meson.build
@@ -44,7 +44,7 @@ dependency('libmediaart-2.0', version: '>= 1.9.1')
 dependency('libsoup-2.4')
 dependency('tracker-sparql-2.0', version: '>= 2.3.0')
 dependency('pango', version: '>= 1.44.0')
-dependency('pygobject-3.0', version: '>= 3.29.1')
+dependency('pygobject-3.0', version: '>= 3.36.1')
 dependency('py3cairo', version: '>= 1.14.0')
 dependency('grilo-0.3', version: '>= 0.3.12', fallback: ['grilo', 'libgrl_dep'])
 dependency('grilo-plugins-0.3', version: '>= 0.3.10', fallback: ['grilo-plugins', 'grilo_plugins_dep'])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]