fix
This commit is contained in:
23
src/main.rs
23
src/main.rs
@@ -1,6 +1,5 @@
|
||||
mod polygon_draw;
|
||||
use iced::advanced::graphics::core::SmolStr;
|
||||
use iced::keyboard::{Key, Modifiers};
|
||||
use iced::advanced::subscription;
|
||||
use polygon_draw::Polygon;
|
||||
|
||||
mod music;
|
||||
@@ -14,12 +13,17 @@ use utils::{is_delta_format_valid, str_to_sec};
|
||||
|
||||
use std::fs;
|
||||
|
||||
use smol_str;
|
||||
use smol_str::SmolStr;
|
||||
|
||||
use iced::widget::{TextInput, column, text};
|
||||
use iced::{
|
||||
Color, Length, Padding, Task, Theme, keyboard,
|
||||
Color, Event, Length, Padding, Task, Theme,
|
||||
event::{self, Status},
|
||||
keyboard::{Event::KeyPressed, Key, key::Named},
|
||||
widget::{Column, button, canvas, container, pick_list, row, scrollable, slider},
|
||||
};
|
||||
use iced::{Element, Font, Subscription};
|
||||
use iced::{Element, Font, Subscription, keyboard};
|
||||
use iced_aw::widget::color_picker;
|
||||
|
||||
use std::f32::consts::PI;
|
||||
@@ -428,15 +432,8 @@ impl MyApp {
|
||||
if self.paused {
|
||||
Subscription::none()
|
||||
} else {
|
||||
Subscription::batch(vec![
|
||||
iced::time::every(std::time::Duration::from_millis(16)).map(|_| Message::Tick),
|
||||
iced::keyboard::on_key_press(|key: Key, modifiers: Modifiers| {
|
||||
println!("Key pressed: {:?}, Modifiers: {:?}", key, modifiers);
|
||||
match (key, modifiers) {
|
||||
(Key::Character(c), m) if m.control() && c == "s" => Some(Message::Save),
|
||||
_ => None,
|
||||
}
|
||||
}),
|
||||
iced::Subscription::batch([
|
||||
iced::time::every(std::time::Duration::from_millis(16)).map(|_| Message::Tick)
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user