diff --git a/apps/desktop-gpui/locales/de.toml b/apps/desktop-gpui/locales/de.toml index b133a1bd89..22dc753c1a 100644 --- a/apps/desktop-gpui/locales/de.toml +++ b/apps/desktop-gpui/locales/de.toml @@ -367,7 +367,7 @@ screen_region = "Bildschirmbereich" [settings.options.post_studio] do_nothing = "Nichts tun" open_editor = "Editor öffnen" -show_cap = "Cap anzeigen" +show_overlay = "Im Overlay zeigen" [settings.options.post_screenshot] copy = "In die Zwischenablage kopieren" @@ -451,8 +451,8 @@ screenshot_open_editor_hint = "Erst beschriften" studio_do_nothing = "Nichts tun" studio_open_editor = "Editor öffnen" studio_open_editor_hint = "Sofort bearbeiten" -studio_show_cap = "Cap anzeigen" -studio_show_cap_hint = "Zurück zum Rekorder" +studio_show_overlay = "Overlay zeigen" +studio_show_overlay_hint = "Kopieren, teilen, exportieren" [settings.shortcuts.label] add_marker = "Marker hinzufügen" @@ -1152,6 +1152,35 @@ no_matching_windows = "Keine passenden Fenster" no_windows = "Keine Fenster gefunden" window = "Fenster" +[recordings_overlay] +close = "Schließen" +copy = "In die Zwischenablage kopieren" +copy_link = "Link zum Teilen kopieren" +create_link = "Link zum Teilen erstellen" +edit = "Bearbeiten" +export = "Exportieren" +open = "Öffnen" +retry = "Erneut versuchen" + +[recordings_overlay.progress] +choose_image = "Wähle, wo das Bild gespeichert wird" +choose_video = "Wähle, wohin das Video exportiert wird" +copied = "In die Zwischenablage kopiert" +copy_failed = "Kopieren fehlgeschlagen" +copying = "Wird in die Zwischenablage kopiert" +creating_link = "Link zum Teilen wird erstellt" +failed_hint = "Etwas ist schiefgelaufen. Versuchen Sie es erneut." +link_copied = "Link zum Teilen kopiert" +preparing = "Wird vorbereitet" +rendering_video = "Video wird gerendert" +save_failed = "Speichern fehlgeschlagen" +saved_image = "Bild gespeichert" +saved_video = "Video gespeichert" +saving_image = "Bild wird gespeichert" +saving_video = "Video wird gespeichert" +share_failed = "Link konnte nicht erstellt werden" +share_failed_hint = "Prüfen Sie Ihre Verbindung und versuchen Sie es erneut." + [controls] disk_full_resume = "Nicht genug Speicherplatz zum Fortsetzen. Geben Sie Speicher frei und versuchen Sie es erneut, oder drücken Sie Stopp, um zu speichern." low_storage = "Wenig Speicherplatz. Cap beendet die Aufnahme bald, um sie zu sichern." diff --git a/apps/desktop-gpui/locales/en.toml b/apps/desktop-gpui/locales/en.toml index 84a31e6c10..54fd45d934 100644 --- a/apps/desktop-gpui/locales/en.toml +++ b/apps/desktop-gpui/locales/en.toml @@ -369,7 +369,7 @@ screen_region = { text = "Screen region", max_px = 180, size = 12 } [settings.options.post_studio] do_nothing = "Do nothing" open_editor = "Open editor" -show_cap = "Show Cap" +show_overlay = "Show in overlay" [settings.options.post_screenshot] copy = "Copy to clipboard" @@ -453,8 +453,8 @@ screenshot_open_editor_hint = "Annotate first" studio_do_nothing = "Do nothing" studio_open_editor = "Open editor" studio_open_editor_hint = "Edit right away" -studio_show_cap = "Show Cap" -studio_show_cap_hint = "Back to the recorder" +studio_show_overlay = "Show overlay" +studio_show_overlay_hint = "Copy, share or export" [settings.shortcuts.label] add_marker = "Add marker" @@ -1154,6 +1154,35 @@ no_matching_windows = "No matching windows" no_windows = "No windows found" window = { text = "Window", max_px = 100, size = 12 } +[recordings_overlay] +close = "Close" +copy = "Copy to clipboard" +copy_link = "Copy shareable link" +create_link = "Create shareable link" +edit = "Edit" +export = "Export" +open = "Open" +retry = "Retry" + +[recordings_overlay.progress] +choose_image = "Choose where to save the image" +choose_video = "Choose where to export the video" +copied = "Copied to clipboard" +copy_failed = "Couldn't copy" +copying = "Copying to clipboard" +creating_link = "Creating shareable link" +failed_hint = "Something went wrong. Try again." +link_copied = "Shareable link copied" +preparing = "Preparing" +rendering_video = "Rendering video" +save_failed = "Couldn't save" +saved_image = "Image saved" +saved_video = "Video saved" +saving_image = "Saving image" +saving_video = "Saving video" +share_failed = "Couldn't create the link" +share_failed_hint = "Check your connection and try again." + [controls] disk_full_resume = "Not enough disk space to resume. Free up space and try again, or press Stop to save." low_storage = "Low storage. Cap will stop soon to save your recording." diff --git a/apps/desktop-gpui/locales/es.toml b/apps/desktop-gpui/locales/es.toml index e47aaa0215..2b9337782a 100644 --- a/apps/desktop-gpui/locales/es.toml +++ b/apps/desktop-gpui/locales/es.toml @@ -367,7 +367,7 @@ screen_region = "Región de pantalla" [settings.options.post_studio] do_nothing = "No hacer nada" open_editor = "Abrir el editor" -show_cap = "Mostrar Cap" +show_overlay = "Mostrar en superposición" [settings.options.post_screenshot] copy = "Copiar al portapapeles" @@ -451,8 +451,8 @@ screenshot_open_editor_hint = "Anotar primero" studio_do_nothing = "No hacer nada" studio_open_editor = "Abrir el editor" studio_open_editor_hint = "Editar enseguida" -studio_show_cap = "Mostrar Cap" -studio_show_cap_hint = "Volver a la grabadora" +studio_show_overlay = "Superposición" +studio_show_overlay_hint = "Copiar, compartir o exportar" [settings.shortcuts.label] add_marker = "Añadir marcador" @@ -1152,6 +1152,35 @@ no_matching_windows = "No hay ventanas que coincidan" no_windows = "No se encontraron ventanas" window = "Ventana" +[recordings_overlay] +close = "Cerrar" +copy = "Copiar al portapapeles" +copy_link = "Copiar enlace para compartir" +create_link = "Crear enlace para compartir" +edit = "Editar" +export = "Exportar" +open = "Abrir" +retry = "Reintentar" + +[recordings_overlay.progress] +choose_image = "Elige dónde guardar la imagen" +choose_video = "Elige dónde exportar el vídeo" +copied = "Copiado al portapapeles" +copy_failed = "No se pudo copiar" +copying = "Copiando al portapapeles" +creating_link = "Creando enlace para compartir" +failed_hint = "Algo salió mal. Inténtalo de nuevo." +link_copied = "Enlace para compartir copiado" +preparing = "Preparando" +rendering_video = "Renderizando vídeo" +save_failed = "No se pudo guardar" +saved_image = "Imagen guardada" +saved_video = "Vídeo guardado" +saving_image = "Guardando imagen" +saving_video = "Guardando vídeo" +share_failed = "No se pudo crear el enlace" +share_failed_hint = "Comprueba tu conexión e inténtalo de nuevo." + [controls] disk_full_resume = "No hay espacio suficiente para reanudar. Libera espacio e inténtalo de nuevo, o pulsa Detener para guardar." low_storage = "Poco almacenamiento. Cap se detendrá pronto para guardar tu grabación." diff --git a/apps/desktop-gpui/locales/fr.toml b/apps/desktop-gpui/locales/fr.toml index 130e417653..f34eab4213 100644 --- a/apps/desktop-gpui/locales/fr.toml +++ b/apps/desktop-gpui/locales/fr.toml @@ -367,7 +367,7 @@ screen_region = "Zone de l'écran" [settings.options.post_studio] do_nothing = "Ne rien faire" open_editor = "Ouvrir l'éditeur" -show_cap = "Afficher Cap" +show_overlay = "Afficher en superposition" [settings.options.post_screenshot] copy = "Copier dans le presse-papiers" @@ -451,8 +451,8 @@ screenshot_open_editor_hint = "Annoter d'abord" studio_do_nothing = "Ne rien faire" studio_open_editor = "Ouvrir l'éditeur" studio_open_editor_hint = "Modifier tout de suite" -studio_show_cap = "Afficher Cap" -studio_show_cap_hint = "Retour à l'enregistreur" +studio_show_overlay = "Superposition" +studio_show_overlay_hint = "Copier, partager, exporter" [settings.shortcuts.label] add_marker = "Ajouter un repère" @@ -1152,6 +1152,35 @@ no_matching_windows = "Aucune fenêtre correspondante" no_windows = "Aucune fenêtre trouvée" window = "Fenêtre" +[recordings_overlay] +close = "Fermer" +copy = "Copier dans le presse-papiers" +copy_link = "Copier le lien de partage" +create_link = "Créer un lien de partage" +edit = "Modifier" +export = "Exporter" +open = "Ouvrir" +retry = "Réessayer" + +[recordings_overlay.progress] +choose_image = "Choisissez où enregistrer l'image" +choose_video = "Choisissez où exporter la vidéo" +copied = "Copié dans le presse-papiers" +copy_failed = "Copie impossible" +copying = "Copie dans le presse-papiers" +creating_link = "Création du lien de partage" +failed_hint = "Un problème est survenu. Réessayez." +link_copied = "Lien de partage copié" +preparing = "Préparation" +rendering_video = "Rendu de la vidéo" +save_failed = "Enregistrement impossible" +saved_image = "Image enregistrée" +saved_video = "Vidéo enregistrée" +saving_image = "Enregistrement de l'image" +saving_video = "Enregistrement de la vidéo" +share_failed = "Impossible de créer le lien" +share_failed_hint = "Vérifiez votre connexion et réessayez." + [controls] disk_full_resume = "Espace disque insuffisant pour reprendre. Libérez de l'espace et réessayez, ou appuyez sur Arrêter pour enregistrer." low_storage = "Espace de stockage faible. Cap va bientôt s'arrêter pour préserver votre enregistrement." diff --git a/apps/desktop-gpui/locales/hi.toml b/apps/desktop-gpui/locales/hi.toml index 679436881a..5f338681a4 100644 --- a/apps/desktop-gpui/locales/hi.toml +++ b/apps/desktop-gpui/locales/hi.toml @@ -367,7 +367,7 @@ screen_region = "स्क्रीन क्षेत्र" [settings.options.post_studio] do_nothing = "कुछ न करें" open_editor = "एडिटर खोलें" -show_cap = "Cap दिखाएँ" +show_overlay = "ओवरले में दिखाएँ" [settings.options.post_screenshot] copy = "क्लिपबोर्ड पर कॉपी करें" @@ -451,8 +451,8 @@ screenshot_open_editor_hint = "पहले एनोटेट करें" studio_do_nothing = "कुछ न करें" studio_open_editor = "एडिटर खोलें" studio_open_editor_hint = "तुरंत एडिट करें" -studio_show_cap = "Cap दिखाएँ" -studio_show_cap_hint = "रिकॉर्डर पर वापस" +studio_show_overlay = "ओवरले दिखाएँ" +studio_show_overlay_hint = "कॉपी, शेयर या एक्सपोर्ट" [settings.shortcuts.label] add_marker = "मार्कर जोड़ें" @@ -1152,6 +1152,35 @@ no_matching_windows = "कोई मिलती-जुलती विंडो no_windows = "कोई विंडो नहीं मिली" window = "विंडो" +[recordings_overlay] +close = "बंद करें" +copy = "क्लिपबोर्ड पर कॉपी करें" +copy_link = "शेयर करने लायक लिंक कॉपी करें" +create_link = "शेयर करने लायक लिंक बनाएँ" +edit = "एडिट करें" +export = "एक्सपोर्ट करें" +open = "खोलें" +retry = "फिर से कोशिश करें" + +[recordings_overlay.progress] +choose_image = "चुनें कि इमेज कहाँ सेव करनी है" +choose_video = "चुनें कि वीडियो कहाँ एक्सपोर्ट करना है" +copied = "क्लिपबोर्ड पर कॉपी हो गया" +copy_failed = "कॉपी नहीं हो सका" +copying = "क्लिपबोर्ड पर कॉपी हो रहा है" +creating_link = "शेयर करने लायक लिंक बन रहा है" +failed_hint = "कुछ गलत हो गया। फिर से कोशिश करें।" +link_copied = "शेयर करने लायक लिंक कॉपी हो गया" +preparing = "तैयारी हो रही है" +rendering_video = "वीडियो रेंडर हो रहा है" +save_failed = "सेव नहीं हो सका" +saved_image = "इमेज सेव हो गई" +saved_video = "वीडियो सेव हो गया" +saving_image = "इमेज सेव हो रही है" +saving_video = "वीडियो सेव हो रहा है" +share_failed = "लिंक नहीं बन सका" +share_failed_hint = "अपना कनेक्शन जाँचें और फिर से कोशिश करें।" + [controls] disk_full_resume = "फिर से शुरू करने के लिए डिस्क में जगह कम है। जगह खाली करके फिर कोशिश करें, या सहेजने के लिए रोकें दबाएँ।" low_storage = "स्टोरेज कम है। आपकी रिकॉर्डिंग सहेजने के लिए Cap जल्द ही रुक जाएगा।" diff --git a/apps/desktop-gpui/locales/ja.toml b/apps/desktop-gpui/locales/ja.toml index 13b8e54ec7..688dcd9cf2 100644 --- a/apps/desktop-gpui/locales/ja.toml +++ b/apps/desktop-gpui/locales/ja.toml @@ -367,7 +367,7 @@ screen_region = "画面の範囲" [settings.options.post_studio] do_nothing = "何もしない" open_editor = "エディタを開く" -show_cap = "Capを表示" +show_overlay = "オーバーレイで表示" [settings.options.post_screenshot] copy = "クリップボードにコピー" @@ -451,8 +451,8 @@ screenshot_open_editor_hint = "先に注釈を付ける" studio_do_nothing = "何もしない" studio_open_editor = "エディタを開く" studio_open_editor_hint = "すぐに編集" -studio_show_cap = "Capを表示" -studio_show_cap_hint = "レコーダーに戻る" +studio_show_overlay = "オーバーレイを表示" +studio_show_overlay_hint = "コピー、共有、書き出し" [settings.shortcuts.label] add_marker = "マーカーを追加" @@ -1152,6 +1152,35 @@ no_matching_windows = "一致するウィンドウはありません" no_windows = "ウィンドウが見つかりません" window = "ウィンドウ" +[recordings_overlay] +close = "閉じる" +copy = "クリップボードにコピー" +copy_link = "共有リンクをコピー" +create_link = "共有リンクを作成" +edit = "編集" +export = "書き出し" +open = "開く" +retry = "再試行" + +[recordings_overlay.progress] +choose_image = "画像の保存先を選択" +choose_video = "動画の書き出し先を選択" +copied = "クリップボードにコピーしました" +copy_failed = "コピーできませんでした" +copying = "クリップボードにコピー中" +creating_link = "共有リンクを作成中" +failed_hint = "問題が発生しました。もう一度お試しください。" +link_copied = "共有リンクをコピーしました" +preparing = "準備中" +rendering_video = "動画をレンダリング中" +save_failed = "保存できませんでした" +saved_image = "画像を保存しました" +saved_video = "動画を保存しました" +saving_image = "画像を保存中" +saving_video = "動画を保存中" +share_failed = "リンクを作成できませんでした" +share_failed_hint = "接続を確認して、もう一度お試しください。" + [controls] disk_full_resume = "再開するための空き容量が足りません。空きを確保してもう一度試すか、停止を押して保存してください。" low_storage = "空き容量が不足しています。録画を保存するため、Capはまもなく停止します。" diff --git a/apps/desktop-gpui/locales/zh-CN.toml b/apps/desktop-gpui/locales/zh-CN.toml index f71059f3cf..7671fa5b35 100644 --- a/apps/desktop-gpui/locales/zh-CN.toml +++ b/apps/desktop-gpui/locales/zh-CN.toml @@ -367,7 +367,7 @@ screen_region = "屏幕区域" [settings.options.post_studio] do_nothing = "不执行任何操作" open_editor = "打开编辑器" -show_cap = "显示 Cap" +show_overlay = "在浮层中显示" [settings.options.post_screenshot] copy = "复制到剪贴板" @@ -451,8 +451,8 @@ screenshot_open_editor_hint = "先添加标注" studio_do_nothing = "不执行任何操作" studio_open_editor = "打开编辑器" studio_open_editor_hint = "立即编辑" -studio_show_cap = "显示 Cap" -studio_show_cap_hint = "回到录制器" +studio_show_overlay = "显示浮层" +studio_show_overlay_hint = "复制、分享或导出" [settings.shortcuts.label] add_marker = "添加标记" @@ -1152,6 +1152,35 @@ no_matching_windows = "没有匹配的窗口" no_windows = "未找到窗口" window = "窗口" +[recordings_overlay] +close = "关闭" +copy = "复制到剪贴板" +copy_link = "复制分享链接" +create_link = "创建分享链接" +edit = "编辑" +export = "导出" +open = "打开" +retry = "重试" + +[recordings_overlay.progress] +choose_image = "选择图片的保存位置" +choose_video = "选择视频的导出位置" +copied = "已复制到剪贴板" +copy_failed = "无法复制" +copying = "正在复制到剪贴板" +creating_link = "正在创建分享链接" +failed_hint = "出了点问题。请重试。" +link_copied = "已复制分享链接" +preparing = "正在准备" +rendering_video = "正在渲染视频" +save_failed = "无法保存" +saved_image = "图片已保存" +saved_video = "视频已保存" +saving_image = "正在保存图片" +saving_video = "正在保存视频" +share_failed = "无法创建链接" +share_failed_hint = "请检查网络连接后重试。" + [controls] disk_full_resume = "磁盘空间不足,无法继续。请释放空间后重试,或按“停止”保存。" low_storage = "存储空间不足。Cap 即将停止以保存你的录制。" diff --git a/apps/desktop-gpui/src/app_windows.rs b/apps/desktop-gpui/src/app_windows.rs index 846a861a3b..b344201978 100644 --- a/apps/desktop-gpui/src/app_windows.rs +++ b/apps/desktop-gpui/src/app_windows.rs @@ -150,7 +150,10 @@ fn platform_display_for_capture( found } -fn gpui_display_id(target: Option<&scap_targets::Display>, cx: &App) -> Option { +pub(crate) fn gpui_display_id( + target: Option<&scap_targets::Display>, + cx: &App, +) -> Option { #[cfg(target_os = "windows")] { target @@ -498,7 +501,7 @@ impl CameraPark { impl Global for AppWindows {} -fn remove_popup_window_chrome(native: Option, cx: &mut App) { +pub(crate) fn remove_popup_window_chrome(native: Option, cx: &mut App) { let Some(native) = native else { return; }; @@ -602,6 +605,7 @@ pub fn init(main: WindowHandle, session: Entity, c while thumbnails.recv_async().await.is_ok() { cx.update(|cx| { crate::tray::refresh_previous(cx); + crate::recordings_overlay::thumbnails_written(cx); refresh_library_after_delete(cx); crate::menus::recheck_pending_quit(cx); }); @@ -623,6 +627,9 @@ pub fn init(main: WindowHandle, session: Entity, c if phase == Phase::Stopping { open_preparing_studio_editor(&session, cx); } + if phase != Phase::Idle && last_phase == Phase::Idle { + crate::recordings_overlay::hide_for(crate::recordings_overlay::Capture::Recording, cx); + } if phase == Phase::Idle && last_phase != Phase::Idle { #[cfg(target_os = "linux")] if !session.read(cx).instant_cleanup_safe() { @@ -680,8 +687,10 @@ pub fn init(main: WindowHandle, session: Entity, c // to the editor, main window staying hidden -- // `editor_closed` brings it back once the last editor goes // away. `doNothing` leaves it in the library with Cap out of - // the way. Every other path (instant, failures, `showOverlay` - // until an overlay exists) reshows the main window as before. + // the way, and `showOverlay` puts the recording in the + // floating overlay with Cap kept out of the way the same. + // Every other path (instant, failures) reshows the main window + // as before. // A clean instant recording reshows it only for "Show Cap"; // otherwise the browser tab, or the copied link alone, is // the completion and Cap stays out of the way. A recording @@ -721,6 +730,11 @@ pub fn init(main: WindowHandle, session: Entity, c park_idle_camera_preview(cx); crate::menus::schedule_dock_sync(cx); } + (Some(project_dir), crate::store::PostStudioBehaviour::ShowOverlay) => { + crate::recordings_overlay::show_studio_recording(project_dir, cx); + park_idle_camera_preview(cx); + crate::menus::schedule_dock_sync(cx); + } (None, _) if keep_hidden_after_instant => { tracing::info!("main window kept hidden after the Instant recording"); park_idle_camera_preview(cx); @@ -750,6 +764,10 @@ pub fn init(main: WindowHandle, session: Entity, c // net effect too, where `restart_recording` clears it and the // immediately-following `start_recording` puts it straight back.) restore_content_protection(cx); + crate::recordings_overlay::show_after( + crate::recordings_overlay::Capture::Recording, + cx, + ); } last_phase = phase; }) @@ -7420,8 +7438,10 @@ fn open_controls( /// an overlay still on screen would be in the shot. Returns whether anything /// was up -- the caller's cue to wait the same 150ms the Tauri command waits. pub fn prepare_for_screenshot_capture(cx: &mut App) -> bool { + let overlay_was_visible = + crate::recordings_overlay::hide_for(crate::recordings_overlay::Capture::Screenshot, cx); if cx.global::().overlays.is_empty() { - return false; + return overlay_was_visible; } // The screenshot branch of `onRecordingStart` nulls the saved camera bounds // just like the recording branch does, so a parked bubble stays parked. @@ -7448,10 +7468,11 @@ pub fn empty_overlays_for_screenshot(cx: &mut App) -> Option = recordings.into_iter().collect(); for handle in overlays { let (sender, receiver) = tokio::sync::oneshot::channel(); let scheduled = handle.update(cx, |view, window, cx| { @@ -7497,9 +7518,16 @@ pub fn empty_overlays_for_screenshot(cx: &mut App) -> Option