Delete pause stubs
This commit is contained in:
parent
e58cb05025
commit
234a64de3d
3 changed files with 1 additions and 48 deletions
|
|
@ -210,34 +210,6 @@ fn build_hud_content(state: SharedState) -> gtk4::Box {
|
|||
|
||||
right_box.append(&battery_box);
|
||||
|
||||
// Pause button
|
||||
let pause_button = gtk4::Button::builder()
|
||||
.icon_name("media-playback-pause-symbolic")
|
||||
.has_frame(false)
|
||||
.tooltip_text("Pause session")
|
||||
.build();
|
||||
pause_button.add_css_class("control-button");
|
||||
|
||||
let state_for_pause = state.clone();
|
||||
pause_button.connect_clicked(move |btn| {
|
||||
let session_state = state_for_pause.session_state();
|
||||
if let Some(session_id) = session_state.session_id() {
|
||||
// Toggle pause state - this would need to send command to daemon
|
||||
// For now, just log
|
||||
tracing::info!("Pause toggled for session {}", session_id);
|
||||
}
|
||||
// Toggle icon
|
||||
let icon_name = btn.icon_name().unwrap_or_default();
|
||||
if icon_name == "media-playback-pause-symbolic" {
|
||||
btn.set_icon_name("media-playback-start-symbolic");
|
||||
btn.set_tooltip_text(Some("Resume session"));
|
||||
} else {
|
||||
btn.set_icon_name("media-playback-pause-symbolic");
|
||||
btn.set_tooltip_text(Some("Pause session"));
|
||||
}
|
||||
});
|
||||
right_box.append(&pause_button);
|
||||
|
||||
// Close button
|
||||
let close_button = gtk4::Button::builder()
|
||||
.icon_name("window-close-symbolic")
|
||||
|
|
@ -300,7 +272,6 @@ fn build_hud_content(state: SharedState) -> gtk4::Box {
|
|||
entry_name,
|
||||
started_at,
|
||||
time_limit_secs,
|
||||
paused,
|
||||
..
|
||||
} => {
|
||||
app_label_clone.set_text(entry_name);
|
||||
|
|
@ -310,7 +281,6 @@ fn build_hud_content(state: SharedState) -> gtk4::Box {
|
|||
limit.saturating_sub(elapsed)
|
||||
});
|
||||
time_display_clone.set_remaining(remaining);
|
||||
time_display_clone.set_paused(*paused);
|
||||
warning_box_clone.set_visible(false);
|
||||
}
|
||||
SessionState::Warning {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ pub enum SessionState {
|
|||
started_at: std::time::Instant,
|
||||
time_limit_secs: Option<u64>,
|
||||
time_remaining_secs: Option<u64>,
|
||||
paused: bool,
|
||||
},
|
||||
|
||||
/// Warning shown - time running low
|
||||
|
|
@ -163,7 +162,6 @@ impl SharedState {
|
|||
started_at: std::time::Instant::now(),
|
||||
time_limit_secs: time_remaining,
|
||||
time_remaining_secs: time_remaining,
|
||||
paused: false,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +224,6 @@ impl SharedState {
|
|||
started_at: std::time::Instant::now(),
|
||||
time_limit_secs: time_remaining,
|
||||
time_remaining_secs: time_remaining,
|
||||
paused: false,
|
||||
});
|
||||
} else {
|
||||
self.set_session_state(SessionState::NoSession);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ mod imp {
|
|||
pub label: RefCell<Option<gtk4::Label>>,
|
||||
pub total_secs: RefCell<Option<u64>>,
|
||||
pub remaining_secs: RefCell<Option<u64>>,
|
||||
pub paused: RefCell<bool>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
@ -76,28 +75,15 @@ impl TimeDisplay {
|
|||
self.update_display();
|
||||
}
|
||||
|
||||
/// Set paused state
|
||||
pub fn set_paused(&self, paused: bool) {
|
||||
let imp = self.imp();
|
||||
*imp.paused.borrow_mut() = paused;
|
||||
self.update_display();
|
||||
}
|
||||
|
||||
/// Update the display based on current state
|
||||
fn update_display(&self) {
|
||||
let imp = self.imp();
|
||||
|
||||
if let Some(label) = imp.label.borrow().as_ref() {
|
||||
let remaining = *imp.remaining_secs.borrow();
|
||||
let paused = *imp.paused.borrow();
|
||||
|
||||
let text = if let Some(secs) = remaining {
|
||||
let formatted = format_duration(secs);
|
||||
if paused {
|
||||
format!("{} ⏸", formatted)
|
||||
} else {
|
||||
formatted
|
||||
}
|
||||
format_duration(secs)
|
||||
} else {
|
||||
"--:--".to_string()
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue