Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
.DS_Store
/.vscode
12 changes: 8 additions & 4 deletions src/config/autostart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ impl AutoStartManager {
}

/// Check if auto-start is currently enabled
#[allow(dead_code)]
pub fn is_enabled(&self) -> Result<bool, AutoStartError> {
self.auto_launch
.is_enabled()
Expand All @@ -98,10 +97,15 @@ impl AutoStartManager {
/// # Arguments
/// * `enabled` - Whether auto-start should be enabled
pub fn sync_state(&self, enabled: bool) -> Result<(), AutoStartError> {
if enabled {
self.enable()
let current_enabled = self.is_enabled().unwrap_or(false);
if current_enabled != enabled {
if enabled {
self.enable()
} else {
self.disable()
}
} else {
self.disable()
Ok(())
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions src/gui/board/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ impl RopyBoard {
}

pub fn on_hide_action(&mut self, _: &Hide, window: &mut Window, cx: &mut Context<Self>) {
// If still in settings, exit settings view and refocus main board instead of hiding
if self.show_settings {
self.show_settings = false;
self.settings_max_history_input.update(cx, |input, cx| {
input.set_value("", window, cx);
});
self.settings_activation_key_input.update(cx, |input, cx| {
input.set_value("", window, cx);
});
window.focus(&self.focus_handle);
cx.notify();
return;
}

// If the search input is focused, return focus to the main component before hiding
if let Some(focused_handle) = window.focused(cx)
&& focused_handle == self.search_input.focus_handle(cx)
Expand Down