blueprint-compiler format

This commit is contained in:
Erica Z 2024-11-05 09:29:08 +01:00
parent 630b44b352
commit f016778f5e
5 changed files with 109 additions and 75 deletions

View file

@ -27,7 +27,6 @@ template $AudreyUiPlayQueue: Adw.Bin {
ListView view {
show-separators: true;
single-click-activate: true;
activate => $on_row_activated() swapped;
model: NoSelection {

View file

@ -24,7 +24,11 @@ template $AudreyUiPlayQueueSong: Box {
focusable: false;
halign: end;
justify: right;
styles [ "dim-label", "numeric" ]
styles [
"dim-label",
"numeric"
]
label: bind template.displayed_position;
}
@ -39,17 +43,26 @@ template $AudreyUiPlayQueueSong: Box {
}
Box title_box {
styles [ "header"]
styles [
"header"
]
focusable: false;
hexpand: true;
valign: center;
Box {
styles [ "title" ]
styles [
"title"
]
orientation: vertical;
Label {
styles [ "title" ]
styles [
"title"
]
focusable: false;
xalign: 0;
halign: start;
@ -57,12 +70,14 @@ template $AudreyUiPlayQueueSong: Box {
ellipsize: end;
max-width-chars: 90;
justify: fill;
label: bind template.song as <$AudreyPlaybinSong>.title;
}
Label {
styles [ "subtitle" ]
styles [
"subtitle"
]
focusable: false;
xalign: 0;
halign: start;
@ -70,7 +85,6 @@ template $AudreyUiPlayQueueSong: Box {
ellipsize: end;
max-width-chars: 90;
justify: fill;
label: bind template.song as <$AudreyPlaybinSong>.artist;
}
}
@ -81,7 +95,11 @@ template $AudreyUiPlayQueueSong: Box {
halign: end;
hexpand: true;
single-line-mode: true;
styles [ "numeric", "dim-label" ]
styles [
"numeric",
"dim-label"
]
label: bind $format_duration(template.song as <$AudreyPlaybinSong>.duration) as <string>;
}
@ -90,7 +108,11 @@ template $AudreyUiPlayQueueSong: Box {
focusable: true;
// TODO icon-name: bind $star_button_icon_name (template.song as <$AudreyPlaybinSong>.starred) as <string>;
icon-name: bind $star_button_icon_name() as <string>;
styles [ "flat" ]
styles [
"flat"
]
valign: center;
}
@ -98,7 +120,11 @@ template $AudreyUiPlayQueueSong: Box {
// visible: false;
focusable: true;
icon-name: "view-more";
styles [ "flat" ]
styles [
"flat"
]
valign: center;
popover: PopoverMenu {
@ -109,7 +135,6 @@ template $AudreyUiPlayQueueSong: Box {
DragSource {
actions: move;
propagation-phase: capture;
prepare => $on_drag_prepare() swapped;
drag-begin => $on_drag_begin() swapped;
}
@ -118,7 +143,6 @@ template $AudreyUiPlayQueueSong: Box {
actions: move;
formats: "AudreyUiPlayQueueSong";
preload: true;
drop => $on_drop() swapped;
}
}

View file

@ -4,6 +4,7 @@ using Adw 1;
template $AudreyUiPlaybar: Adw.Bin {
child: CenterBox {
hexpand: true;
styles [
"toolbar",
]
@ -13,7 +14,6 @@ template $AudreyUiPlaybar: Adw.Bin {
AspectFrame {
visible: false; // FIXME annoying annoying annoying annoying
// visible: bind template.show_cover_art;
vexpand: true;
ratio: 1.0;
obey-child: false;
@ -30,7 +30,10 @@ template $AudreyUiPlaybar: Adw.Bin {
valign: center;
Label {
styles [ "heading" ]
styles [
"heading"
]
xalign: 0;
halign: start;
label: bind $song_title(template.song) as <string>;
@ -38,14 +41,20 @@ template $AudreyUiPlaybar: Adw.Bin {
}
Label {
styles [ "caption" ]
styles [
"caption"
]
xalign: 0;
label: bind $song_artist(template.song) as <string>;
ellipsize: end;
}
Label {
styles [ "caption" ]
styles [
"caption"
]
xalign: 0;
label: bind $song_album(template.song) as <string>;
ellipsize: end;
@ -75,7 +84,6 @@ template $AudreyUiPlaybar: Adw.Bin {
orientation: horizontal;
width-request: 400;
// sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as <bool>;
adjustment: Adjustment {
lower: 0;
value: bind template.position;
@ -104,7 +112,6 @@ template $AudreyUiPlaybar: Adw.Bin {
icon-name: "media-skip-backward";
valign: center;
// sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as <bool>;
clicked => $on_skip_backward_clicked() swapped;
}
@ -112,7 +119,6 @@ template $AudreyUiPlaybar: Adw.Bin {
icon-name: "media-seek-backward";
valign: center;
// sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as <bool>;
clicked => $seek_backward() swapped;
}
@ -120,7 +126,6 @@ template $AudreyUiPlaybar: Adw.Bin {
icon-name: bind $play_pause_icon_name(template.idle-active, template.pause) as <string>;
valign: center;
// sensitive: bind $can_press_play (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>, template.playbin as <$AudreyPlaybin>.play-queue-length) as <bool>;
clicked => $on_play_pause_clicked() swapped;
}
@ -128,7 +133,6 @@ template $AudreyUiPlaybar: Adw.Bin {
icon-name: "media-seek-forward";
valign: center;
// sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as <bool>;
clicked => $seek_forward() swapped;
}
@ -136,7 +140,6 @@ template $AudreyUiPlaybar: Adw.Bin {
icon-name: "media-skip-forward";
valign: center;
// sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as <bool>;
clicked => $on_skip_forward_clicked() swapped;
}
}
@ -152,7 +155,6 @@ template $AudreyUiPlaybar: Adw.Bin {
Button {
icon-name: bind $mute_button_icon_name(template.mute) as <string>;
valign: center;
clicked => $on_mute_toggle() swapped;
}

View file

@ -14,7 +14,10 @@ template $AudreyUiSetup: Adw.PreferencesDialog {
[header-suffix]
Gtk.Button {
styles [ "flat" ]
styles [
"flat"
]
icon-name: "edit-undo";
sensitive: bind template.authn_can_validate;
}
@ -24,7 +27,6 @@ template $AudreyUiSetup: Adw.PreferencesDialog {
input-purpose: url;
sensitive: bind template.authn_can_edit;
text: bind template.server_url bidirectional;
changed => $on_authn_changed() swapped;
}
@ -32,7 +34,6 @@ template $AudreyUiSetup: Adw.PreferencesDialog {
title: _("Username");
sensitive: bind template.authn_can_edit;
text: bind template.username bidirectional;
changed => $on_authn_changed() swapped;
}
@ -40,7 +41,6 @@ template $AudreyUiSetup: Adw.PreferencesDialog {
title: _("Password");
sensitive: bind template.authn_can_edit;
text: bind template.password bidirectional;
changed => $on_authn_changed() swapped;
}
@ -56,7 +56,6 @@ template $AudreyUiSetup: Adw.PreferencesDialog {
Adw.ButtonRow {
title: _("Connect and save");
sensitive: bind template.authn_can_validate;
activated => $on_authn_validate_activated() swapped;
}
}

View file

@ -33,6 +33,7 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
content: Adw.ViewStack stack {
vexpand: true;
Adw.ViewStackPage {
icon-name: "media-optical-cd";
title: _("Albums");
@ -45,11 +46,14 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
child: Adw.ToolbarView {
[top]
CenterBox {
styles [ "toolbar" ]
styles [
"toolbar"
]
[start]
DropDown {
selected: 0;
model: StringList {
strings [
_("Random"),
@ -78,6 +82,7 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
ScrolledWindow {
vexpand: true;
GridView {}
}
};
@ -103,7 +108,11 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
Picture {
valign: center;
styles [ "frame" ]
styles [
"frame"
]
halign: center;
paintable: bind template.playing_cover_art;
}
@ -112,13 +121,15 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
$AudreyUiPlayQueue play_queue {
hexpand: true;
halign: fill;
margin-top: 48;
margin-bottom: 48;
margin-start: 24;
margin-end: 24;
styles [ "frame" ]
styles [
"frame"
]
model: bind template.playlist_model;
playlist-pos: bind template.playlist-pos;
// playbin: bind template.playbin;
@ -132,7 +143,6 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
song: bind template.song;
playing_cover_art: bind template.playing_cover_art;
show_cover_art: bind $show_playbar_cover_art(stack.visible-child-name) as <bool>;
volume: bind template.volume bidirectional;
mute: bind template.mute bidirectional;
pause: bind template.pause bidirectional;