Help menu (? on the application bar): About SolveCraft (version, commit, build date, ATTRIBUTION.md, fonts, licences), Keyboard Shortcuts read only, Report an Issue copies diagnostics (version, OS, GPU); ui.help 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
5096bf2442
commit
bfa70f005b
8 files changed
+225
-1
No files matched your search
@@ -86,6 +86,14 @@ pub fn app_bar(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
if click(ui, if app.ui.dark { "sun" } else { "moon" }, theme_tip) {
|
||||
app.ui.dark = !app.ui.dark;
|
||||
}
|
||||
if click(ui, "help", "Help") {
|
||||
app.help.menu = !app.help.menu;
|
||||
let at = ui.ctx().input(|i| i.pointer.latest_pos()).map_or(300.0, |p| p.x);
|
||||
ui.ctx().data_mut(|d| {
|
||||
d.insert_temp(egui::Id::new("sc_help_opened"), true);
|
||||
d.insert_temp(egui::Id::new("sc_help_anchor"), at);
|
||||
});
|
||||
}
|
||||
if file {
|
||||
app.ui.palette_open = false;
|
||||
let ctx = ui.ctx().clone();
|
||||
@@ -113,6 +121,8 @@ pub fn app_bar(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
}
|
||||
});
|
||||
file_menu(app, ui.ctx());
|
||||
let help_x = ui.ctx().data(|d| d.get_temp::<f32>(egui::Id::new("sc_help_anchor")).unwrap_or(300.0));
|
||||
crate::help::show(app, &ui.ctx().clone(), pos2(help_x - 14.0, 34.0));
|
||||
}
|
||||
|
||||
fn file_menu(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
@@ -180,6 +190,7 @@ fn file_menu(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
}
|
||||
if item(ui, "Keyboard Shortcuts…", "") {
|
||||
app.keymap.open = true;
|
||||
app.keymap.read_only = false;
|
||||
close = true;
|
||||
}
|
||||
if item(ui, "Quit", "") {
|
||||
|
||||
Reference in new issue
Block a user