aboutsummaryrefslogtreecommitdiff
path: root/src/player.rs
diff options
context:
space:
mode:
authorMalte Voos <git@mal.tc>2025-10-07 20:57:48 +0200
committerMalte Voos <git@mal.tc>2025-10-07 20:57:48 +0200
commitee29a3b1291e9cedd8b54c31fa9f273e39f51970 (patch)
treee41665482ef2668e0313adc9701f03384152b208 /src/player.rs
parent8aa48d67b0908b62d012b589df9b35f2f8551968 (diff)
downloadlleap-ee29a3b1291e9cedd8b54c31fa9f273e39f51970.tar.gz
lleap-ee29a3b1291e9cedd8b54c31fa9f273e39f51970.zip
revamp subtitle selection
Diffstat (limited to 'src/player.rs')
-rw-r--r--src/player.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/player.rs b/src/player.rs
index c784a04..2e234b6 100644
--- a/src/player.rs
+++ b/src/player.rs
@@ -37,6 +37,7 @@ pub enum PlayerMsg {
#[derive(Debug)]
pub enum PlayerOutput {
PositionUpdate(gst::ClockTime),
+ SubtitleSelectionButtonPressed,
}
fn format_time(time: gst::ClockTime) -> String {
@@ -74,12 +75,10 @@ impl SimpleComponent for Player {
set_margin_all: 10,
// Play/Pause button
- #[name = "play_pause_btn"]
gtk::Button {
#[watch]
- set_icon_name: if model.is_playing { "media-playback-pause" } else { "media-playback-start" },
+ set_icon_name: if model.is_playing { "media-playback-pause-symbolic" } else { "media-playback-start-symbolic" },
connect_clicked => PlayerMsg::PlayPause,
- add_css_class: "circular",
},
// Current time label
@@ -116,6 +115,14 @@ impl SimpleComponent for Player {
set_text: &format_time(model.duration),
set_width_chars: 8,
},
+
+ // Subtitle selection button
+ gtk::Button {
+ set_icon_name: "media-view-subtitles-symbolic",
+ connect_clicked[sender] => move |_| {
+ sender.output(PlayerOutput::SubtitleSelectionButtonPressed).unwrap();
+ },
+ },
}
}
}