set default window size and position to get outta da way

master
Bel LaPointe 2023-03-27 15:57:01 -06:00
parent 5598f39315
commit 9a477c48cc
1 changed files with 23 additions and 11 deletions

View File

@ -28,7 +28,11 @@ pub fn main(cfg: GUI, output_stream: Box<dyn OutputStream>) -> iced::Result {
id: def.id,
text_multithreading: def.text_multithreading,
try_opengles_first: def.try_opengles_first,
window: def.window,
window: iced::window::Settings{
size: (300, 720),
position: iced::window::Position::Specific(0, 0),
..iced::window::Settings::default()
},
};
Main::run(settings)
}
@ -74,6 +78,8 @@ enum Message {
EventOccurred(iced_native::Event),
Tick,
InputTextEntryUpdate(String),
InputTextEntrySubmitSay,
InputTextEntrySubmitSend,
Up,
Down,
Left,
@ -204,8 +210,8 @@ impl Application for Main {
});
return (Self {
c: receiver,
ntfy_from_client: String::from(""),
ntfy_from_server: String::from(""),
ntfy_from_client: String::from(" "),
ntfy_from_server: String::from(" "),
configuring: None,
inputs: Inputs{
stick: Stick {
@ -242,12 +248,14 @@ impl Application for Main {
Message::InputTextEntryUpdate(payload) => {
self.input_text_entry_value = payload;
},
/*
Message::InputTextEntrySubmission => {
eprintln!("input text entry pushed: {}", self.input_text_entry_value); // TODO do somethin with this
Message::InputTextEntrySubmitSay => {
self.input_text_entry_value = String::from("");
eprintln!("TODO");
},
Message::InputTextEntrySubmitSend => {
self.input_text_entry_value = String::from("");
eprintln!("TODO");
},
*/
Message::EventOccurred(event) if self.configuring.is_some() => {
match event {
iced::event::Event::Keyboard(keyboard::Event::KeyPressed{
@ -338,7 +346,7 @@ impl Application for Main {
let new_cfg_button = |msg: Message, s| button(text(controller_button_to_string(msg.clone(), s))).on_press(msg.clone());
return column![
text(String::from("= MAYHEM PARTY =")).size(32),
row![
column![
column![
text(String::from("Button Mapping")).size(24),
text(String::from("--------------")).size(24),
@ -354,17 +362,21 @@ impl Application for Main {
new_cfg_button(Message::R, self.inputs.r),
text(String::from("--------------")).size(24),
text(self.ntfy_from_client.clone()).size(18),
].padding(20).align_items(Alignment::Fill),
].padding(20).align_items(Alignment::Center),
column![
text_input(
&self.input_text_entry_instruction,
&self.input_text_entry_value,
Message::InputTextEntryUpdate
),
row![
button(text("Say")).on_press(Message::InputTextEntrySubmitSay).padding(20),
button(text("Send")).on_press(Message::InputTextEntrySubmitSend).padding(20),
].padding(20).align_items(Alignment::Center),
text(self.ntfy_from_server.clone()).size(18),
].padding(20).align_items(Alignment::Center),
].padding(20).align_items(Alignment::Center),
].padding(20).align_items(Alignment::Center).into();
].padding(0).align_items(Alignment::Center),
].padding(0).align_items(Alignment::Center).into();
}
}