R7.6: Windows and Linux print (#3)
Windows prints through the system dialog at the document's paper; Linux through the desktop portal, the dialog's choices laid out by Ely. Round 3 findings fixed without a further review, as the rules say. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
de4a38e814
commit
13546ea899
26 files changed
+2544
-114
No files matched your search
@@ -131,9 +131,6 @@ fn label(command: &Command, cx: &App) -> SharedString {
|
||||
|
||||
/// Why `id` cannot run; a document lifts the no-document block.
|
||||
pub fn blocked(id: &str, document: bool, cx: &App) -> Option<SharedString> {
|
||||
if id == PRINT.id && !ely_platform::print::BUILT {
|
||||
return Some(i18n::text(cx, "command.blocked.unbuilt", &[]));
|
||||
}
|
||||
let command = RENAMING.iter().find(|command| command.id == id)?;
|
||||
let key = command.blocked.filter(|_| !document)?;
|
||||
Some(i18n::text(cx, key, &[]))
|
||||
@@ -190,11 +187,8 @@ pub fn menus(
|
||||
}
|
||||
|
||||
pub fn bind_keys(cx: &mut App) {
|
||||
// Without a print panel, Print stays off the keyboard.
|
||||
if ely_platform::print::BUILT {
|
||||
cx.bind_keys([KeyBinding::new(PRINT.keys, Print, Some(CONTEXT))]);
|
||||
}
|
||||
cx.bind_keys([
|
||||
KeyBinding::new(PRINT.keys, Print, Some(CONTEXT)),
|
||||
KeyBinding::new(NEW.keys, New, Some(CONTEXT)),
|
||||
KeyBinding::new(OPEN.keys, Open, Some(CONTEXT)),
|
||||
KeyBinding::new(SAVE.keys, Save, Some(CONTEXT)),
|
||||
|
||||
@@ -41,7 +41,6 @@ const EN: &[(&str, &str)] = &[
|
||||
("command.file.export", "Export…"),
|
||||
("command.file.print", "Print…"),
|
||||
("command.blocked.no_document", "No open document"),
|
||||
("command.blocked.unbuilt", "Not built for this platform yet"),
|
||||
("palette.group.file", "File"),
|
||||
("gallery.ready", "Ready"),
|
||||
("gallery.nav", "Navigation"),
|
||||
@@ -97,7 +96,6 @@ const ZH_CN: &[(&str, &str)] = &[
|
||||
("command.file.export", "导出…"),
|
||||
("command.file.print", "打印…"),
|
||||
("command.blocked.no_document", "没有打开的文档"),
|
||||
("command.blocked.unbuilt", "此平台尚未构建"),
|
||||
("palette.group.file", "文件"),
|
||||
("gallery.ready", "就绪"),
|
||||
("gallery.nav", "导航"),
|
||||
|
||||
@@ -379,7 +379,7 @@ mod tests {
|
||||
})
|
||||
.expect("the window lives");
|
||||
cx.run_until_parked();
|
||||
// Save without a document is blocked; so is Print unbuilt.
|
||||
// Save without a document is blocked.
|
||||
window
|
||||
.update(cx, |_, window, cx| root.update(cx, |root, cx| root.run_from_palette("file.save", window, cx)))
|
||||
.expect("the window lives");
|
||||
|
||||
Reference in new issue
Block a user