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