Small UI improvements

This commit is contained in:
Elias Projahn 2025-03-01 19:11:14 +01:00
parent 5f4e6113a3
commit d96bdf56e2
2 changed files with 65 additions and 20 deletions

View file

@ -1,7 +1,6 @@
using Gtk 4.0; using Gtk 4.0;
template $MusicusPlayerBar: Gtk.Box { template $MusicusPlayerBar: Gtk.Box {
styles ["playerbar"]
orientation: vertical; orientation: vertical;
margin-start: 6; margin-start: 6;
margin-end: 6; margin-end: 6;
@ -9,6 +8,10 @@ template $MusicusPlayerBar : Gtk.Box {
margin-bottom: 12; margin-bottom: 12;
spacing: 6; spacing: 6;
styles [
"playerbar",
]
Gtk.Box { Gtk.Box {
spacing: 6; spacing: 6;
@ -19,37 +22,64 @@ template $MusicusPlayerBar : Gtk.Box {
orientation: vertical; orientation: vertical;
Gtk.Label title_label { Gtk.Label title_label {
styles ["title"]
halign: start;
ellipsize: end; ellipsize: end;
wrap: true;
natural-wrap-mode: none;
lines: 2;
xalign: 0.0;
halign: start;
styles [
"title",
]
} }
Gtk.Label subtitle_label { Gtk.Label subtitle_label {
styles ["subtitle", "dim-label"]
halign: start;
ellipsize: end; ellipsize: end;
wrap: true;
natural-wrap-mode: none;
lines: 2;
xalign: 0.0;
halign: start;
styles [
"subtitle",
"dim-label",
]
} }
} }
Gtk.Button back_button { Gtk.Button back_button {
styles ["circular", "flat"]
valign: center;
icon-name: "media-skip-backward-symbolic"; icon-name: "media-skip-backward-symbolic";
valign: center;
clicked => $previous() swapped; clicked => $previous() swapped;
styles [
"circular",
"flat",
]
} }
Gtk.ToggleButton playlist_button { Gtk.ToggleButton playlist_button {
styles ["flat", "circular"]
valign: center;
icon-name: "playlist-symbolic"; icon-name: "playlist-symbolic";
valign: center;
clicked => $show_playlist() swapped; clicked => $show_playlist() swapped;
styles [
"flat",
"circular",
]
} }
Gtk.Button forward_button { Gtk.Button forward_button {
styles ["circular", "flat"]
valign: center; valign: center;
icon-name: "media-skip-forward-symbolic"; icon-name: "media-skip-forward-symbolic";
clicked => $next() swapped; clicked => $next() swapped;
styles [
"circular",
"flat",
]
} }
} }
@ -57,21 +87,31 @@ template $MusicusPlayerBar : Gtk.Box {
spacing: 6; spacing: 6;
Gtk.Button play_button { Gtk.Button play_button {
styles ["circular", "flat"]
valign: center; valign: center;
icon-name: "media-playback-start-symbolic"; icon-name: "media-playback-start-symbolic";
clicked => $play_pause() swapped; clicked => $play_pause() swapped;
styles [
"circular",
"flat",
]
} }
Gtk.Label current_time_label { Gtk.Label current_time_label {
styles ["caption", "numeric"]
valign: center;
label: "00:00"; label: "00:00";
tooltip-text: _("Elapsed time");
valign: center;
styles [
"caption",
"numeric",
]
} }
Gtk.Scale slider { Gtk.Scale slider {
valign: center; valign: center;
hexpand: true; hexpand: true;
adjustment: Gtk.Adjustment { adjustment: Gtk.Adjustment {
lower: 0; lower: 0;
upper: 1; upper: 1;
@ -81,9 +121,14 @@ template $MusicusPlayerBar : Gtk.Box {
} }
Gtk.Label remaining_time_label { Gtk.Label remaining_time_label {
styles ["caption", "numeric"]
valign: center;
label: "01:00"; label: "01:00";
tooltip-text: _("Remaining time");
valign: center;
styles [
"caption",
"numeric",
]
} }
} }
} }

View file

@ -20,7 +20,6 @@ template $MusicusPlaylistTile : Gtk.Box {
orientation: vertical; orientation: vertical;
Gtk.Label composers_label { Gtk.Label composers_label {
styles ["title-4"]
xalign: 0.0; xalign: 0.0;
wrap: true; wrap: true;
visible: false; visible: false;
@ -28,7 +27,7 @@ template $MusicusPlaylistTile : Gtk.Box {
} }
Gtk.Label work_label { Gtk.Label work_label {
styles ["title-2"] styles ["title-4"]
xalign: 0.0; xalign: 0.0;
wrap: true; wrap: true;
visible: false; visible: false;
@ -37,6 +36,7 @@ template $MusicusPlaylistTile : Gtk.Box {
} }
Gtk.Label performances_label { Gtk.Label performances_label {
styles ["caption"]
xalign: 0.0; xalign: 0.0;
wrap: true; wrap: true;
visible: false; visible: false;