S box: command search at the cursor (fuzzy over name, id, tab and panel; recent first; pinned favourites as a mini toolbar; kept between runs); Named Views in the browser (save the camera, restore animated, rename, update, delete; Top/Front/Right/Home listed; view.save/rename/delete/list, saved in the design); Keyboard Shortcuts (File menu): rebind any command, conflicts reported, clear, reset, kept between runs; ui.shortcut control method
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
d0a9ef27ca
commit
a7fc1fe532
11 files changed
+825
-8
No files matched your search
@@ -178,6 +178,10 @@ fn file_menu(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
app.dialog = Some(crate::dialogs::Dialog::preferences());
|
||||
close = true;
|
||||
}
|
||||
if item(ui, "Keyboard Shortcuts…", "") {
|
||||
app.keymap.open = true;
|
||||
close = true;
|
||||
}
|
||||
if item(ui, "Quit", "") {
|
||||
app.quit_requested = true;
|
||||
close = true;
|
||||
@@ -391,6 +395,10 @@ fn caret(p: &egui::Painter, c: egui::Pos2, col: Color32) {
|
||||
|
||||
/// Global keyboard shortcuts (when no text field has focus).
|
||||
pub fn shortcuts(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
// The Keyboard Shortcuts window is waiting for a key: it is not a shortcut.
|
||||
if crate::keymap::capturing(app) {
|
||||
return;
|
||||
}
|
||||
if ctx.egui_wants_keyboard_input() {
|
||||
return;
|
||||
}
|
||||
@@ -412,7 +420,11 @@ pub fn shortcuts(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
app.open_path(&p);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
_ => {
|
||||
if let Some(id) = crate::keymap::command_for(app, &crate::keymap::key_name(k, mods)) {
|
||||
app.start(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -430,14 +442,16 @@ pub fn shortcuts(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
app.finish_sketch();
|
||||
}
|
||||
}
|
||||
Key::S => app.ui.palette_open = true,
|
||||
Key::S if !mods.shift && !mods.alt => {
|
||||
let at = ctx.input(|i| i.pointer.latest_pos());
|
||||
crate::shortcut_box::open(app, at);
|
||||
}
|
||||
Key::V => crate::context_menu::toggle_visibility(app),
|
||||
Key::F6 => app.animate_view("fit"),
|
||||
Key::Delete | Key::Backspace => crate::viewport::delete_selection(app),
|
||||
_ => {
|
||||
let name = format!("{k:?}");
|
||||
if let Some(c) = command_specs().into_iter().find(|c| c.shortcut == Some(name.as_str()) && c.info(&app.session).enabled) {
|
||||
app.start(c.id);
|
||||
if let Some(id) = crate::keymap::command_for(app, &crate::keymap::key_name(k, mods)) {
|
||||
app.start(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user