Compare commits
No commits in common. "3940392f2d4f22b87f4d440016a6773b416a3199" and "72a985a9e4c939df11ea1bfe3adbf9c712010f5a" have entirely different histories.
3940392f2d
...
72a985a9e4
6 changed files with 55 additions and 62 deletions
|
@ -2,6 +2,8 @@ using Gtk 4.0;
|
|||
using Adw 1;
|
||||
|
||||
template $AudreyUiPlayQueue: Adw.Bin {
|
||||
name: "play-queue";
|
||||
|
||||
child: Stack {
|
||||
visible-child-name: bind $visible_child_name(template.model as <$GListStore>.n-items) as <string>;
|
||||
|
||||
|
@ -17,56 +19,22 @@ template $AudreyUiPlayQueue: Adw.Bin {
|
|||
StackPage {
|
||||
name: "not-empty";
|
||||
|
||||
child: Box {
|
||||
name: "play-queue-page";
|
||||
homogeneous: true;
|
||||
child: ScrolledWindow {
|
||||
hexpand: true;
|
||||
hscrollbar-policy: never;
|
||||
|
||||
Adw.Clamp {
|
||||
halign: center;
|
||||
margin-top: 24;
|
||||
margin-bottom: 24;
|
||||
margin-start: 24;
|
||||
margin-end: 24;
|
||||
ListView view {
|
||||
single-click-activate: true;
|
||||
activate => $on_row_activated() swapped;
|
||||
|
||||
Picture {
|
||||
valign: center;
|
||||
model: NoSelection {
|
||||
model: bind template.model;
|
||||
};
|
||||
|
||||
styles [
|
||||
"frame"
|
||||
]
|
||||
|
||||
halign: center;
|
||||
paintable: bind template.playing-cover-art;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.Bin {
|
||||
name: "play-queue";
|
||||
hexpand: true;
|
||||
halign: fill;
|
||||
margin-top: 48;
|
||||
margin-bottom: 48;
|
||||
margin-start: 24;
|
||||
margin-end: 24;
|
||||
|
||||
child: ScrolledWindow {
|
||||
hexpand: true;
|
||||
hscrollbar-policy: never;
|
||||
|
||||
ListView view {
|
||||
single-click-activate: true;
|
||||
activate => $on_row_activated() swapped;
|
||||
|
||||
model: NoSelection {
|
||||
model: bind template.model;
|
||||
};
|
||||
|
||||
factory: SignalListItemFactory {
|
||||
setup => $on_song_list_setup() swapped;
|
||||
bind => $on_song_list_bind() swapped;
|
||||
unbind => $on_song_list_unbind() swapped;
|
||||
};
|
||||
}
|
||||
factory: SignalListItemFactory {
|
||||
setup => $on_song_list_setup() swapped;
|
||||
bind => $on_song_list_bind() swapped;
|
||||
unbind => $on_song_list_unbind() swapped;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -6,6 +6,7 @@ template $AudreyUiPlayQueueSong: Box {
|
|||
|
||||
Box {
|
||||
margin-start: 6;
|
||||
|
||||
width-request: 36;
|
||||
focusable: false;
|
||||
homogeneous: true;
|
||||
|
|
|
@ -8,7 +8,6 @@ template $AudreyUiPlaybar: Adw.Bin {
|
|||
styles [
|
||||
"osd"
|
||||
]
|
||||
|
||||
visible: bind template.show-pulse-bar;
|
||||
valign: start;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
|
|||
default-height: 600;
|
||||
|
||||
Adw.ToolbarView {
|
||||
|
||||
[top]
|
||||
Adw.HeaderBar {
|
||||
[start]
|
||||
|
@ -83,10 +84,7 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
|
|||
vexpand: true;
|
||||
|
||||
GridView {
|
||||
styles [
|
||||
"albums"
|
||||
]
|
||||
|
||||
styles [ "albums" ]
|
||||
single-click-activate: true;
|
||||
|
||||
model: NoSelection {
|
||||
|
@ -142,11 +140,41 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
|
|||
title: _("Play queue");
|
||||
name: "play-queue";
|
||||
|
||||
child: $AudreyUiPlayQueue play_queue {
|
||||
model: bind template.playlist_model;
|
||||
playlist-pos: bind template.playlist-pos;
|
||||
// playbin: bind template.playbin;
|
||||
playing-cover-art: bind template.playing-cover-art;
|
||||
child: Box {
|
||||
name: "play-queue-page";
|
||||
homogeneous: true;
|
||||
|
||||
Adw.Clamp {
|
||||
halign: center;
|
||||
margin-top: 24;
|
||||
margin-bottom: 24;
|
||||
margin-start: 24;
|
||||
margin-end: 24;
|
||||
|
||||
Picture {
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"frame"
|
||||
]
|
||||
|
||||
halign: center;
|
||||
paintable: bind template.playing_cover_art;
|
||||
}
|
||||
}
|
||||
|
||||
$AudreyUiPlayQueue play_queue {
|
||||
hexpand: true;
|
||||
halign: fill;
|
||||
margin-top: 48;
|
||||
margin-bottom: 48;
|
||||
margin-start: 24;
|
||||
margin-end: 24;
|
||||
|
||||
model: bind template.playlist_model;
|
||||
playlist-pos: bind template.playlist-pos;
|
||||
// playbin: bind template.playbin;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,9 +2,9 @@ pub mod song;
|
|||
pub use song::Song;
|
||||
|
||||
mod imp {
|
||||
use adw::{gdk, gio, glib, prelude::*, subclass::prelude::*};
|
||||
use adw::{gio, glib, prelude::*, subclass::prelude::*};
|
||||
use glib::{subclass::InitializingObject, WeakRef};
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::cell::Cell;
|
||||
use tracing::{event, Level};
|
||||
|
||||
#[derive(gtk::CompositeTemplate, glib::Properties, Default)]
|
||||
|
@ -15,8 +15,6 @@ mod imp {
|
|||
pub(super) model: WeakRef<gio::ListModel>,
|
||||
#[property(get, set)]
|
||||
_playlist_pos: Cell<i64>,
|
||||
#[property(get, set)]
|
||||
playing_cover_art: RefCell<Option<gdk::Paintable>>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
|
@ -193,7 +193,6 @@ mod imp {
|
|||
match window.imp().state.get() {
|
||||
State::Idle | State::FileLoading | State::Seeking => {}
|
||||
State::Active => window.notify("time-pos"),
|
||||
State::FileEnded => {}
|
||||
other => unreachable!("{other:?}"),
|
||||
}
|
||||
glib::ControlFlow::Continue
|
||||
|
|
Loading…
Reference in a new issue