feat #14740: start recording from the main window
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -355,12 +355,21 @@ pub fn show_main(app: &AppHandle) {
|
||||
show_and_focus(app, "main");
|
||||
}
|
||||
|
||||
/// Brings the floating window to the front (tray "Aufnahme manuell
|
||||
/// starten" while a recording runs).
|
||||
pub fn show_recorder(app: &AppHandle) {
|
||||
/// Brings the floating window to the front: the tray's "Aufnahme manuell
|
||||
/// starten" and the main window's record button both call this instead of
|
||||
/// starting a second recording when one is already running.
|
||||
pub fn focus_recorder(app: &AppHandle) {
|
||||
show_and_focus(app, "recorder");
|
||||
}
|
||||
|
||||
/// Main window record button while a recording already runs: shows/focuses
|
||||
/// the floating recorder window instead of starting another recording.
|
||||
/// Shares [`focus_recorder`] with the tray handler.
|
||||
#[tauri::command]
|
||||
pub fn show_recorder(app: AppHandle) {
|
||||
focus_recorder(&app);
|
||||
}
|
||||
|
||||
fn show_and_focus(app: &AppHandle, label: &str) {
|
||||
if let Some(window) = app.get_webview_window(label) {
|
||||
let _ = window.unminimize();
|
||||
|
||||
Reference in New Issue
Block a user