From 4674ab7c85d0f63c09ce8cd462831835d2708fc8 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 20 Oct 2026 03:28:24 +0000 Subject: [PATCH] keymap: use US spelling in the shortcuts dialog --- crates/keymap/src/editor.rs | 8 +++--- crates/keymap/src/profiles.rs | 2 +- crates/keymap/src/ui/keyboard.rs | 4 +-- crates/keymap/src/ui/mod.rs | 8 +++--- crates/keymap/src/ui/review.rs | 4 +-- crates/keymap/src/ui/rows.rs | 36 +++++++++++++-------------- crates/keymap/src/ui/state.rs | 2 +- crates/keymap/src/ui/style.rs | 6 ++--- crates/keymap/src/ui/summary.rs | 4 +-- crates/keymap/src/ui/view.rs | 2 +- crates/keymap/tests/editor.rs | 6 ++--- crates/keymap/tests/profiles.rs | 6 ++--- crates/keymap/tests/ui_dialog.rs | 30 +++++++++++----------- crates/keymap/tests/ui_fixture/mod.rs | 12 ++++----- 14 files changed, 65 insertions(+), 65 deletions(-) diff --git a/crates/keymap/src/editor.rs b/crates/keymap/src/editor.rs index 2598552b..e71f687c 100644 --- a/crates/keymap/src/editor.rs +++ b/crates/keymap/src/editor.rs @@ -7,11 +7,11 @@ //! use craft_keymap::editor::holders; //! use craft_keymap::{AssignError, Bindable, Binding, Chord, EditSession, Keymap, Platform, Policy, Recorded, Recorder, Scope, Scopes}; //! -//! let catalogue = vec![ +//! let catalog = vec![ //! Bindable::new("file.save", "Save", Scope::app()).with_default(Binding::parse("Cmd+S").unwrap()), //! Bindable::new("edit.copy", "Copy", Scope::app()).with_default(Binding::parse("Cmd+C").unwrap()), //! ]; -//! let mut keymap = Keymap::new(catalogue, Scopes::new(), Platform::Mac); +//! let mut keymap = Keymap::new(catalog, Scopes::new(), Platform::Mac); //! let now = 12.5; //! //! let mut session = EditSession::begin(&keymap); @@ -231,13 +231,13 @@ impl Recorder { } } -/// The bindables matching `query`, in catalogue order: a case-insensitive substring of the label, +/// The bindables matching `query`, in catalog order: a case-insensitive substring of the label, /// an alias, a menu path segment, the command id, or a binding's canonical or `platform` display /// text. An empty query matches everything. pub fn search<'a>(keymap: &'a Keymap, query: &str, platform: Platform) -> Vec<&'a Bindable> { let q = query.trim().to_lowercase(); keymap - .catalogue() + .catalog() .iter() .filter(|b| { if q.is_empty() { diff --git a/crates/keymap/src/profiles.rs b/crates/keymap/src/profiles.rs index 8642f0f8..baa4b4b9 100644 --- a/crates/keymap/src/profiles.rs +++ b/crates/keymap/src/profiles.rs @@ -36,7 +36,7 @@ const FORMAT: &str = "craft-keymap"; const VERSION: u64 = 1; const IMPORTED: &str = "Imported"; -/// The app's built-in sets: name and overrides against the catalogue defaults. +/// The app's built-in sets: name and overrides against the catalog defaults. pub type Builtins<'a> = [(&'a str, Overrides)]; /// Why a set operation was refused. diff --git a/crates/keymap/src/ui/keyboard.rs b/crates/keymap/src/ui/keyboard.rs index 9483ad26..32e92ad6 100644 --- a/crates/keymap/src/ui/keyboard.rs +++ b/crates/keymap/src/ui/keyboard.rs @@ -1,5 +1,5 @@ //! The on-screen keyboard pane (§2.9 of the dialog plan, `Options::keyboard`): a US ANSI layout -//! coloured by who holds each key with the chosen modifiers, modifier toggles that also follow the +//! colored by who holds each key with the chosen modifiers, modifier toggles that also follow the //! held modifiers, the shortcuts of the clicked key, and Assign to Selected. use std::collections::HashMap; @@ -242,7 +242,7 @@ impl KeyboardState { } let platform = keymap.platform(); let mut map: HashMap> = HashMap::new(); - for b in keymap.catalogue() { + for b in keymap.catalog() { for binding in keymap.bindings(&b.command) { let scope = binding.scope_or(&b.scope).clone(); let holder = Holder { command: b.command.clone(), binding }; diff --git a/crates/keymap/src/ui/mod.rs b/crates/keymap/src/ui/mod.rs index dbe9e0a3..cd476f37 100644 --- a/crates/keymap/src/ui/mod.rs +++ b/crates/keymap/src/ui/mod.rs @@ -1,4 +1,4 @@ -//! The Keyboard Shortcuts dialog (feature `ui`): a table of the catalogue with recording, +//! The Keyboard Shortcuts dialog (feature `ui`): a table of the catalog with recording, //! conflicts, undo, named sets and import review, over [`Keymap`] and optionally [`Profiles`]. //! //! The app keeps a [`DialogState`] while the dialog is open and calls [`ShortcutsDialog::show`] @@ -72,14 +72,14 @@ pub struct Area { pub rows: fn(&Bindable) -> bool, } -/// A read-only row for a key outside the catalogue. +/// A read-only row for a key outside the catalog. #[derive(Clone, Debug, PartialEq, Eq)] pub struct FixedRow { pub group: String, pub label: String, /// The keys as shown. pub keys: String, - /// The trigger, when the row has one, so a catalogue binding on it can be pointed out. + /// The trigger, when the row has one, so a catalog binding on it can be pointed out. pub chord: Option, } @@ -114,7 +114,7 @@ pub struct Options { pub backspace_clears: bool, /// false: Enter when idle is OK. pub enter_is_ok: bool, - /// false: rows sort by translated label instead of catalogue order. + /// false: rows sort by translated label instead of catalog order. pub sort_by_label: bool, /// false: Show as tabs instead of a dropdown. pub area_tabs: bool, diff --git a/crates/keymap/src/ui/review.rs b/crates/keymap/src/ui/review.rs index f0523404..006d9405 100644 --- a/crates/keymap/src/ui/review.rs +++ b/crates/keymap/src/ui/review.rs @@ -16,7 +16,7 @@ struct Entry { line: Option, keys: String, note: String, - /// The note is what the item becomes (Will change), drawn in the text colour, not dimmed. + /// The note is what the item becomes (Will change), drawn in the text color, not dimmed. to: bool, /// Chord text inside the note, kept out of bidi reordering. note_chord: String, @@ -55,7 +55,7 @@ impl Draw<'_, '_> { line.map(|n| fill(self.ui("line {n}"), &[("n", &n.to_string())])) } - /// "item · line n · keys — note" on one wrapping line, the item in the strong colour. + /// "item · line n · keys — note" on one wrapping line, the item in the strong color. fn entry(&self, ui: &mut Ui, e: &Entry) { let font = TextStyle::Body.resolve(ui.style()); let strong = ui.visuals().strong_text_color(); diff --git a/crates/keymap/src/ui/rows.rs b/crates/keymap/src/ui/rows.rs index 93804092..5bc3e0c2 100644 --- a/crates/keymap/src/ui/rows.rs +++ b/crates/keymap/src/ui/rows.rs @@ -69,7 +69,7 @@ pub(crate) struct Chip { #[derive(Clone, Debug, PartialEq)] pub(crate) struct Row { - /// Position in the catalogue. + /// Position in the catalog. pub index: usize, pub command: CommandRef, /// [`CommandRef::key`], for automation ids and the overrides. @@ -92,7 +92,7 @@ pub(crate) struct Row { pub(crate) struct FixedLine { pub label: String, pub keys: String, - /// The label of a catalogue command now bound to the row's chord: drawn struck through. + /// The label of a catalog command now bound to the row's chord: drawn struck through. pub now_used_by: Option, } @@ -186,12 +186,12 @@ fn is_tool(b: &Bindable) -> bool { matches!(b.kind, Kind::Tool { .. }) } -/// The Show entries, in catalogue order, leaving out areas with no rows. +/// The Show entries, in catalog order, leaving out areas with no rows. pub(crate) fn areas(keymap: &Keymap, options: &Options, text: &dyn Text) -> Vec { - let catalogue = keymap.catalogue(); + let catalog = keymap.catalog(); let mut out = vec![AreaEntry { id: AreaId::All, label: text.ui("All Commands").into_owned() }]; let mut menus: Vec<&str> = Vec::new(); - for m in catalogue.iter().filter_map(top_menu) { + for m in catalog.iter().filter_map(top_menu) { if !menus.contains(&m) { menus.push(m); } @@ -200,19 +200,19 @@ pub(crate) fn areas(keymap: &Keymap, options: &Options, text: &dyn Text) -> Vec< let label = craft_i18n::fmt(&text.ui("{menu} Menu"), &[("menu", &text.segment(m))]); out.push(AreaEntry { id: AreaId::Menu(m.to_string()), label }); } - if catalogue.iter().any(is_tool) { + if catalog.iter().any(is_tool) { out.push(AreaEntry { id: AreaId::Tools, label: text.ui("Tools").into_owned() }); } let mut panels: Vec<&str> = keymap.scopes().panels().iter().map(String::as_str).collect(); - for b in catalogue.iter().filter(|b| !b.scope.is_app()) { + for b in catalog.iter().filter(|b| !b.scope.is_app()) { if !panels.contains(&b.scope.as_str()) { panels.push(b.scope.as_str()); } } - for p in panels.into_iter().filter(|p| catalogue.iter().any(|b| b.scope.as_str() == *p)) { + for p in panels.into_iter().filter(|p| catalog.iter().any(|b| b.scope.as_str() == *p)) { out.push(AreaEntry { id: AreaId::Panel(p.to_string()), label: panel_label(text, p) }); } - if catalogue.iter().any(|b| top_menu(b).is_none() && !is_tool(b)) { + if catalog.iter().any(|b| top_menu(b).is_none() && !is_tool(b)) { out.push(AreaEntry { id: AreaId::Other, label: text.ui("Other").into_owned() }); } for a in &options.areas { @@ -240,7 +240,7 @@ fn in_area(area: &AreaId, b: &Bindable, options: &Options) -> bool { } } -/// The first id segment, capitalised: `layer.lock` → `Layer`. +/// The first id segment, capitalized: `layer.lock` → `Layer`. fn id_group(id: &str) -> String { let first = id.split('.').next().unwrap_or(id); let mut chars = first.chars(); @@ -314,7 +314,7 @@ impl Query { fn build(keymap: &Keymap, options: &Options, text: &dyn Text, view: &View) -> Built { let platform = keymap.platform(); - let catalogue = keymap.catalogue(); + let catalog = keymap.catalog(); let mut built = Built::default(); let mut clashing: HashSet = HashSet::new(); for c in keymap.conflicts() { @@ -333,10 +333,10 @@ fn build(keymap: &Keymap, options: &Options, text: &dyn Text, view: &View) -> Bu return built; } - let bindings: Vec> = catalogue.iter().map(|b| keymap.bindings(&b.command)).collect(); + let bindings: Vec> = catalog.iter().map(|b| keymap.bindings(&b.command)).collect(); // How many tools of a group hold each effective trigger. let mut tool_keys: HashMap<(Option<&str>, Trigger), usize> = HashMap::new(); - for (b, list) in catalogue.iter().zip(&bindings) { + for (b, list) in catalog.iter().zip(&bindings) { if let Kind::Tool { group } = &b.kind { for x in list { *tool_keys.entry((group.as_deref(), x.trigger.effective(platform))).or_default() += 1; @@ -344,13 +344,13 @@ fn build(keymap: &Keymap, options: &Options, text: &dyn Text, view: &View) -> Bu } } let submenus = match view.area { - AreaId::Menu(m) => catalogue.iter().any(|b| top_menu(b) == Some(m.as_str()) && b.paths.first().is_some_and(|p| p.len() >= 3)), + AreaId::Menu(m) => catalog.iter().any(|b| top_menu(b) == Some(m.as_str()) && b.paths.first().is_some_and(|p| p.len() >= 3)), _ => false, }; // Groups in first-seen order within their rank. let mut groups: Vec<(u8, Option, Vec)> = Vec::new(); - for (index, (b, list)) in catalogue.iter().zip(&bindings).enumerate() { + for (index, (b, list)) in catalog.iter().zip(&bindings).enumerate() { if !in_area(view.area, b, options) || !query.matches(b, list, text, platform) { continue; } @@ -427,7 +427,7 @@ fn build_fixed(keymap: &Keymap, options: &Options, text: &dyn Text, view: &View, let now_used_by = f.chord.and_then(|c| { let c = c.effective(platform); keymap - .catalogue() + .catalog() .iter() .find(|b| keymap.bindings(&b.command).iter().any(|x| x.trigger.effective(platform) == c)) .map(|b| text.command(b).into_owned()) @@ -468,7 +468,7 @@ pub(crate) mod tests { let tool = Kind::Tool { group: Some("Marquee".into()) }; let path = |p: &[&str]| p.iter().map(|s| s.to_string()).collect::>(); let timeline = Scope::new("Timeline").unwrap_or_else(Scope::app); - let catalogue = vec![ + let catalog = vec![ Bindable::new("file.save", "Save", Scope::app()).with_path(path(&["File", "Save"])).with_default(key("Cmd+S")), Bindable::new("file.saveAs", "Save As…", Scope::app()).with_path(path(&["File", "Save As…"])).with_default(key("Cmd+Shift+S")), Bindable::new("file.export", "Export…", Scope::app()).with_path(path(&["File", "Export…"])).with_default(key("Cmd+E")), @@ -478,7 +478,7 @@ pub(crate) mod tests { Bindable::new("timeline.loop", "Loop", timeline).with_default(key("L")), Bindable::new("type.bold", "Bold", Scope::app()).with_default(key("Text: Cmd+B")), ]; - Keymap::new(catalogue, Scopes::new().with_panel("Timeline").with_context("Text"), platform) + Keymap::new(catalog, Scopes::new().with_panel("Timeline").with_context("Text"), platform) } fn view<'a>(query: &'a str, area: &'a AreaId, filter: Filter, collapsed: &'a BTreeSet) -> View<'a> { diff --git a/crates/keymap/src/ui/state.rs b/crates/keymap/src/ui/state.rs index b188ad0e..fbb544a6 100644 --- a/crates/keymap/src/ui/state.rs +++ b/crates/keymap/src/ui/state.rs @@ -473,7 +473,7 @@ impl DialogState { let platform = env.keymap.platform(); let want = trigger.effective(platform); let mut shadows = Vec::new(); - for b in env.keymap.catalogue() { + for b in env.keymap.catalog() { if b.command == command { continue; } diff --git a/crates/keymap/src/ui/style.rs b/crates/keymap/src/ui/style.rs index 81d4a62d..5abfc97c 100644 --- a/crates/keymap/src/ui/style.rs +++ b/crates/keymap/src/ui/style.rs @@ -1,10 +1,10 @@ -//! The dialog's colours and the icon-button style built from them. +//! The dialog's colors and the icon-button style built from them. use craft_ui::buttons::{ButtonVisuals, IconButtonStyle}; use craft_ui::layout::ResizeHandleStyle; use egui::{Color32, Stroke, Visuals}; -/// The dialog's colours. +/// The dialog's colors. #[derive(Clone, Copy, Debug, PartialEq)] pub struct DialogStyle { pub accent: Color32, @@ -35,7 +35,7 @@ impl DialogStyle { } } -/// Icon buttons (+, ×, ↺, ⌨, ✕) in the colours of the app's visuals. +/// Icon buttons (+, ×, ↺, ⌨, ✕) in the colors of the app's visuals. pub(crate) fn icon_buttons(v: &Visuals) -> IconButtonStyle { let w = &v.widgets; IconButtonStyle { diff --git a/crates/keymap/src/ui/summary.rs b/crates/keymap/src/ui/summary.rs index ef2cb56b..8b4248ca 100644 --- a/crates/keymap/src/ui/summary.rs +++ b/crates/keymap/src/ui/summary.rs @@ -27,10 +27,10 @@ fn binding_text(km: &Keymap, text: &dyn Text, b: &Binding, home: &Scope) -> Stri } } -/// Groups in the table's order; commands in catalogue order within a group. +/// Groups in the table's order; commands in catalog order within a group. fn groups(km: &Keymap, text: &dyn Text) -> Vec { let mut out: Vec = Vec::new(); - for b in km.catalogue() { + for b in km.catalog() { let bindings = km.bindings(&b.command); if bindings.is_empty() { continue; diff --git a/crates/keymap/src/ui/view.rs b/crates/keymap/src/ui/view.rs index 05c430ef..8e5799cb 100644 --- a/crates/keymap/src/ui/view.rs +++ b/crates/keymap/src/ui/view.rs @@ -261,7 +261,7 @@ impl Draw<'_, '_> { IconButton::new(label, Vec2::splat(ICON), &self.icons).selected(selected).show(ui, |ui, rect, color| paint(ui.painter(), rect, color)) } - /// A row control: clickable and labelled but not a Tab stop (the table is one). + /// A row control: clickable and labeled but not a Tab stop (the table is one). fn row_button(&self, ui: &mut Ui, rect: Rect, id: Id, label: &str, enabled: bool, paint: fn(&Painter, Rect, Color32)) -> Response { let resp = ui.interact(rect, id, if enabled { Sense::CLICK } else { Sense::hover() }); resp.widget_info(|| WidgetInfo::labeled(WidgetType::Button, enabled, label)); diff --git a/crates/keymap/tests/editor.rs b/crates/keymap/tests/editor.rs index b33c9045..02a44052 100644 --- a/crates/keymap/tests/editor.rs +++ b/crates/keymap/tests/editor.rs @@ -13,13 +13,13 @@ fn b(text: &str) -> Binding { } fn keymap(platform: Platform) -> Keymap { - let catalogue = vec![ + let catalog = vec![ Bindable::new("file.save", "Save", Scope::app()).with_default(b("Cmd+S")).with_path(vec!["File".into(), "Save".into()]), Bindable::new("edit.copy", "Copy", Scope::app()).with_default(b("Cmd+C")).with_alias("Kopieren"), Bindable::new("view.zoomIn", "Zoom In", Scope::app()).with_default(b("Cmd+=")), Bindable::new("tool.brush", "Brush", Scope::app()).with_default(b("B")).with_path(vec!["Tools".into(), "Paint".into()]), ]; - Keymap::new(catalogue, Scopes::new(), platform) + Keymap::new(catalog, Scopes::new(), platform) } fn keys(km: &Keymap, id: &str) -> Vec { @@ -87,7 +87,7 @@ fn undo_keeps_the_newest_steps() { fn undo_history_is_capped_by_size() { let mut km = keymap(Platform::Windows); let mut session = EditSession::begin(&km); - // Full-size snapshots of entries for commands the catalogue does not have. + // Full-size snapshots of entries for commands the catalog does not have. let big = |tag: char| { let mut o = Overrides::new(); for n in 0..MAX_COMMANDS { diff --git a/crates/keymap/tests/profiles.rs b/crates/keymap/tests/profiles.rs index c23770a6..348420df 100644 --- a/crates/keymap/tests/profiles.rs +++ b/crates/keymap/tests/profiles.rs @@ -9,13 +9,13 @@ fn b(text: &str) -> Binding { } fn keymap() -> Keymap { - let catalogue = vec![ + let catalog = vec![ Bindable::new("file.save", "Save", Scope::app()).with_path(vec!["File".into(), "Save".into()]).with_default(b("Cmd+S")), Bindable::new("edit.copy", "Copy", Scope::app()).with_path(vec!["Edit".into(), "Copy".into()]).with_default(b("Cmd+C")), Bindable::new(CommandRef::with_params("window.panel", json!({"panel": "layers"})), "Layers", Scope::app()).with_default(b("F7")), Bindable::new("timeline.loop", "Loop", Scope::new("Timeline").unwrap()).with_default(b("L")), ]; - Keymap::new(catalogue, Scopes::new().with_panel("Timeline"), Platform::Mac) + Keymap::new(catalog, Scopes::new().with_panel("Timeline"), Platform::Mac) } #[test] @@ -132,7 +132,7 @@ fn an_exported_set_imports_as_a_new_set_with_the_same_keymap() { let mut again = keymap(); again.set_overrides(p.active_overrides(&builtins).clone()); - for bindable in km.catalogue() { + for bindable in km.catalog() { assert_eq!(again.bindings(&bindable.command), km.bindings(&bindable.command), "{}", bindable.command.key()); } assert_eq!(again.overrides(), km.overrides()); diff --git a/crates/keymap/tests/ui_dialog.rs b/crates/keymap/tests/ui_dialog.rs index 5f0ee994..4ff8bf91 100644 --- a/crates/keymap/tests/ui_dialog.rs +++ b/crates/keymap/tests/ui_dialog.rs @@ -59,7 +59,7 @@ impl Fx { self.km.bindings(&CommandRef::from(id)).iter().map(|b| b.to_string()).collect() } - fn cancelled(&self) -> bool { + fn canceled(&self) -> bool { self.outcomes.iter().any(|o| matches!(o, Outcome::Cancel)) } } @@ -162,10 +162,10 @@ fn escape_cancels_recording_only() { press(&mut h, Modifiers::NONE, EguiKey::Escape); assert!(h.state().state.is_open()); assert!(!h.state().state.is_recording()); - assert!(!h.state().cancelled()); + assert!(!h.state().canceled()); assert_eq!(h.state().bindings("file.save"), ["Cmd+S"]); press(&mut h, Modifiers::NONE, EguiKey::Escape); - assert!(h.state().cancelled()); + assert!(h.state().canceled()); assert!(!h.state().state.is_open()); } @@ -432,9 +432,9 @@ fn table_keys_move_record_and_delete() { fn small_window_keeps_ok_and_long_labels_truncate() { let long = "A very long command label ".repeat(12); let mut km = fixture(Platform::Mac); - let mut catalogue = km.catalogue().to_vec(); - catalogue.insert(0, Bindable::new("file.long", long.trim(), Scope::app()).with_path(vec!["File".into(), long.trim().into()])); - km = Keymap::new(catalogue, Scopes::new().with_panel("Timeline").with_context("Text"), Platform::Mac); + let mut catalog = km.catalog().to_vec(); + catalog.insert(0, Bindable::new("file.long", long.trim(), Scope::app()).with_path(vec!["File".into(), long.trim().into()])); + km = Keymap::new(catalog, Scopes::new().with_panel("Timeline").with_context("Text"), Platform::Mac); let mut fx = Fx::new(km); fx.window = true; let size = vec2(480.0, 360.0); @@ -460,7 +460,7 @@ fn window_close_is_cancel() { press(&mut h, Modifiers::NONE, EguiKey::F2); assert_eq!(h.state().bindings("file.save"), ["F2"]); click(&mut h, "Cancel"); - assert!(h.state().cancelled()); + assert!(h.state().canceled()); assert_eq!(h.state().bindings("file.save"), ["Cmd+S"]); } @@ -587,7 +587,7 @@ fn cancel_restores_keymap_and_sets() { click_last(&mut h, "Delete"); assert!(!profiles(&h).sets.contains_key("Other")); click(&mut h, "Cancel"); - assert!(h.state().cancelled()); + assert!(h.state().canceled()); assert_eq!(profiles(&h), &before); assert!(h.state().km.overrides().is_empty()); } @@ -691,14 +691,14 @@ fn picking_a_suggestion_replans_and_is_remembered() { #[test] fn summary_escapes_html_and_keeps_text_lines() { let mut km = fixture(Platform::Mac); - let mut catalogue = km.catalogue().to_vec(); + let mut catalog = km.catalog().to_vec(); let label = "\"Tom\" & 'Jerry'\nNext"; - catalogue.push( + catalog.push( Bindable::new("edit.tricky", label, Scope::app()) .with_path(vec!["Edit".into(), "Tricky".into()]) .with_default(craft_keymap::Binding::parse("F6").expect("F6")), ); - km = Keymap::new(catalogue, Scopes::new().with_panel("Timeline").with_context("Text"), Platform::Mac); + km = Keymap::new(catalog, Scopes::new().with_panel("Timeline").with_context("Text"), Platform::Mac); let mut h = open(Fx::new(km)); click(&mut h, "Summarize…"); let (html, text) = h @@ -734,13 +734,13 @@ fn with_keyboard(options: impl FnOnce(&mut Fx)) -> Harness<'static, Fx> { open(fx) } -/// What a key's colour means, as its accessibility description says it. +/// What a key's color means, as its accessibility description says it. fn holders_class(h: &Harness<'_, Fx>, key: &str) -> String { h.get_by_role_and_label(Role::Button, key).accesskit_node().description().unwrap_or_default().to_string() } #[test] -fn keyboard_colours_keys_and_assigns_to_the_selected_command() { +fn keyboard_colors_keys_and_assigns_to_the_selected_command() { let mut h = with_keyboard(|_| {}); assert_eq!(holders_class(&h, "M: Marquee Tool, Elliptical Marquee Tool"), "Application"); assert_eq!(holders_class(&h, "L: Loop (Timeline)"), "Panel or context"); @@ -831,7 +831,7 @@ fn read_only_has_no_edit_controls() { click(&mut h, "Summarize…"); assert!(h.state().outcomes.iter().any(|o| matches!(o, Outcome::Summary { .. }))); click(&mut h, "Close"); - assert!(h.state().cancelled()); + assert!(h.state().canceled()); } // ---- Pseudo locale ---- @@ -864,7 +864,7 @@ fn check_pseudo(h: &Harness<'_, Fx>, width: f32, step: &str) { let words = rest.split(|c: char| !c.is_ascii_lowercase()).any(|w| w.len() > 1); assert!(!words, "{step}: {label:?} has text that did not go through Text"); } - assert!(seen > 15, "{step}: {seen} labelled nodes"); + assert!(seen > 15, "{step}: {seen} labeled nodes"); } #[test] diff --git a/crates/keymap/tests/ui_fixture/mod.rs b/crates/keymap/tests/ui_fixture/mod.rs index efcc82b1..f2f930cc 100644 --- a/crates/keymap/tests/ui_fixture/mod.rs +++ b/crates/keymap/tests/ui_fixture/mod.rs @@ -1,4 +1,4 @@ -//! The catalogue the dialog tests and screenshots use. +//! The catalog the dialog tests and screenshots use. use std::borrow::Cow; use std::cell::RefCell; @@ -16,7 +16,7 @@ pub fn fixture(platform: Platform) -> Keymap { let tool = Kind::Tool { group: Some("Marquee".into()) }; let path = |p: &[&str]| p.iter().map(|s| s.to_string()).collect::>(); let timeline = Scope::new("Timeline").unwrap_or_else(Scope::app); - let catalogue = vec![ + let catalog = vec![ Bindable::new("file.save", "Save", Scope::app()).with_path(path(&["File", "Save"])).with_default(binding("Cmd+S")), Bindable::new("file.saveAs", "Save As…", Scope::app()).with_path(path(&["File", "Save As…"])).with_default(binding("Cmd+Shift+S")), Bindable::new("file.export", "Export…", Scope::app()).with_path(path(&["File", "Export…"])).with_default(binding("Cmd+E")), @@ -26,22 +26,22 @@ pub fn fixture(platform: Platform) -> Keymap { Bindable::new("timeline.loop", "Loop", timeline).with_default(binding("L")), Bindable::new("type.bold", "Bold", Scope::app()).with_default(binding("Text: Cmd+B")), ]; - Keymap::new(catalogue, Scopes::new().with_panel("Timeline").with_context("Text"), platform) + Keymap::new(catalog, Scopes::new().with_panel("Timeline").with_context("Text"), platform) } /// `km` with a command whose label and menu path are far too long for a row. #[allow(dead_code)] pub fn with_long_label(km: Keymap) -> Keymap { let long = "Distribute Selected Objects Evenly Along the Active Guide Path and Keep Their Spacing".to_string(); - let mut catalogue = km.catalogue().to_vec(); - catalogue.insert( + let mut catalog = km.catalog().to_vec(); + catalog.insert( 3, Bindable::new("object.distribute", long.as_str(), Scope::app()) .with_path(vec!["Object".into(), "Arrange and Distribute Along a Path".into(), long.clone()]) .with_default(binding("Cmd+Alt+Shift+D")) .with_default(binding("Ctrl+Alt+Shift+F12")), ); - Keymap::new(catalogue, Scopes::new().with_panel("Timeline").with_context("Text"), km.platform()) + Keymap::new(catalog, Scopes::new().with_panel("Timeline").with_context("Text"), km.platform()) } /// A pseudo translation: every string about 40 % longer, accented, between right-to-left marks and