Compare commits

..

1 commit

Author SHA1 Message Date
fecd9801bb Port UI to GTK 4 (close #85) 2024-05-22 17:21:52 +02:00
7 changed files with 2 additions and 56 deletions

View file

@ -22,6 +22,7 @@
<template class="McgCoverPanel" parent="GtkOverlay"> <template class="McgCoverPanel" parent="GtkOverlay">
<child> <child>
<object class="GtkStack" id="cover_stack"> <object class="GtkStack" id="cover_stack">
<property name="visible-child">cover_default</property>
<child> <child>
<object class="GtkSpinner" id="cover_spinner"> <object class="GtkSpinner" id="cover_spinner">
</object> </object>
@ -29,6 +30,7 @@
<child> <child>
<object class="GtkImage" id="cover_default"> <object class="GtkImage" id="cover_default">
<property name="icon-name">image-x-generic-symbolic</property> <property name="icon-name">image-x-generic-symbolic</property>
<property name="icon-size">large</property>
</object> </object>
</child> </child>
<child> <child>

View file

@ -10,7 +10,6 @@ gi.require_version('Adw', '1')
from gi.repository import Gio, Gtk, Gdk, GLib, Adw from gi.repository import Gio, Gtk, Gdk, GLib, Adw
from .window import Window from .window import Window
#from .infodialog import InfoDialog

View file

@ -36,14 +36,6 @@ class ConnectionPanel(Adw.Bin):
self._zeroconf_provider.connect_signal(ZeroconfProvider.SIGNAL_SERVICE_NEW, self.on_new_service) self._zeroconf_provider.connect_signal(ZeroconfProvider.SIGNAL_SERVICE_NEW, self.on_new_service)
def get_toolbar(self):
return self.toolbar
def set_selected(self, selected):
pass
def on_new_service(self, service): def on_new_service(self, service):
name, host, port = service name, host, port = service

View file

@ -55,10 +55,6 @@ class CoverPanel(Gtk.Overlay):
self._icon_theme = Gtk.IconTheme.get_for_display(Gdk.Display.get_default()) self._icon_theme = Gtk.IconTheme.get_for_display(Gdk.Display.get_default())
self._fullscreened = False self._fullscreened = False
self._current_size = None self._current_size = None
#self._cover_pixbuf = self._get_default_image()
# Widgets
self.cover_stack.set_visible_child(self.cover_scroll)
# Initial actions # Initial actions
GObject.idle_add(self._enable_tracklist) GObject.idle_add(self._enable_tracklist)

View file

@ -329,15 +329,6 @@ class LibraryPanel(Adw.Bin):
def _set_albums(self, host, albums, size): def _set_albums(self, host, albums, size):
"""
if not self._is_selected and albums != self._albums:
GObject.idle_add(
self.get_parent().child_set_property,
self,
'needs-attention',
True
)
"""
self._library_lock.acquire() self._library_lock.acquire()
self._albums = albums self._albums = albums
stack_transition_type = self.stack.get_transition_type() stack_transition_type = self.stack.get_transition_type()

View file

@ -199,15 +199,6 @@ class PlaylistPanel(Adw.Bin):
def _set_playlist(self, host, playlist, size): def _set_playlist(self, host, playlist, size):
"""
if not self._is_selected and self._playlist != playlist:
GObject.idle_add(
self.get_parent().child_set_property,
self,
'needs-attention',
True
)
"""
self._playlist_lock.acquire() self._playlist_lock.acquire()
self._playlist_stop.clear() self._playlist_stop.clear()
self._playlist = playlist self._playlist = playlist

View file

@ -66,9 +66,7 @@ class Window(Adw.ApplicationWindow):
toolbar_stack = Gtk.Template.Child() toolbar_stack = Gtk.Template.Child()
# Headerbar # Headerbar
headerbar = Gtk.Template.Child() headerbar = Gtk.Template.Child()
#headerbar_title_stack = Gtk.Template.Child()
headerbar_panel_switcher = Gtk.Template.Child() headerbar_panel_switcher = Gtk.Template.Child()
#headerbar_connection_label = Gtk.Template.Child()
headerbar_button_connect = Gtk.Template.Child() headerbar_button_connect = Gtk.Template.Child()
headerbar_button_playpause = Gtk.Template.Child() headerbar_button_playpause = Gtk.Template.Child()
headerbar_button_volume = Gtk.Template.Child() headerbar_button_volume = Gtk.Template.Child()
@ -115,9 +113,6 @@ class Window(Adw.ApplicationWindow):
self.panel_stack.add_titled_with_icon(self._cover_panel, 'cover-panel', locale.gettext("Cover"), "image-x-generic-symbolic") self.panel_stack.add_titled_with_icon(self._cover_panel, 'cover-panel', locale.gettext("Cover"), "image-x-generic-symbolic")
self.panel_stack.add_titled_with_icon(self._playlist_panel, 'playlist-panel', locale.gettext("Playlist"), "view-list-symbolic") self.panel_stack.add_titled_with_icon(self._playlist_panel, 'playlist-panel', locale.gettext("Playlist"), "view-list-symbolic")
self.panel_stack.add_titled_with_icon(self._library_panel, 'library-panel', locale.gettext("Library"), "emblem-music-symbolic") self.panel_stack.add_titled_with_icon(self._library_panel, 'library-panel', locale.gettext("Library"), "emblem-music-symbolic")
# Header
#self._playlist_panel.get_headerbar_standalone().connect('close', self.on_panel_close_standalone)
#self._library_panel.get_headerbar_standalone().connect('close', self.on_panel_close_standalone)
# Toolbar stack # Toolbar stack
self.toolbar_stack.add_child(self._server_panel.get_toolbar()) self.toolbar_stack.add_child(self._server_panel.get_toolbar())
self.toolbar_stack.add_child(self._cover_panel.get_toolbar()) self.toolbar_stack.add_child(self._cover_panel.get_toolbar())
@ -296,12 +291,6 @@ class Window(Adw.ApplicationWindow):
self._set_menu_visible_panel() self._set_menu_visible_panel()
for panel in self._panels: for panel in self._panels:
panel.set_selected(panel == self.panel_stack.get_visible_child()) panel.set_selected(panel == self.panel_stack.get_visible_child())
#GObject.idle_add(
# self.panel_stack.child_set_property,
# self.panel_stack.get_visible_child(),
# 'needs-attention',
# False
#)
def on_panel_open_standalone(self, panel): def on_panel_open_standalone(self, panel):
@ -473,20 +462,6 @@ class Window(Adw.ApplicationWindow):
self._library_panel.set_albumart(album, data) self._library_panel.set_albumart(album, data)
def on_mcg_custom(self, name):
pass
"""
if name == Window._CUSTOM_STARTUP_COMPLETE:
for panel in self._panels:
GObject.idle_add(
self.panel_stack.child_set_property,
panel,
'needs-attention',
False
)
"""
def on_mcg_error(self, error): def on_mcg_error(self, error):
GObject.idle_add(self._show_error, str(error)) GObject.idle_add(self._show_error, str(error))