Skip to content

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

Integrate current PhotoCraft UI while retaining native driver settings

skylar taylor-barrick728579aea5a7
diff --cc crates/ui-egui/src/file_ui.rs
index 803dbbaef,bebfd6df1..d86f9cf12
--- a/crates/ui-egui/src/file_ui.rs
+++ b/crates/ui-egui/src/file_ui.rs
@@@ -787,61 -877,15 +904,57 @@@ fn print_body(app: &mut PhotocraftApp,
ui.label(egui::RichText::new(s).font(crate::theme::semibold(12.0)).color(t.text));
};
head(ui, tl!("Printer Setup"));
- ui.horizontal(|ui| {
- ui.label(egui::RichText::new(tl!("Printer")).color(t.text_dim));
- let mut pr = s(f, "printer", "");
- if ui.add(egui::TextEdit::singleline(&mut pr).hint_text(tl!("Default printer")).desired_width(180.0)).changed() {
- f.insert("printer".into(), json!(pr));
+ let printers: Option<Vec<String>> =
+ f.get("__printers").and_then(Value::as_array).map(|a| a.iter().filter_map(|v| v.as_str().map(str::to_string)).collect());
+ if let Some(printers) = &printers {
+ // Windows: Photoshop's Printer menu and Print Settings… (the driver's own dialog).
+ ui.horizontal(|ui| {
+ ui.label(egui::RichText::new(tl!("Printer")).color(t.text_dim));
+ let before = s(f, "printer", "");
+ let opts: Vec<(&str, &str)> = printers.iter().map(|n| (n.as_str(), n.as_str())).collect();
+ dropdown_str(ui, "print-printer", f, "printer", &opts, 220.0);
+ if s(f, "printer", "") != before {
+ f.remove("printerSettings");
+ driver_page(f);
+ }
+ });
+ ui.horizontal(|ui| {
+ number(ui, f, "copies", tl!("Copies"), 1.0..=999.0, "", 1.0);
+ if ui.button(tl!("Print Settings…")).clicked() {
+ let printer = s(f, "printer", "");
+ let current = f.get("printerSettings").and_then(Value::as_str).and_then(|h| craft_print::rgb::DevMode::from_hex(h).ok());
+ match craft_print::rgb::settings_dialog(&printer, current.as_ref(), None) {
+ Ok(Some(dm)) => {
+ f.insert("printerSettings".into(), json!(dm.to_hex()));
+ driver_page(f);
+ }
+ Ok(None) => {}
+ Err(e) => {
+ f.insert("__pageError".into(), json!(e.to_string()));
+ }
+ }
+ }
+ });
+ let paper = p.get("paper").and_then(Value::as_array).map(|a| (a.first().and_then(Value::as_f64), a.get(1).and_then(Value::as_f64)));
+ let text = match paper {
+ Some((Some(w), Some(h))) => format!("{:.0} × {:.0} mm · {}", w / 72.0 * 25.4, h / 72.0 * 25.4, tl!("set in Print Settings…")),
+ _ => String::new(),
+ };
+ ui.label(egui::RichText::new(text).color(t.text_dim).size(11.0));
+ if let Some(e) = f.get("__pageError").and_then(Value::as_str) {
+ ui.label(egui::RichText::new(e).color(t.warning).size(11.0));
}
- });
- number(ui, f, "copies", tl!("Copies"), 1.0..=999.0, "", 1.0);
- print_paper_controls(ui, f);
+ } else {
+ ui.horizontal(|ui| {
+ ui.label(egui::RichText::new(tl!("Printer")).color(t.text_dim));
+ let mut pr = s(f, "printer", "");
+ if ui.add(egui::TextEdit::singleline(&mut pr).hint_text(tl!("Default printer")).desired_width(180.0)).changed() {
+ f.insert("printer".into(), json!(pr));
+ }
+ });
+ number(ui, f, "copies", tl!("Copies"), 1.0..=999.0, "", 1.0);
- ui.horizontal(|ui| {
- let papers: Vec<(&str, &str)> = photocraft_engine::print_cmds::PAPERS.iter().map(|p| (p.0, p.0)).collect();
- dropdown_str(ui, "print-paper", f, "paper", &papers, 110.0);
- dropdown_str(ui, "print-orient", f, "orientation", &[("portrait", tl!("Portrait")), ("landscape", tl!("Landscape"))], 110.0);
- });
++ print_paper_controls(ui, f);
+ }
head(ui, tl!("Color Management"));
dropdown_str(
ui,
diff --cc crates/ui-egui/src/i18n/ja.tsv
index 7620e9ad5,5e063a690..d382744c5
--- a/crates/ui-egui/src/i18n/ja.tsv
+++ b/crates/ui-egui/src/i18n/ja.tsv
@@@ -3704,11 -3722,82 +3722,88 @@@ curves Smooth スムー�
Action playback stopped アクションの再生を停止しました
Step {step} is waiting for its dialog ステップ {step} はダイアログを待っています
@plural {n} action|{n} actions アクション {n} 個
+
+ # Liquify tool names (shown via tl!(tool.label()) in the UI, so they are not found by the static scan)
+ Forward Warp 前方ワープ
+ Twirl Clockwise 時計回りに渦巻き
+ Twirl Counterclockwise 反時計回りに渦巻き
+ Pucker 収縮
+ Bloat 膨張
+ Push Left ピクセル移動
+ Freeze Mask ブラシでマスクを描画
+ Thaw Mask ブラシでマスクを消去
+
+ # Panel menu items and section labels passed to tl!() as variables (channels panel, paths panel, layer style)
+ Convert to Alpha Channel アルファチャンネルに変換
+ Delete Channel チャンネルを削除
+ Duplicate Channel チャンネルを複製
+ Exit Quick Mask クイックマスクを終了
+ Merge Channels… チャンネルを結合…
+ Merge Spot Channel スポットチャンネルを結合
+ New Channel… 新規チャンネル…
+ New Spot Channel… 新規スポットチャンネル…
+ Rename Channel… チャンネル名を変更…
+ Split Channels チャンネルを分割
+ Save Path パスを保存
+ General Blending 通常の描画
+
+ # Character panel tooltip (shown once the tooltip helpers in type_tool.rs pass their text through tl!)
+ Kerning: Metrics, Optical or a value in 1/1000 em (Alt+←/→ at the caret) カーニング: メトリクス、オプティカル、または 1/1000 em 単位の値 (キャレット位置で Alt+←/→)
+
+ # Glyphs panel "Show" categories (text/src/glyphs.rs; the dropdown passes them through tl!)
+ Basic Latin 基本ラテン文字
+ Latin 1 ラテン 1
+ Latin Extended-A ラテン拡張 A
+ Latin Extended-B ラテン拡張 B
+ Greek ギリシャ文字
+ Cyrillic キリル文字
+ Numbers 数字
+ Currency 通貨記号
+ Math Symbols 数学記号
+ Arrows 矢印
+
+ # Dialog field labels generated from parameter names (Warp Text, Trim, Calculations, Apply Image; not seen by the tl! scanner)
+ Bend 曲げ
+ Horizontal Distortion 水平方向のゆがみ
+ Vertical Distortion 垂直方向のゆがみ
+ Based On 基準
+ Source Channel ソースのチャンネル
+ Source Invert ソースを反転
+ Mask Channel マスクのチャンネル
+ Source1 Channel ソース 1 のチャンネル
+ Source1 Invert ソース 1 を反転
+ Source2 Channel ソース 2 のチャンネル
+ Source2 Invert ソース 2 を反転
+ R g b RGB
+
+ # Canvas background menu, Blend If labels and Advanced Blending options
+ Dark Gray ダークグレー
+ Medium Gray ミディアムグレー
+ Select Custom Color… カスタムカラーを選択…
+ This Layer: 現在のレイヤー:
+ Underlying Layer: 下のレイヤー:
+ Blend Interior Effects as Group 内部効果をまとめて描画
+ Blend Clipped Layers as Group クリップされたレイヤーをまとめて描画
+ Transparency Shapes Layer 透明シェイプレイヤー
+ Layer Mask Hides Effects レイヤーマスクで効果を隠す
+ Vector Mask Hides Effects ベクトルマスクで効果を隠す
Auto Add/Delete 自動追加・削除
+# Native Windows printing qualification
+ Don't also tick Mirror Image in Print Settings…: the two flips cancel out. 印刷設定の「鏡像」も有効にしないでください。2回反転すると元に戻ります。
+ Print Settings… 印刷設定…
+ Remember to turn off the printer's own colour management in Print Settings… 印刷設定でプリンター独自のカラーマネジメントを無効にしてください…
+ Sent to {printer} {printer} に送信しました
+ set in Print Settings… 印刷設定で指定…
+ # Restored rows (custom print paper #3820, brush presets, Vanishing Point help, brush panel menu)
+ Paper Width 用紙の幅
+ Paper Height 用紙の高さ
+ Capture Brush Size in Preset ブラシサイズをプリセットに保存
+ Include Tool Settings ツール設定を含める
+ Include Color カラーを含める
+ Enter a name for the brush preset ブラシプリセットの名前を入力してください
+ A brush preset with this name already exists この名前のブラシプリセットは既に存在します
+ Drag to pan · Scroll to zoom · Double-click to fit ドラッグで移動 · スクロールでズーム · ダブルクリックで全体表示
+ Clear Brush Controls ブラシのコントロールを消去
+ Reset All Locked Settings ロックされた設定をすべて初期化
+ Copy Texture to Other Tools テクスチャを他のツールにコピー
diff --cc crates/ui-egui/src/i18n/sr.tsv
index 76a8a421a,11604ef8b..3d01325ef
--- a/crates/ui-egui/src/i18n/sr.tsv
+++ b/crates/ui-egui/src/i18n/sr.tsv
@@@ -4168,13 -4186,6 +4186,16 @@@ shape Appearance Izgle
Choose a gradient file (.grd). Izaberite datoteku gradijenta (.grd).
Auto Add/Delete Automatsko dodavanje/brisanje
+# Native Windows printing qualification
+ Don't also tick Mirror Image in Print Settings…: the two flips cancel out. Nemojte uključiti i ogledalsku sliku u podešavanjima štampanja: dva preslikavanja se poništavaju.
+ Print Settings… Podešavanja štampanja…
+ Remember to turn off the printer's own colour management in Print Settings… Ne zaboravite da isključite upravljanje bojama samog štampača u podešavanjima štampanja…
+ Sent to {printer} Poslato na {printer}
+ set in Print Settings… podešava se u podešavanjima štampanja…
+ Soft dark Blaga tamna
+ Soft light Blaga svetla
+ Soft Dark Theme Blaga tamna tema
+ Soft Light Theme Blaga svetla tema
+ # Custom print paper (#3820)
+ Paper Width Širina papira
+ Paper Height Visina papira