reorder things
This commit is contained in:
parent
72a985a9e4
commit
5f46cf2b77
5 changed files with 69 additions and 63 deletions
|
@ -2,39 +2,71 @@ using Gtk 4.0;
|
||||||
using Adw 1;
|
using Adw 1;
|
||||||
|
|
||||||
template $AudreyUiPlayQueue: Adw.Bin {
|
template $AudreyUiPlayQueue: Adw.Bin {
|
||||||
name: "play-queue";
|
child: Box {
|
||||||
|
name: "play-queue-page";
|
||||||
|
homogeneous: true;
|
||||||
|
|
||||||
child: Stack {
|
Adw.Clamp {
|
||||||
visible-child-name: bind $visible_child_name(template.model as <$GListStore>.n-items) as <string>;
|
halign: center;
|
||||||
|
margin-top: 24;
|
||||||
|
margin-bottom: 24;
|
||||||
|
margin-start: 24;
|
||||||
|
margin-end: 24;
|
||||||
|
|
||||||
StackPage {
|
Picture {
|
||||||
name: "empty";
|
valign: center;
|
||||||
|
|
||||||
child: Adw.StatusPage {
|
styles [
|
||||||
icon-name: "list-remove-all";
|
"frame"
|
||||||
title: "No songs queued";
|
]
|
||||||
};
|
|
||||||
|
halign: center;
|
||||||
|
paintable: bind template.playing-cover-art;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StackPage {
|
Adw.Bin {
|
||||||
name: "not-empty";
|
name: "play-queue";
|
||||||
|
hexpand: true;
|
||||||
|
halign: fill;
|
||||||
|
margin-top: 48;
|
||||||
|
margin-bottom: 48;
|
||||||
|
margin-start: 24;
|
||||||
|
margin-end: 24;
|
||||||
|
|
||||||
child: ScrolledWindow {
|
child: Stack {
|
||||||
hexpand: true;
|
visible-child-name: bind $visible_child_name(template.model as <$GListStore>.n-items) as <string>;
|
||||||
hscrollbar-policy: never;
|
|
||||||
|
|
||||||
ListView view {
|
StackPage {
|
||||||
single-click-activate: true;
|
name: "empty";
|
||||||
activate => $on_row_activated() swapped;
|
|
||||||
|
|
||||||
model: NoSelection {
|
child: Adw.StatusPage {
|
||||||
model: bind template.model;
|
icon-name: "list-remove-all";
|
||||||
|
title: "No songs queued";
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
factory: SignalListItemFactory {
|
StackPage {
|
||||||
setup => $on_song_list_setup() swapped;
|
name: "not-empty";
|
||||||
bind => $on_song_list_bind() swapped;
|
|
||||||
unbind => $on_song_list_unbind() swapped;
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,6 @@ template $AudreyUiPlayQueueSong: Box {
|
||||||
|
|
||||||
Box {
|
Box {
|
||||||
margin-start: 6;
|
margin-start: 6;
|
||||||
|
|
||||||
width-request: 36;
|
width-request: 36;
|
||||||
focusable: false;
|
focusable: false;
|
||||||
homogeneous: true;
|
homogeneous: true;
|
||||||
|
|
|
@ -8,6 +8,7 @@ template $AudreyUiPlaybar: Adw.Bin {
|
||||||
styles [
|
styles [
|
||||||
"osd"
|
"osd"
|
||||||
]
|
]
|
||||||
|
|
||||||
visible: bind template.show-pulse-bar;
|
visible: bind template.show-pulse-bar;
|
||||||
valign: start;
|
valign: start;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
|
||||||
default-height: 600;
|
default-height: 600;
|
||||||
|
|
||||||
Adw.ToolbarView {
|
Adw.ToolbarView {
|
||||||
|
|
||||||
[top]
|
[top]
|
||||||
Adw.HeaderBar {
|
Adw.HeaderBar {
|
||||||
[start]
|
[start]
|
||||||
|
@ -84,7 +83,10 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
|
||||||
vexpand: true;
|
vexpand: true;
|
||||||
|
|
||||||
GridView {
|
GridView {
|
||||||
styles [ "albums" ]
|
styles [
|
||||||
|
"albums"
|
||||||
|
]
|
||||||
|
|
||||||
single-click-activate: true;
|
single-click-activate: true;
|
||||||
|
|
||||||
model: NoSelection {
|
model: NoSelection {
|
||||||
|
@ -140,41 +142,11 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
|
||||||
title: _("Play queue");
|
title: _("Play queue");
|
||||||
name: "play-queue";
|
name: "play-queue";
|
||||||
|
|
||||||
child: Box {
|
child: $AudreyUiPlayQueue play_queue {
|
||||||
name: "play-queue-page";
|
model: bind template.playlist_model;
|
||||||
homogeneous: true;
|
playlist-pos: bind template.playlist-pos;
|
||||||
|
// playbin: bind template.playbin;
|
||||||
Adw.Clamp {
|
playing-cover-art: bind template.playing-cover-art;
|
||||||
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;
|
pub use song::Song;
|
||||||
|
|
||||||
mod imp {
|
mod imp {
|
||||||
use adw::{gio, glib, prelude::*, subclass::prelude::*};
|
use adw::{gdk, gio, glib, prelude::*, subclass::prelude::*};
|
||||||
use glib::{subclass::InitializingObject, WeakRef};
|
use glib::{subclass::InitializingObject, WeakRef};
|
||||||
use std::cell::Cell;
|
use std::cell::{Cell, RefCell};
|
||||||
use tracing::{event, Level};
|
use tracing::{event, Level};
|
||||||
|
|
||||||
#[derive(gtk::CompositeTemplate, glib::Properties, Default)]
|
#[derive(gtk::CompositeTemplate, glib::Properties, Default)]
|
||||||
|
@ -15,6 +15,8 @@ mod imp {
|
||||||
pub(super) model: WeakRef<gio::ListModel>,
|
pub(super) model: WeakRef<gio::ListModel>,
|
||||||
#[property(get, set)]
|
#[property(get, set)]
|
||||||
_playlist_pos: Cell<i64>,
|
_playlist_pos: Cell<i64>,
|
||||||
|
#[property(get, set)]
|
||||||
|
playing_cover_art: RefCell<Option<gdk::Paintable>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[glib::object_subclass]
|
#[glib::object_subclass]
|
||||||
|
|
Loading…
Reference in a new issue