mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-28 00:59:29 +01:00
Tab hides the UI only while bound to it; Enter drops a later Ctrl; a hidden update result shows again
This commit is contained in:
1 parent
0fdcc8c327
commit
28a0d1a0ef
3 files changed
+7
-2
No files matched your search
@@ -121,7 +121,8 @@ impl TextureCraftApp {
|
||||
Brightness::Dark | Brightness::MediumDark => craft_theme::Mode::Dark,
|
||||
};
|
||||
let mut root = RootEnv::new().mode(mode).scale(Scale::new(scale));
|
||||
root.tab_toggles_chrome = true;
|
||||
// Hide UI on another key leaves Tab to focus traversal and the shortcuts
|
||||
root.tab_toggles_chrome = crate::keymap::shortcut_of(&self.ui.keymap, "ui.hideUi") == Some("Tab");
|
||||
let app_modal = crate::docking::input_blocked(self, ctx).then_some(ViewportId::ROOT);
|
||||
FrameInput::new(root).commands(CommandInput::new().overrides(command_overrides())).host(Arc::clone(&self.framework_host)).app_modal(app_modal)
|
||||
}
|
||||
|
||||
@@ -464,7 +464,9 @@ pub fn shortcuts(app: &mut TextureCraftApp, ctx: &egui::Context) {
|
||||
if taken {
|
||||
let escape = craft_ui::runtime::keys::escape_mods(ctx).filter(|_| key == Key::Escape);
|
||||
ctx.input_mut(|i| {
|
||||
let modifiers = escape.map_or(i.modifiers, |held| Modifiers { shift: held.shift, alt: held.alt, ..Modifiers::NONE });
|
||||
// A submit's Enter had no Ctrl or Cmd; one that came down later in the pass is not its own
|
||||
let (shift, alt) = escape.map_or((i.modifiers.shift, i.modifiers.alt), |held| (held.shift, held.alt));
|
||||
let modifiers = Modifiers { shift, alt, ..Modifiers::NONE };
|
||||
i.events.insert(0, egui::Event::Key { key, physical_key: Some(key), pressed: true, repeat: false, modifiers });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -110,6 +110,8 @@ pub(crate) fn show(app: &mut TextureCraftApp, ctx: &egui::Context) {
|
||||
dialogs.open(UpdateCheckDialog::new(env!("CARGO_PKG_VERSION")));
|
||||
} else if !shows && dialogs.is_open::<UpdateCheckDialog>() {
|
||||
dialogs.cancel::<UpdateCheckDialog>(ctx);
|
||||
// Hidden for the prompt, not dismissed: the outcome shows again after it
|
||||
let _ = dialogs.take::<UpdateCheckDialog>();
|
||||
}
|
||||
if let Some(dialog) = dialogs.get_mut::<UpdateCheckDialog>() {
|
||||
dialog.set_status(status);
|
||||
|
||||
Reference in new issue
Block a user