Update rust version (required many build changes)
This commit is contained in:
+1
-1
@@ -457,7 +457,7 @@ impl GameWindow {
|
||||
self.config = new_config;
|
||||
}
|
||||
|
||||
fn button_for(&self, ctx: &Context, text: &str, command: Command) -> Button {
|
||||
fn button_for(&self, ctx: &Context, text: &str, command: Command) -> Button<'_> {
|
||||
let button = Button::new(text);
|
||||
match self.shortcuts.shortcut_for(command) {
|
||||
Some(shortcut) => button.shortcut_text(ctx.format_shortcut(&shortcut)),
|
||||
|
||||
@@ -62,8 +62,8 @@ impl HotkeysWindow {
|
||||
}
|
||||
});
|
||||
});
|
||||
if let Some(command) = self.now_binding {
|
||||
if let Some(shortcut) = ui.input_mut(|i| {
|
||||
if let Some(command) = self.now_binding
|
||||
&& let Some(shortcut) = ui.input_mut(|i| {
|
||||
i.events.iter().find_map(|event| match event {
|
||||
Event::Key {
|
||||
key,
|
||||
@@ -73,10 +73,10 @@ impl HotkeysWindow {
|
||||
} => Some(KeyboardShortcut::new(*modifiers, *key)),
|
||||
_ => None,
|
||||
})
|
||||
}) {
|
||||
self.shortcuts.set(command, shortcut);
|
||||
self.now_binding = None;
|
||||
}
|
||||
})
|
||||
{
|
||||
self.shortcuts.set(command, shortcut);
|
||||
self.now_binding = None;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -86,10 +86,10 @@ impl UiExt for Ui {
|
||||
let (rect, _) = ui.allocate_at_least(Vec2::new(100.0, 100.0), Sense::hover());
|
||||
ui.painter().rect_filled(rect, 0.0, *color);
|
||||
let resp = ui.text_edit_singleline(hex);
|
||||
if resp.changed() {
|
||||
if let Ok(new_color) = HexColor::from_str_without_hash(hex) {
|
||||
*color = new_color.color();
|
||||
}
|
||||
if resp.changed()
|
||||
&& let Ok(new_color) = HexColor::from_str_without_hash(hex)
|
||||
{
|
||||
*color = new_color.color();
|
||||
}
|
||||
resp
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user