5a24289898fd
ui_commands.rs
use super::UiCommand;
/// One command per language in [`crate::i18n::Locale::ALL`], so a language has a matching command
/// (also listed through the control channel). They are in no menu: Settings ▸ General has the
/// language choice. Tests check coverage.
pub const LANGUAGE_COMMANDS: &[UiCommand] = &[
("app.language.english", crate::i18n::Locale::En.name(), None, ""),
// The picker order (`Locale::for_picker`): alphabetical by the language's own name after
// English; Cyrillic, Georgian, then CJK names follow the Latin ones. A test keeps them equal.
("app.language.indonesian", crate::i18n::Locale::Id.name(), None, ""),
("app.language.czech", crate::i18n::Locale::Cs.name(), None, ""),
("app.language.german", crate::i18n::Locale::De.name(), None, ""),
("app.language.spanish", crate::i18n::Locale::Es.name(), None, ""),
("app.language.french", crate::i18n::Locale::Fr.name(), None, ""),
("app.language.italian", crate::i18n::Locale::It.name(), None, ""),
("app.language.polish", crate::i18n::Locale::Pl.name(), None, ""),
("app.language.portuguese", crate::i18n::Locale::PtBr.name(), None, ""),
("app.language.finnish", crate::i18n::Locale::Fi.name(), None, ""),
("app.language.swedish", crate::i18n::Locale::Sv.name(), None, ""),
("app.language.vietnamese", crate::i18n::Locale::Vi.name(), None, ""),
("app.language.russian", crate::i18n::Locale::Ru.name(), None, ""),
("app.language.ukrainian", crate::i18n::Locale::Uk.name(), None, ""),
("app.language.georgian", crate::i18n::Locale::Ka.name(), None, ""),
("app.language.japanese", crate::i18n::Locale::Ja.name(), None, ""),
("app.language.simplifiedChinese", crate::i18n::Locale::ZhHans.name(), None, ""),
("app.language.traditionalChinese", crate::i18n::Locale::ZhHant.name(), None, ""),
];
/// Every UI command: the languages, then everything else. `xtask parity` reads both tables from
/// this file, so an id listed in `docs/parity-checklist.md` is checked wherever it is declared.
pub fn ui_commands() -> impl Iterator<Item = &'static UiCommand> {
LANGUAGE_COMMANDS.iter().chain(UI_COMMANDS)
}
/// The language a language command selects, if the id is one. The engine and the UI both go
/// through here, so the settings row and the control channel agree on the mapping.
pub fn language_from_command(id: &str) -> Option<crate::i18n::Locale> {
match id {
"app.language.english" => Some(crate::i18n::Locale::En),
"app.language.simplifiedChinese" => Some(crate::i18n::Locale::ZhHans),
"app.language.traditionalChinese" => Some(crate::i18n::Locale::ZhHant),
"app.language.japanese" => Some(crate::i18n::Locale::Ja),
"app.language.portuguese" => Some(crate::i18n::Locale::PtBr),
"app.language.french" => Some(crate::i18n::Locale::Fr),
"app.language.spanish" => Some(crate::i18n::Locale::Es),
"app.language.german" => Some(crate::i18n::Locale::De),
"app.language.russian" => Some(crate::i18n::Locale::Ru),
"app.language.ukrainian" => Some(crate::i18n::Locale::Uk),
"app.language.polish" => Some(crate::i18n::Locale::Pl),
"app.language.czech" => Some(crate::i18n::Locale::Cs),
"app.language.italian" => Some(crate::i18n::Locale::It),
"app.language.georgian" => Some(crate::i18n::Locale::Ka),
"app.language.swedish" => Some(crate::i18n::Locale::Sv),
"app.language.finnish" => Some(crate::i18n::Locale::Fi),
"app.language.indonesian" => Some(crate::i18n::Locale::Id),
"app.language.vietnamese" => Some(crate::i18n::Locale::Vi),
_ => None,
}
}
pub const UI_COMMANDS: &[UiCommand] = &[
("ui.dock", "Arrange Panel", None, ""),
("ui.dock.reset", "Reset Panel Layout", None, "Window"),
("view.photoGrid", "Photo Grid", None, "View"),
("view.squareGrid", "Square Grid", None, "View"),
// G: Photo Grid ↔ Square Grid (from other views: the photo grid)
("view.gridToggle", "Grid", Some("G"), ""),
("library.selectOnlyActive", "Select Only Active Photo", Some("Cmd+Shift+D"), "Edit"),
("tool.guidedUpright", "Guided Perspective", Some("Shift+G"), "Window>Tools"),
("view.detail", "Detail View", Some("D"), "View"),
("view.compare", "Compare", Some("Shift+C"), "View"),
("view.survey", "Survey", Some("N"), "View"),
("view.people", "People", None, "View"),
("view.person", "Show Person", None, ""),
("view.faceBoxes", "Face Boxes", None, "View"),
("view.focusPoint", "Focus Point", Some("Alt+F"), "View"),
("view.zoomToFocus", "Zoom to Focus Point", None, "View"),
("view.reference", "Reference View", Some("Shift+R"), "View"),
("photo.setReference", "Set as Reference Photo", None, ""),
("compare.swap", "Swap Compare Photos", None, "View"),
("compare.set", "Show in Compare", None, ""),
("compare.makeSelect", "Make Candidate the Select", None, "View"),
("view.autoAdvance", "Auto Advance", None, "Photo"),
("view.filmstrip", "Filmstrip", Some("/"), "View"),
("view.leftPanel", "My Photos Panel", Some("Cmd+Shift+L"), "View"),
("view.rightPanel", "Right Panel", None, "View"),
("view.beforeAfter", "Before/After Side by Side", Some("Y"), "View"),
("view.beforeAfterSplit", "Before/After Split", Some("Shift+Y"), "View"),
("view.beforeAfterTopBottom", "Before/After Top/Bottom", Some("Alt+Y"), "View"),
("view.beforeAfterSplitTopBottom", "Before/After Split Top/Bottom", Some("Alt+Shift+Y"), "View"),
("view.showOriginal", "Show Original", Some("\\"), "View"),
("view.zoomFit", "Zoom to Fit", Some("Cmd+0"), "View"),
("view.zoom100", "Zoom 100%", Some("Cmd+Alt+0"), "View"),
("view.zoomToggle", "Toggle Zoom", Some("Z"), "View"),
// the ratio a click (and Z / Space) zooms to
("view.clickZoom", "Click Zoom Ratio", None, ""),
("view.navigate", "Set Image Zoom and Pan", None, ""),
("view.zoomIn", "Zoom In", Some("Cmd+="), "View"),
("view.zoomOut", "Zoom Out", Some("Cmd+-"), "View"),
// Library grids only (Photo Grid, Square Grid, People): the bottom-bar slider's step by key
("view.thumbSizeUp", "Increase Grid Thumbnail Size", Some("="), "View"),
("view.importThumbSize", "Import Thumbnail Size", None, ""),
("view.thumbSizeDown", "Decrease Grid Thumbnail Size", Some("-"), "View"),
("view.clipping", "Clipping", Some("J"), "View"),
("view.visualizeHdr", "Visualize HDR", None, "View"),
// in grids S expands/collapses stacks (the engine command it shadows)
("view.softProof", "Soft Proofing", Some("S"), "View"),
("view.histogram", "Histogram", Some("Cmd+Shift+H"), "View"),
("view.maskOverlay", "Mask Overlay", Some("O"), "View"),
// Ctrl+Shift+O / Cmd+Shift+O: every mask's region at once, not just the selected one
("view.maskOverlayAll", "All Mask Overlays", Some("Cmd+Shift+O"), "View"),
// Shift+O in the Masking panel (elsewhere it cycles the crop overlay)
("view.maskOverlayMode", "Cycle Mask Overlay Mode", None, "View"),
("view.maskOverlayColor", "Cycle Mask Overlay Color", None, "View"),
("view.maskPins", "Mask Pins", None, "View"),
// {mode?: auto | always | selected | never}: when spot and mask pins show (steps to the next
// mode when omitted; Shift+H, like Classic's H for pins, since H opens Remove). View ▸ Tool
// Overlay and the Remove panel list the modes.
("view.toolOverlay", "Cycle Tool Overlay", Some("Shift+H"), ""),
("view.visualizeSpots", "Visualize Spots", Some("A"), "View"),
// A while the Crop panel is open: the aspect lock as a first-class row. Visualize Spots keeps
// the key outside the panel; the two are a contextual pair in shortcuts::handle
("crop.lockAspect", "Lock Aspect Ratio", Some("A"), ""),
("view.cropOverlay", "Cycle Crop Overlay", Some("Shift+O"), "View"),
("view.cropOverlayOrientation", "Cycle Crop Overlay Orientation", None, "View"),
("view.back", "Back to Grid", Some("Escape"), ""),
("tool.done", "Done", Some("Enter"), ""),
("view.filterBar", "Filter Bar", Some("Shift+F"), "View"),
("local.addRoot", "Add Folder to Local", None, ""),
("local.hide", "Remove from Local", None, ""),
("local.restoreHidden", "Show Hidden Local Locations", None, ""),
// {on?}: the Info panel's Target Photo / Selected Photos choice (on = Selected Photos)
("view.infoSelectedPhotos", "Show Metadata for Selected Photos", None, ""),
("view.fullScreenPreview", "Full Screen Preview", Some("F"), "View"),
("view.lightsOut", "Lights Out", Some("Shift+L"), "View"),
("view.enterFullScreen", "Enter Full Screen", Some("Cmd+Shift+F"), "View"),
("view.infoOverlay", "Cycle Info Overlay", Some("Cmd+I"), "View"),
("view.viewOptions", "View Options…", Some("Cmd+J"), "View"),
("view.chooseLayoutImage", "Choose Layout Image…", None, "View"),
("view.layoutImage", "Layout Image", Some("Cmd+Alt+O"), "View"),
("view.layoutImageOpacity", "Layout Image Opacity", None, ""),
("view.layoutImageMatte", "Layout Image Matte", None, ""),
("view.navigator", "Navigator", None, "View"),
("panel.edit", "Edit Panel", Some("E"), "Window"),
("panel.profiles", "Profile Browser", None, "Window"),
("panel.crop", "Crop & Rotate", Some("C"), "Window"),
("panel.remove", "Remove", Some("H"), "Window"),
("panel.masking", "Masking", Some("M"), "Window"),
("panel.redeye", "Red Eye", None, "Window"),
("panel.presets", "Presets", Some("Shift+P"), "Window"),
("panel.info", "Info", Some("I"), "Window"),
("panel.keywords", "Keywords", Some("K"), "Window"),
// the Keywords panel with the cursor in its Add keyword box
("panel.addKeywords", "Add Keywords", Some("Cmd+K"), ""),
("panel.versions", "Versions", Some("Shift+V"), "Window"),
// Edit Keyword Tag for the keyword picked in the Keyword List
("panel.editKeywords", "Edit Keywords", Some("Cmd+Shift+K"), ""),
("panel.activity", "History", None, "Window"),
("panel.close", "Close Panel", None, ""),
// {solo?}: true opens just that section (⌥-click on its header); otherwise opens or closes it
("section.light", "Light", Some("Cmd+1"), "Window>Edit Sections"),
("section.color", "Color", Some("Cmd+2"), "Window>Edit Sections"),
("section.effects", "Effects", Some("Cmd+3"), "Window>Edit Sections"),
("section.detail", "Detail", Some("Cmd+4"), "Window>Edit Sections"),
("section.optics", "Optics", Some("Cmd+5"), "Window>Edit Sections"),
("section.lensBlur", "Lens Blur", Some("Cmd+6"), "Window>Edit Sections"),
("section.calibration", "Calibration", None, ""),
// {on?}; no params toggles. Opening one Edit section closes the others.
("view.soloSections", "Solo Mode", None, "Window>Edit Sections"),
("tool.brush", "Brush", Some("B"), "Window>Tools"),
("tool.linear", "Linear Gradient", Some("L"), "Window>Tools"),
("tool.radial", "Radial Gradient", Some("R"), "Window>Tools"),
("tool.wbPicker", "White Balance Selector", Some("W"), "Window>Tools"),
("tool.none", "No Tool", None, ""),
// brush size / feather of the active brush (Masking brush, Remove tool and its selected spot)
("brush.smaller", "Decrease Brush Size", Some("["), "Window>Tools"),
("brush.larger", "Increase Brush Size", Some("]"), "Window>Tools"),
("brush.featherLess", "Decrease Brush Feather", Some("Shift+["), "Window>Tools"),
("brush.featherMore", "Increase Brush Feather", Some("Shift+]"), "Window>Tools"),
("dialog.newAlbum", "New Album…", Some("Cmd+N"), "File"),
("dialog.newFolder", "New Folder…", Some("Cmd+Shift+N"), "File"),
("dialog.smartAlbum", "New Smart Album…", None, "File"),
("view.photoCounts", "Photo Counts", None, "View"),
("view.sidebarSection", "Show Sidebar Section", None, ""),
("view.sidebarMoveSection", "Move Sidebar Section", None, ""),
("view.sidebarReset", "Reset Sidebar Sections", None, ""),
("view.slideshow", "Slideshow", Some("Cmd+Alt+Enter"), "View"),
("view.slideshowOptions", "Slideshow Options…", None, "View"),
("dialog.slideshowExport", "Export Slideshow…", None, "View"),
("app.slideshowExport", "Export Slideshow", None, ""),
// the slideshow's playback controls (Space, ←/→ and Esc while it plays)
("slideshow.togglePause", "Pause / Resume Slideshow", None, ""),
("slideshow.next", "Next Slide", None, ""),
("slideshow.previous", "Previous Slide", None, ""),
("slideshow.end", "End Slideshow", None, ""),
("view.secondWindow", "Second Window", Some("Cmd+F11"), "Window"),
("tool.keywordPainter", "Keyword Painter", None, ""),
("tool.enablePainting", "Enable Painting", Some("Cmd+Alt+K"), "Photo"),
("view.gridInfo", "Grid Info", None, ""),
// {mode?: auto | light | dark}: Appearance Mode (cycles Auto, Light, Dark when omitted; the
// top bar's appearance button). View ▸ Appearance lists the modes.
("view.appearance", "Next Appearance Mode", None, ""),
// {theme: charcoal | midnight | silver | paper}: pick a theme and fix the mode to its family.
("view.theme", "Theme", None, ""),
("dialog.allMetadata", "All Metadata…", None, "Photo"),
("dialog.faceModel", "Add Face Model…", None, ""),
("dialog.newSmartAlbum", "New Smart Album from Filter…", Some("Cmd+Alt+N"), "File"),
("dialog.createPreset", "Create Preset…", Some("Cmd+Shift+P"), "Photo"),
("dialog.autoStack", "Auto-Stack by Capture Time…", None, "Photo>Stack"),
("dialog.copySettings", "Choose Edit Settings to Copy…", Some("Cmd+Shift+C"), "Edit"),
("dialog.pasteSettings", "Paste Selected Settings…", Some("Cmd+Shift+V"), "Edit"),
("view.focusSearch", "Find…", Some("Cmd+F"), "Edit"),
("dialog.export", "Export…", None, "File"),
("dialog.print", "Print…", Some("Cmd+P"), "File"),
("app.print", "Print to PDF", None, ""),
("dialog.contactSheet", "Contact Sheet PDF…", None, "File"),
("app.contactSheet", "Export Contact Sheet PDF", None, ""),
("photo.editInPhotoCraft", "Edit in PhotoCraft", Some("Cmd+Shift+E"), "Photo>Edit In"),
("photo.editInExternal", "Edit in Other Editor", Some("Cmd+Alt+E"), "Photo>Edit In"),
// {ids?, app?}: the original files themselves (a raw stays a raw: no render, no copy), opened
// in the other editor, e.g. a raw developer
("photo.openOriginalInExternal", "Open Original in Other Editor (RAW, no copy)", None, "Photo>Edit In"),
("dialog.mergeHdr", "HDR…", Some("Ctrl+H"), "Photo>Photo Merge"),
("dialog.mergePanorama", "Panorama…", Some("Ctrl+M"), "Photo>Photo Merge"),
("dialog.mergeHdrPanorama", "HDR Panorama…", None, "Photo>Photo Merge"),
("merge.hdrLast", "HDR with Last Settings", Some("Ctrl+Shift+H"), "Photo>Photo Merge"),
("merge.panoramaLast", "Panorama with Last Settings", Some("Ctrl+Shift+M"), "Photo>Photo Merge"),
("merge.hdrPanoramaLast", "HDR Panorama with Last Settings", None, "Photo>Photo Merge"),
("file.addPhotos", "Import Photos…", Some("Cmd+Shift+I"), "File"),
("file.addFolder", "Import from Folder…", None, "File"),
// {path?, into?: open | new, name?, location?}: asks where the catalog goes unless `into` (or
// Settings) says (#2672, `lightroom_destination`)
("file.importLightroom", "Import Lightroom Catalog…", None, "File"),
("file.addFromDevice", "Import from Device", None, ""),
("file.findMissing", "Find Missing Photos…", None, "File"),
("file.backupLibrary", "Back Up Library…", None, "File"),
("file.restoreLibrary", "Restore Library from Backup…", None, "File"),
("photo.locate", "Locate Missing File…", None, ""),
("dialog.saveMetadataPreset", "Save Metadata Preset…", None, ""),
// the keywords ⇧K adds or removes, typed with commas between them
("dialog.keywordShortcut", "Set Keyword Shortcut…", Some("Cmd+Alt+Shift+K"), ""),
("app.quit", "Quit LightCraft", Some("Cmd+Q"), "File"),
("file.importPresets", "Import Profiles & Presets…", None, "File"),
("file.exportPresets", "Export Presets…", None, "File"),
// Masking panel ▸ Effect menu
("dialog.saveMaskEffect", "Save Current Settings as New Effect Preset…", None, ""),
("dialog.manageMaskEffects", "Manage Effect Presets…", None, ""),
("file.exportMaskEffects", "Export Effect Presets…", None, ""),
("file.importKeywords", "Import Keywords…", None, "File"),
("file.exportKeywords", "Export Keywords…", None, "File"),
// Edit panel ▸ Curve ▸ Point Curve dropdown
("file.importCurvePresets", "Import Point Curve Presets…", None, ""),
("file.exportCurvePresets", "Export Point Curve Presets…", None, ""),
("app.settings", "Settings…", Some("Cmd+,"), "Edit"),
("app.newLibrary", "New Library…", None, "File"),
("app.openLibrary", "Open Library…", Some("Cmd+O"), "File"),
("app.recentLibraries", "Recent Libraries", None, ""),
("app.clearRecentLibraries", "Clear Recent Libraries", None, ""),
// Settings ▸ Display
("app.displayProfile", "Display Profile", None, ""),
("app.about", "About LightCraft", None, "Help"),
("app.checkForUpdates", "Check for Updates…", None, "Help"),
("app.systemInfo", "System Info…", None, "Help"),
("app.openLogFolder", "Open Log Folder", None, "Help"),
// the frame-rate display (`frame_rate`): a debugging aid, never saved
("view.frameRate", "Frame Rate", None, "Help>Debug"),
("app.whatsNew", "What's New", None, "Help"),
("dialog.cull", "Assisted Culling…", None, "Photo"),
("app.help", "LightCraft Help", Some("F1"), "Help"),
("app.discord", "Join the ArtCraft Discord…", None, "Help"),
("app.feedback", "Send Feedback…", None, "Help"),
("app.website", "LightCraft Website", None, "Help"),
("app.github", "LightCraft on GitHub", None, "Help"),
("app.artcraft", "ArtCraft Website", None, "Help"),
("app.shortcuts", "Keyboard Shortcuts", Some("Cmd+/"), "Help"),
("app.setShortcut", "Set Keyboard Shortcut", None, ""),
("app.resetShortcuts", "Reset All Keyboard Shortcuts", None, ""),
("app.export", "Export Now", None, ""),
("app.showInFinder", "Show in Finder", Some("Cmd+R"), "Photo"),
("app.showInFolders", "Show in Folders", None, "Photo"),
("app.openSamModelFolder", "Show in File Manager", None, ""),
("dialog.rename", "Rename Photos…", Some("F2"), "Photo"),
("dialog.labelNames", "Edit Color Label Names…", None, ""),
("dialog.captureTime", "Edit Capture Time…", None, "Photo"),
("photo.tagFromTracklog", "Auto-Tag from Tracklog…", None, "Photo"),
("app.exportPrevious", "Export with Previous", Some("Cmd+Alt+Shift+E"), "File"),
];
No file is open. Choose one in the tree, or press Ctrl+O (⌘O on a Mac) to find one by name.
Syntax highlighting could not load. The unmodified read-only text remains available above.