From f016778f5eba8cb1f8bcfcde7ecf1a0462a53d54 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Tue, 5 Nov 2024 09:29:08 +0100 Subject: [PATCH] blueprint-compiler format --- resources/play_queue.blp | 11 +++--- resources/play_queue_song.blp | 62 ++++++++++++++++++++++---------- resources/playbar.blp | 66 ++++++++++++++++++----------------- resources/setup.blp | 17 +++++---- resources/window.blp | 28 ++++++++++----- 5 files changed, 109 insertions(+), 75 deletions(-) diff --git a/resources/play_queue.blp b/resources/play_queue.blp index 5d95042..0a3974c 100644 --- a/resources/play_queue.blp +++ b/resources/play_queue.blp @@ -5,7 +5,7 @@ template $AudreyUiPlayQueue: Adw.Bin { name: "play-queue"; child: Stack { - visible-child-name: bind $visible_child_name (template.model as <$GListStore>.n-items) as ; + visible-child-name: bind $visible_child_name(template.model as <$GListStore>.n-items) as ; StackPage { name: "empty"; @@ -27,17 +27,16 @@ template $AudreyUiPlayQueue: Adw.Bin { ListView view { show-separators: true; single-click-activate: true; - - activate => $on_row_activated () swapped; + 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; + setup => $on_song_list_setup() swapped; + bind => $on_song_list_bind() swapped; + unbind => $on_song_list_unbind() swapped; }; } }; diff --git a/resources/play_queue_song.blp b/resources/play_queue_song.blp index 48e5637..e6a30bc 100644 --- a/resources/play_queue_song.blp +++ b/resources/play_queue_song.blp @@ -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; } @@ -35,21 +39,30 @@ template $AudreyUiPlayQueueSong: Box { margin-top: 1; margin-bottom: 1; pixel-size: 50; - //paintable: bind template.song as <$AudreyPlaybinSong>.thumbnail; + // paintable: bind template.song as <$AudreyPlaybinSong>.thumbnail; } 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,24 +95,36 @@ template $AudreyUiPlayQueueSong: Box { halign: end; hexpand: true; single-line-mode: true; - styles [ "numeric", "dim-label" ] - label: bind $format_duration (template.song as <$AudreyPlaybinSong>.duration) as ; + styles [ + "numeric", + "dim-label" + ] + + label: bind $format_duration(template.song as <$AudreyPlaybinSong>.duration) as ; } Button { focusable: true; // TODO icon-name: bind $star_button_icon_name (template.song as <$AudreyPlaybinSong>.starred) as ; - icon-name: bind $star_button_icon_name () as ; - styles [ "flat" ] + icon-name: bind $star_button_icon_name() as ; + + styles [ + "flat" + ] + valign: center; } MenuButton { - //visible: false; + // visible: false; focusable: true; icon-name: "view-more"; - styles [ "flat" ] + + styles [ + "flat" + ] + valign: center; popover: PopoverMenu { @@ -109,17 +135,15 @@ template $AudreyUiPlayQueueSong: Box { DragSource { actions: move; propagation-phase: capture; - - prepare => $on_drag_prepare () swapped; - drag-begin => $on_drag_begin () swapped; + prepare => $on_drag_prepare() swapped; + drag-begin => $on_drag_begin() swapped; } DropTarget { actions: move; formats: "AudreyUiPlayQueueSong"; preload: true; - - drop => $on_drop () swapped; + drop => $on_drop() swapped; } } diff --git a/resources/playbar.blp b/resources/playbar.blp index 12822e7..ee021c5 100644 --- a/resources/playbar.blp +++ b/resources/playbar.blp @@ -4,6 +4,7 @@ using Adw 1; template $AudreyUiPlaybar: Adw.Bin { child: CenterBox { hexpand: true; + styles [ "toolbar", ] @@ -12,8 +13,7 @@ template $AudreyUiPlaybar: Adw.Bin { Box { AspectFrame { visible: false; // FIXME annoying annoying annoying annoying - //visible: bind template.show_cover_art; - + // visible: bind template.show_cover_art; vexpand: true; ratio: 1.0; obey-child: false; @@ -30,24 +30,33 @@ template $AudreyUiPlaybar: Adw.Bin { valign: center; Label { - styles [ "heading" ] + styles [ + "heading" + ] + xalign: 0; halign: start; - label: bind $song_title (template.song) as ; + label: bind $song_title(template.song) as ; ellipsize: end; } Label { - styles [ "caption" ] + styles [ + "caption" + ] + xalign: 0; - label: bind $song_artist (template.song) as ; + label: bind $song_artist(template.song) as ; ellipsize: end; } Label { - styles [ "caption" ] + styles [ + "caption" + ] + xalign: 0; - label: bind $song_album (template.song) as ; + label: bind $song_album(template.song) as ; ellipsize: end; } } @@ -66,7 +75,7 @@ template $AudreyUiPlaybar: Adw.Bin { "numeric", ] - label: bind $format_timestamp (template.position) as ; + label: bind $format_timestamp(template.position) as ; } [center] @@ -74,15 +83,14 @@ template $AudreyUiPlaybar: Adw.Bin { name: "seek-scale"; orientation: horizontal; width-request: 400; - //sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as ; - + // sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as ; adjustment: Adjustment { lower: 0; value: bind template.position; upper: bind template.duration; }; - change-value => $on_play_position_seek () swapped; + change-value => $on_play_position_seek() swapped; } [end] @@ -92,7 +100,7 @@ template $AudreyUiPlaybar: Adw.Bin { "numeric", ] - label: bind $format_timestamp (template.duration) as ; + label: bind $format_timestamp(template.duration) as ; } } @@ -103,41 +111,36 @@ template $AudreyUiPlaybar: Adw.Bin { Button { icon-name: "media-skip-backward"; valign: center; - //sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as ; - - clicked => $on_skip_backward_clicked () swapped; + // sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as ; + clicked => $on_skip_backward_clicked() swapped; } Button { icon-name: "media-seek-backward"; valign: center; - //sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as ; - - clicked => $seek_backward () swapped; + // sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as ; + clicked => $seek_backward() swapped; } Button { - icon-name: bind $play_pause_icon_name (template.idle-active, template.pause) as ; + icon-name: bind $play_pause_icon_name(template.idle-active, template.pause) as ; valign: center; - //sensitive: bind $can_press_play (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>, template.playbin as <$AudreyPlaybin>.play-queue-length) as ; - - clicked => $on_play_pause_clicked () swapped; + // sensitive: bind $can_press_play (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>, template.playbin as <$AudreyPlaybin>.play-queue-length) as ; + clicked => $on_play_pause_clicked() swapped; } Button { icon-name: "media-seek-forward"; valign: center; - //sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as ; - - clicked => $seek_forward () swapped; + // sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as ; + clicked => $seek_forward() swapped; } Button { icon-name: "media-skip-forward"; valign: center; - //sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as ; - - clicked => $on_skip_forward_clicked () swapped; + // sensitive: bind $playbin_active (template.playbin as <$AudreyPlaybin>.state as <$AudreyPlaybinState>) as ; + clicked => $on_skip_forward_clicked() swapped; } } } @@ -150,10 +153,9 @@ template $AudreyUiPlaybar: Adw.Bin { } Button { - icon-name: bind $mute_button_icon_name (template.mute) as ; + icon-name: bind $mute_button_icon_name(template.mute) as ; valign: center; - - clicked => $on_mute_toggle () swapped; + clicked => $on_mute_toggle() swapped; } Scale { diff --git a/resources/setup.blp b/resources/setup.blp index c70831d..6032305 100644 --- a/resources/setup.blp +++ b/resources/setup.blp @@ -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,24 +27,21 @@ template $AudreyUiSetup: Adw.PreferencesDialog { input-purpose: url; sensitive: bind template.authn_can_edit; text: bind template.server_url bidirectional; - - changed => $on_authn_changed () swapped; + changed => $on_authn_changed() swapped; } Adw.EntryRow { title: _("Username"); sensitive: bind template.authn_can_edit; text: bind template.username bidirectional; - - changed => $on_authn_changed () swapped; + changed => $on_authn_changed() swapped; } Adw.PasswordEntryRow { title: _("Password"); sensitive: bind template.authn_can_edit; text: bind template.password bidirectional; - - changed => $on_authn_changed () swapped; + changed => $on_authn_changed() swapped; } Adw.ActionRow { @@ -56,8 +56,7 @@ template $AudreyUiSetup: Adw.PreferencesDialog { Adw.ButtonRow { title: _("Connect and save"); sensitive: bind template.authn_can_validate; - - activated => $on_authn_validate_activated () swapped; + activated => $on_authn_validate_activated() swapped; } } } diff --git a/resources/window.blp b/resources/window.blp index 30991b3..df4f5cb 100644 --- a/resources/window.blp +++ b/resources/window.blp @@ -16,7 +16,7 @@ template $AudreyUiWindow: Adw.ApplicationWindow { Button { icon-name: "media-playlist-shuffle"; sensitive: bind template.can_click_shuffle_all; - clicked => $shuffle_all () swapped; + clicked => $shuffle_all() swapped; } title-widget: Adw.ViewSwitcher { @@ -27,12 +27,13 @@ template $AudreyUiWindow: Adw.ApplicationWindow { [end] Button { icon-name: "applications-system"; - clicked => $show_setup_dialog () swapped; + clicked => $show_setup_dialog() swapped; } } 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,16 +121,18 @@ 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; + // playbin: bind template.playbin; } }; } @@ -131,8 +142,7 @@ template $AudreyUiWindow: Adw.ApplicationWindow { $AudreyUiPlaybar playbar { 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 ; - + show_cover_art: bind $show_playbar_cover_art(stack.visible-child-name) as ; volume: bind template.volume bidirectional; mute: bind template.mute bidirectional; pause: bind template.pause bidirectional;