Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

fix(screen-picker): keep capture preparation invisible

Ni-zav642baa07c512
diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv
index 13f954c3d..01a8b9e4d 100644
--- a/crates/ui-egui/src/i18n/cs.tsv
+++ b/crates/ui-egui/src/i18n/cs.tsv
@@ -2375,7 +2375,6 @@ cameraRaw Color Barvy
Sample a pixel anywhere on the screen Vzorkovat pixel kdekoli na obrazovce
Click to pick · Esc to cancel Kliknutí vybere · Esc zruší
Pick a screen pixel or press Esc to cancel Vyberte pixel obrazovky nebo stiskněte Esc pro zrušení
- Preparing screen capture… Příprava snímku obrazovky…
Scroll to zoom Rolováním přibližujte
Drag to pan · Scroll to zoom · Double-click to fit Tažením posouvejte · Rolováním přibližujte · Dvojklikem přizpůsobte
Show/Hide All Panels Zobrazit/skrýt všechny panely
diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv
index ee96014a1..489647ed2 100644
--- a/crates/ui-egui/src/i18n/de.tsv
+++ b/crates/ui-egui/src/i18n/de.tsv
@@ -2415,7 +2415,6 @@
Sample a pixel anywhere on the screen Ein Pixel an beliebiger Stelle auf dem Bildschirm auswählen
Click to pick · Esc to cancel Klicken zum Auswählen · Esc zum Abbrechen
Pick a screen pixel or press Esc to cancel Ein Bildschirmpixel auswählen oder mit Esc abbrechen
- Preparing screen capture… Bildschirmaufnahme wird vorbereitet…
Scroll to zoom Zum Zoomen scrollen
Drag to pan · Scroll to zoom · Double-click to fit Ziehen zum Verschieben · Scrollen zum Zoomen · Doppelklick zum Einpassen
Show/Hide All Panels Alle Bedienfelder ein-/ausblenden
diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv
index f60c7af7a..410da1a18 100644
--- a/crates/ui-egui/src/i18n/el.tsv
+++ b/crates/ui-egui/src/i18n/el.tsv
@@ -3553,7 +3553,6 @@ fontWeight Thin Πολύ λεπτά
# Screen color picker (#1232)
Pick screen color Επιλογή χρώματος οθόνης
Pick a screen pixel or press Esc to cancel Επιλέξτε ένα εικονοστοιχείο της οθόνης ή πατήστε Esc για ακύρωση
- Preparing screen capture… Προετοιμασία λήψης στιγμιότυπου οθόνης…
Sample a pixel anywhere on the screen Δειγματοληψία ενός pixel οπουδήποτε στην οθόνη
Click to pick · Esc to cancel Κλικ για επιλογή · Esc για ακύρωση
Scroll to zoom Κύλιση για μεγέθυνση
diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv
index f462f8916..b5db4e992 100644
--- a/crates/ui-egui/src/i18n/es.tsv
+++ b/crates/ui-egui/src/i18n/es.tsv
@@ -2446,7 +2446,6 @@ cameraRaw Amount Cantidad
Sample a pixel anywhere on the screen Tomar un píxel en cualquier lugar de la pantalla
Click to pick · Esc to cancel Clic para elegir · Esc para cancelar
Pick a screen pixel or press Esc to cancel Elija un píxel de la pantalla o pulse Esc para cancelar
- Preparing screen capture… Preparando captura de pantalla…
Scroll to zoom Desplace para ampliar
Drag to pan · Scroll to zoom · Double-click to fit Arrastre para desplazar · Desplace para ampliar · Doble clic para ajustar
Show/Hide All Panels Mostrar/ocultar todos los paneles
diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv
index da139e367..ab0cca6f4 100644
--- a/crates/ui-egui/src/i18n/fr.tsv
+++ b/crates/ui-egui/src/i18n/fr.tsv
@@ -2797,7 +2797,6 @@ cameraRaw Blending Fusion
Sample a pixel anywhere on the screen Prélever un pixel n’importe où sur l’écran
Click to pick · Esc to cancel Cliquer pour choisir · Échap pour annuler
Pick a screen pixel or press Esc to cancel Choisissez un pixel à l’écran ou appuyez sur Échap pour annuler
- Preparing screen capture… Préparation de la capture d’écran…
Scroll to zoom Défiler pour zoomer
Drag to pan · Scroll to zoom · Double-click to fit Glisser pour déplacer · Défiler pour zoomer · Double-cliquer pour ajuster
Show/Hide All Panels Afficher/masquer tous les panneaux
diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv
index 63cc685eb..9a7283a5a 100644
--- a/crates/ui-egui/src/i18n/hu.tsv
+++ b/crates/ui-egui/src/i18n/hu.tsv
@@ -3432,7 +3432,6 @@ cameraRaw Yellow Sárga
PhotoCraft — Screen Color Picker PhotoCraft — Képernyő-színválasztó
Photomerge Fotóegyesítés
Pick a screen pixel or press Esc to cancel Válassz egy pixelt a képernyőn, vagy nyomd meg az Esc billentyűt a megszakításhoz
- Preparing screen capture… Képernyőkép előkészítése…
Pick screen color Szín kiválasztása a képernyőről
Pick Color From Image Szín felvétele a képről
Pins Tűk
diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv
index 2717e9331..6924c4560 100644
--- a/crates/ui-egui/src/i18n/id.tsv
+++ b/crates/ui-egui/src/i18n/id.tsv
@@ -2784,7 +2784,6 @@ cameraRaw Blending Pembauran
Sample a pixel anywhere on the screen Ambil sampel piksel di mana saja pada layar
Click to pick · Esc to cancel Klik untuk memilih · Esc untuk membatalkan
Pick a screen pixel or press Esc to cancel Pilih piksel layar atau tekan Esc untuk membatalkan
- Preparing screen capture… Menyiapkan tangkapan layar…
Scroll to zoom Gulir untuk memperbesar
Drag to pan · Scroll to zoom · Double-click to fit Seret untuk menggeser · Gulir untuk memperbesar · Klik dua kali untuk menyesuaikan
Show/Hide All Panels Tampilkan/Sembunyikan Semua Panel
diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv
index ca0181461..2d42c550c 100644
--- a/crates/ui-egui/src/i18n/it.tsv
+++ b/crates/ui-egui/src/i18n/it.tsv
@@ -2447,7 +2447,6 @@ cameraRaw Amount Quantità
Sample a pixel anywhere on the screen Campiona un pixel in qualsiasi punto dello schermo
Click to pick · Esc to cancel Clic per scegliere · Esc per annullare
Pick a screen pixel or press Esc to cancel Scegli un pixel dello schermo o premi Esc per annullare
- Preparing screen capture… Preparazione dell’acquisizione dello schermo…
Scroll to zoom Scorri per ingrandire
Drag to pan · Scroll to zoom · Double-click to fit Trascina per spostare · Scorri per ingrandire · Doppio clic per adattare
Show/Hide All Panels Mostra/nascondi tutti i pannelli
diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv
index 2e8b2b462..e05f27d71 100644
--- a/crates/ui-egui/src/i18n/ja.tsv
+++ b/crates/ui-egui/src/i18n/ja.tsv
@@ -2348,7 +2348,6 @@ cameraRaw Color カラー
Sample a pixel anywhere on the screen 画面上の任意のピクセルから色を取得
Click to pick · Esc to cancel クリックで選択 · Escでキャンセル
Pick a screen pixel or press Esc to cancel 画面のピクセルを選択するか、Escでキャンセル
- Preparing screen capture… 画面キャプチャを準備しています…
Scroll to zoom スクロールしてズーム
Show/Hide All Panels すべてのパネルを表示/非表示
Show/Hide Panels パネルを表示/非表示
diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv
index 2f0a95bf6..7de9f61f1 100644
--- a/crates/ui-egui/src/i18n/ko.tsv
+++ b/crates/ui-egui/src/i18n/ko.tsv
@@ -2964,7 +2964,6 @@ cameraRaw Color 색상
Sample a pixel anywhere on the screen 화면의 아무 픽셀에서 색상 추출
Click to pick · Esc to cancel 클릭하여 선택 · Esc로 취소
Pick a screen pixel or press Esc to cancel 화면 픽셀을 선택하거나 Esc를 눌러 취소
- Preparing screen capture… 화면 캡처 준비 중…
Scroll to zoom 스크롤하여 확대/축소
Drag to pan · Scroll to zoom · Double-click to fit 드래그하여 이동 · 스크롤하여 확대/축소 · 두 번 클릭하여 맞추기
Show/Hide All Panels 모든 패널 표시/숨기기
diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv
index e5f6b3177..4ed7d8a74 100644
--- a/crates/ui-egui/src/i18n/nl.tsv
+++ b/crates/ui-egui/src/i18n/nl.tsv
@@ -2383,7 +2383,6 @@
Sample a pixel anywhere on the screen Een pixel ergens op het scherm bemonsteren
Click to pick · Esc to cancel Klik om te kiezen · Esc om te annuleren
Pick a screen pixel or press Esc to cancel Kies een schermpixel of druk op Esc om te annuleren
- Preparing screen capture… Schermafbeelding voorbereiden…
Scroll to zoom Scrollen om te zoomen
Drag to pan · Scroll to zoom · Double-click to fit Sleep om te pannen · Scroll om te zoomen · Dubbelklik om passend te maken
Show/Hide All Panels Alle panelen tonen/verbergen
diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv
index f2ad9396d..a27cb4af8 100644
--- a/crates/ui-egui/src/i18n/pl.tsv
+++ b/crates/ui-egui/src/i18n/pl.tsv
@@ -3382,7 +3382,6 @@ cameraRaw Roughness Chropowatość
Sample a pixel anywhere on the screen Pobierz kolor piksela w dowolnym miejscu ekranu
Click to pick · Esc to cancel Kliknij, aby wybrać · Esc, aby anulować
Pick a screen pixel or press Esc to cancel Wybierz piksel ekranu lub naciśnij Esc, aby anulować
- Preparing screen capture… Przygotowywanie zrzutu ekranu…
Scroll to zoom Przewijaj, aby zmieniać powiększenie
Drag to pan · Scroll to zoom · Double-click to fit Przeciągnij, aby przesunąć · Przewijaj, aby powiększyć · Kliknij dwukrotnie, aby dopasować
Open in camera raw Otwórz w Camera Raw
diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv
index 0c9af2c68..0a6449770 100644
--- a/crates/ui-egui/src/i18n/pt-br.tsv
+++ b/crates/ui-egui/src/i18n/pt-br.tsv
@@ -2801,7 +2801,6 @@ cameraRaw Whites Brancos
Sample a pixel anywhere on the screen Amostrar um pixel em qualquer lugar da tela
Click to pick · Esc to cancel Clique para escolher · Esc para cancelar
Pick a screen pixel or press Esc to cancel Escolha um pixel da tela ou pressione Esc para cancelar
- Preparing screen capture… Preparando captura de tela…
Scroll to zoom Role para ampliar
Drag to pan · Scroll to zoom · Double-click to fit Arraste para mover · Role para ampliar · Clique duas vezes para ajustar
Show/Hide All Panels Mostrar/ocultar todos os painéis
diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv
index d7a0575ba..2dbbf4003 100644
--- a/crates/ui-egui/src/i18n/ru.tsv
+++ b/crates/ui-egui/src/i18n/ru.tsv
@@ -2644,7 +2644,6 @@ cameraRaw Roughness Неровность
Sample a pixel anywhere on the screen Выберите пиксель в любом месте экрана
Click to pick · Esc to cancel Щелчок — выбрать · Esc — отменить
Pick a screen pixel or press Esc to cancel Выберите пиксель на экране или нажмите Esc для отмены
- Preparing screen capture… Подготовка снимка экрана…
Scroll to zoom Колесо — изменить масштаб
Drag to pan · Scroll to zoom · Double-click to fit Перетаскивание — перемещение · Колесо — масштаб · Двойной щелчок — вписать
Show/Hide All Panels Показать/скрыть все панели
diff --git a/crates/ui-egui/src/i18n/sr.tsv b/crates/ui-egui/src/i18n/sr.tsv
index bb792e1a7..4a5f7459d 100644
--- a/crates/ui-egui/src/i18n/sr.tsv
+++ b/crates/ui-egui/src/i18n/sr.tsv
@@ -2775,7 +2775,6 @@ cameraRaw Blending Stapanje
Sample a pixel anywhere on the screen Uzorkujte piksel bilo gde na ekranu
Click to pick · Esc to cancel Kliknite da uzmete boju · Esc za otkazivanje
Pick a screen pixel or press Esc to cancel Izaberite piksel na ekranu ili pritisnite Esc da otkažete
- Preparing screen capture… Priprema snimka ekrana…
Scroll to zoom Pomerajte točkić za zumiranje
Show/Hide All Panels Prikaži/sakrij sve panele
Show/Hide Panels Prikaži/sakrij panele
diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv
index cf3159443..01c37a18b 100644
--- a/crates/ui-egui/src/i18n/tr.tsv
+++ b/crates/ui-egui/src/i18n/tr.tsv
@@ -2355,7 +2355,6 @@
Sample a pixel anywhere on the screen Ekranın herhangi bir yerinde bir pikseli örnekleyin
Click to pick · Esc to cancel Seçmek için tıklayın · İptal etmek için Esc
Pick a screen pixel or press Esc to cancel Bir ekran pikseli seçin veya iptal etmek için Esc tuşuna basın
- Preparing screen capture… Ekran görüntüsü hazırlanıyor…
Scroll to zoom Yakınlaştırmak için kaydırın
Show/Hide All Panels Tüm Panelleri Göster/Gizle
Show/Hide Panels Panelleri Göster/Gizle
diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv
index 85e09e411..79ebc8df3 100644
--- a/crates/ui-egui/src/i18n/uk.tsv
+++ b/crates/ui-egui/src/i18n/uk.tsv
@@ -2616,7 +2616,6 @@ cameraRaw Roughness Шорсткість
Sample a pixel anywhere on the screen Взяти зразок пікселя будь-де на екрані
Click to pick · Esc to cancel Клацніть для вибору · Esc для скасування
Pick a screen pixel or press Esc to cancel Виберіть піксель екрана або натисніть Esc для скасування
- Preparing screen capture… Підготовка знімка екрана…
Scroll to zoom Прокрутіть для масштабування
Drag to pan · Scroll to zoom · Double-click to fit Перетягніть для панорамування · Прокрутіть для масштабування · Двічі клацніть, щоб умістити
Show/Hide All Panels Показати/приховати всі панелі
diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv
index 8c33f3b54..1fea5e6b3 100644
--- a/crates/ui-egui/src/i18n/vi.tsv
+++ b/crates/ui-egui/src/i18n/vi.tsv
@@ -2176,7 +2176,6 @@ layers Fill: Độ tô:
open source mã nguồn mở
Panel locations are saved in the workspace. Keyboard shortcuts, menus and toolbar are optional. Vị trí bảng được lưu trong không gian làm việc. Phím tắt, menu và thanh công cụ là tùy chọn.
Pick a screen pixel or press Esc to cancel Chọn một điểm ảnh trên màn hình hoặc nhấn Esc để hủy
- Preparing screen capture… Đang chuẩn bị ảnh chụp màn hình…
Position and Size Vị trí và kích thước
Preserve Transparency Giữ độ trong suốt
Preset Name Tên thiết lập sẵn
diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv
index 2e2039586..375b61c40 100644
--- a/crates/ui-egui/src/i18n/zh-hans.tsv
+++ b/crates/ui-egui/src/i18n/zh-hans.tsv
@@ -2386,7 +2386,6 @@ cameraRaw Blending 混合
Sample a pixel anywhere on the screen 在屏幕任意位置采样像素
Click to pick · Esc to cancel 单击选取 · Esc 取消
Pick a screen pixel or press Esc to cancel 选取屏幕像素或按 Esc 取消
- Preparing screen capture… 正在准备屏幕截图…
Scroll to zoom 滚动以缩放
Drag to pan · Scroll to zoom · Double-click to fit 拖动以平移 · 滚动以缩放 · 双击以适应窗口
Show/Hide All Panels 显示/隐藏所有面板
diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv
index e1e3ea9c1..de931038d 100644
--- a/crates/ui-egui/src/i18n/zh-hant.tsv
+++ b/crates/ui-egui/src/i18n/zh-hant.tsv
@@ -2356,7 +2356,6 @@ cameraRaw Blending 混合
Sample a pixel anywhere on the screen 在螢幕任意位置取樣像素
Click to pick · Esc to cancel 按一下選取 · Esc 取消
Pick a screen pixel or press Esc to cancel 選取螢幕像素或按 Esc 取消
- Preparing screen capture… 正在準備螢幕截圖…
Scroll to zoom 捲動以縮放
Drag to pan · Scroll to zoom · Double-click to fit 拖曳以平移 · 捲動以縮放 · 按兩下以符合視窗
Show/Hide All Panels 顯示/隱藏所有面板
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index 6440265a0..38118955c 100644
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@ -1816,12 +1816,10 @@ impl eframe::App for PhotocraftApp {
crate::widgets::set_field_resolution(&ctx, dpi, ppi);
// View › Screen Mode › Full Screen Mode: only the image, on black (F or Esc returns).
screen_picker::show(&ctx);
- if screen_picker::busy(&ctx) {
- // While the capture service is still returning a snapshot there is no picker
- // viewport yet. Keep a visible Cancel action even during this phase (#4737).
+ if screen_picker::busy(&ctx) && screen_picker::showing(&ctx) {
egui::Modal::new(egui::Id::new("screen-color-wait")).show(&ctx, |ui| {
ui.spinner();
- ui.label(if screen_picker::showing(&ctx) { tl!("Pick a screen pixel or press Esc to cancel") } else { tl!("Preparing screen capture…") });
+ ui.label(tl!("Pick a screen pixel or press Esc to cancel"));
if ui.button(tl!("Cancel")).clicked() {
screen_picker::cancel(&ctx);
}
@@ -1829,6 +1827,10 @@ impl eframe::App for PhotocraftApp {
self.automation_input = false;
return;
}
+ if screen_picker::busy(&ctx) {
+ ui.disable();
+ ui.set_opacity(1.0);
+ }
// The OS title bar (and the taskbar / Alt-Tab entry) follows the active file; with the
// system title bar this is where the document name lives, as the in-app title is hidden.
panels::sync_window_title(self, &ctx);