Compare commits

..

No commits in common. "8d57d942e8473fe111ac03ba5cd154d9f192a17f" and "418cf018843e488d72cef1bea02f0b7d90e40131" have entirely different histories.

4 changed files with 6 additions and 47 deletions

View file

@ -21,9 +21,11 @@ template $AudreyUiPlayQueue: Adw.Bin {
child: ScrolledWindow {
hexpand: true;
vscrollbar-policy: always;
hscrollbar-policy: never;
ListView view {
show-separators: true;
single-click-activate: true;
activate => $on_row_activated() swapped;

View file

@ -19,10 +19,6 @@
min-height: 15px;
}
#play-queue listview {
background-color: rgba(0,0,0,0);
}
/* make drag and drop indicator take up entire perimeter */
#play-queue listview row {
padding: 0;
@ -32,10 +28,6 @@
font-weight: bold;
}
gridview.albums {
background-color: rgba(0,0,0,0);
}
gridview.albums child {
margin: 10px;
}

View file

@ -7,6 +7,8 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
default-height: 600;
Adw.ToolbarView {
top-bar-style: raised;
bottom-bar-style: raised;
[top]
Adw.HeaderBar {

View file

@ -38,8 +38,6 @@ mod imp {
#[property(get, set, nullable)]
playing_cover_art: RefCell<Option<gdk::Paintable>>,
#[property(get, set, nullable)]
background: RefCell<Option<gdk::Paintable>>,
#[property(type = Option<Song>, get = Self::song, nullable)]
_song: (),
@ -114,7 +112,6 @@ mod imp {
play_queue: Default::default(),
can_click_shuffle_all: Cell::new(false),
playing_cover_art: Default::default(),
background: Default::default(),
_song: (),
setup: Default::default(),
api: Default::default(),
@ -276,18 +273,7 @@ mod imp {
}
}
impl WidgetImpl for Window {
fn snapshot(&self, snapshot: &gtk::Snapshot) {
if let Some(background) = self.background.borrow().as_ref() {
background.snapshot(
snapshot,
self.obj().width() as f64,
self.obj().height() as f64,
);
}
self.parent_snapshot(snapshot);
}
}
impl WidgetImpl for Window {}
impl WindowImpl for Window {}
@ -547,30 +533,7 @@ mod imp {
Some(song) if song.id() == song_id => {
let texture = gdk::Texture::from_bytes(&glib::Bytes::from_owned(bytes))
.expect("could not create texture from cover art for {song_id}");
window.set_playing_cover_art(Some(&texture.clone().into()));
// from g4music
let snapshot = gtk::Snapshot::new();
snapshot.push_blur(512.0 * 0.2);
snapshot.push_opacity(0.5);
texture.snapshot(&snapshot, 512.0, 512.0);
snapshot.pop();
snapshot.pop();
use gtk::graphene;
let rect = graphene::Rect::new(0.0, 0.0, 512.0, 512.0);
if let Some(node) = snapshot.clone().to_node() {
window.set_background(Some(
window
.native()
.unwrap()
.renderer()
.unwrap()
.render_texture(node, Some(&rect)),
));
} else {
todo!();
}
window.set_playing_cover_art(Some(texture));
}
_ => {
event!(