2023-10-27 12:32:40 +02:00
|
|
|
using Gtk 4.0;
|
|
|
|
|
|
2025-03-01 19:11:14 +01:00
|
|
|
template $MusicusPlayerBar: Gtk.Box {
|
2023-10-27 12:32:40 +02:00
|
|
|
orientation: vertical;
|
|
|
|
|
margin-start: 6;
|
|
|
|
|
margin-end: 6;
|
|
|
|
|
margin-top: 12;
|
|
|
|
|
margin-bottom: 12;
|
|
|
|
|
spacing: 6;
|
|
|
|
|
|
2025-03-01 19:11:14 +01:00
|
|
|
styles [
|
|
|
|
|
"playerbar",
|
|
|
|
|
]
|
|
|
|
|
|
2023-10-27 12:32:40 +02:00
|
|
|
Gtk.Box {
|
|
|
|
|
spacing: 6;
|
2025-03-01 19:11:14 +01:00
|
|
|
|
2023-10-27 12:32:40 +02:00
|
|
|
Gtk.Box {
|
|
|
|
|
valign: center;
|
|
|
|
|
hexpand: true;
|
|
|
|
|
margin-start: 10;
|
|
|
|
|
orientation: vertical;
|
|
|
|
|
|
|
|
|
|
Gtk.Label title_label {
|
|
|
|
|
ellipsize: end;
|
2025-03-01 19:11:14 +01:00
|
|
|
wrap: true;
|
|
|
|
|
natural-wrap-mode: none;
|
|
|
|
|
lines: 2;
|
|
|
|
|
xalign: 0.0;
|
|
|
|
|
halign: start;
|
|
|
|
|
|
|
|
|
|
styles [
|
|
|
|
|
"title",
|
|
|
|
|
]
|
2023-10-27 12:32:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gtk.Label subtitle_label {
|
|
|
|
|
ellipsize: end;
|
2025-03-01 19:11:14 +01:00
|
|
|
wrap: true;
|
|
|
|
|
natural-wrap-mode: none;
|
|
|
|
|
lines: 2;
|
|
|
|
|
xalign: 0.0;
|
|
|
|
|
halign: start;
|
|
|
|
|
|
|
|
|
|
styles [
|
|
|
|
|
"subtitle",
|
|
|
|
|
"dim-label",
|
|
|
|
|
]
|
2023-10-27 12:32:40 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gtk.Button back_button {
|
|
|
|
|
icon-name: "media-skip-backward-symbolic";
|
2025-03-01 19:11:14 +01:00
|
|
|
valign: center;
|
2023-11-03 16:22:58 +01:00
|
|
|
clicked => $previous() swapped;
|
2025-03-01 19:11:14 +01:00
|
|
|
|
|
|
|
|
styles [
|
|
|
|
|
"circular",
|
|
|
|
|
"flat",
|
|
|
|
|
]
|
2023-10-27 12:32:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gtk.ToggleButton playlist_button {
|
|
|
|
|
icon-name: "playlist-symbolic";
|
2025-03-01 19:11:14 +01:00
|
|
|
valign: center;
|
2023-10-27 12:32:40 +02:00
|
|
|
clicked => $show_playlist() swapped;
|
2025-03-01 19:11:14 +01:00
|
|
|
|
|
|
|
|
styles [
|
|
|
|
|
"flat",
|
|
|
|
|
"circular",
|
|
|
|
|
]
|
2023-10-27 12:32:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gtk.Button forward_button {
|
|
|
|
|
valign: center;
|
|
|
|
|
icon-name: "media-skip-forward-symbolic";
|
2023-11-03 16:22:58 +01:00
|
|
|
clicked => $next() swapped;
|
2025-03-01 19:11:14 +01:00
|
|
|
|
|
|
|
|
styles [
|
|
|
|
|
"circular",
|
|
|
|
|
"flat",
|
|
|
|
|
]
|
2023-10-27 12:32:40 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gtk.Box {
|
|
|
|
|
spacing: 6;
|
|
|
|
|
|
|
|
|
|
Gtk.Button play_button {
|
|
|
|
|
valign: center;
|
|
|
|
|
icon-name: "media-playback-start-symbolic";
|
|
|
|
|
clicked => $play_pause() swapped;
|
2025-03-01 19:11:14 +01:00
|
|
|
|
|
|
|
|
styles [
|
|
|
|
|
"circular",
|
|
|
|
|
"flat",
|
|
|
|
|
]
|
2023-10-27 12:32:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gtk.Label current_time_label {
|
|
|
|
|
label: "00:00";
|
2025-03-01 19:11:14 +01:00
|
|
|
tooltip-text: _("Elapsed time");
|
|
|
|
|
valign: center;
|
|
|
|
|
|
|
|
|
|
styles [
|
|
|
|
|
"caption",
|
|
|
|
|
"numeric",
|
|
|
|
|
]
|
2023-10-27 12:32:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gtk.Scale slider {
|
|
|
|
|
valign: center;
|
|
|
|
|
hexpand: true;
|
2025-03-01 19:11:14 +01:00
|
|
|
|
2023-10-27 12:32:40 +02:00
|
|
|
adjustment: Gtk.Adjustment {
|
|
|
|
|
lower: 0;
|
|
|
|
|
upper: 1;
|
|
|
|
|
value: 0.2;
|
|
|
|
|
step-increment: 0.01;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gtk.Label remaining_time_label {
|
|
|
|
|
label: "01:00";
|
2025-03-01 19:11:14 +01:00
|
|
|
tooltip-text: _("Remaining time");
|
|
|
|
|
valign: center;
|
|
|
|
|
|
|
|
|
|
styles [
|
|
|
|
|
"caption",
|
|
|
|
|
"numeric",
|
|
|
|
|
]
|
2023-10-27 12:32:40 +02:00
|
|
|
}
|
|
|
|
|
}
|
2025-03-01 19:11:14 +01:00
|
|
|
}
|