Merge branch 'master' into feature/software-renderer

This commit is contained in:
Héctor Ramón Jiménez 2023-03-07 07:24:34 +01:00
commit aa4b5bb6b9
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
12 changed files with 45 additions and 82 deletions

View file

@ -120,7 +120,8 @@ mod numeric_input {
.horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Center),
)
.width(50)
.width(40)
.height(40)
.on_press(on_press)
};
@ -138,7 +139,7 @@ mod numeric_input {
.padding(10),
button("+", Event::IncrementPressed),
]
.align_items(Alignment::Fill)
.align_items(Alignment::Center)
.spacing(10)
.into()
}

View file

@ -254,7 +254,6 @@ impl Application for ScrollableDemo {
scroll_to_beginning_button(),
vertical_space(40),
]
.align_items(Alignment::Fill)
.spacing(40),
horizontal_space(1200),
text("Horizontal - End!"),

View file

@ -1,7 +1,7 @@
use iced::alignment::{self, Alignment};
use iced::event::{self, Event};
use iced::font::{self, Font};
use iced::keyboard;
use iced::keyboard::{self, KeyCode, Modifiers};
use iced::subscription;
use iced::theme::{self, Theme};
use iced::widget::{
@ -52,6 +52,7 @@ enum Message {
FilterChanged(Filter),
TaskMessage(usize, TaskMessage),
TabPressed { shift: bool },
ToggleFullscreen(window::Mode),
}
impl Application for Todos {
@ -162,6 +163,9 @@ impl Application for Todos {
widget::focus_next()
}
}
Message::ToggleFullscreen(mode) => {
window::change_mode(mode)
}
_ => Command::none(),
};
@ -272,6 +276,21 @@ impl Application for Todos {
) => Some(Message::TabPressed {
shift: modifiers.shift(),
}),
(
Event::Keyboard(keyboard::Event::KeyPressed {
key_code,
modifiers: Modifiers::SHIFT,
}),
event::Status::Ignored,
) => match key_code {
KeyCode::Up => {
Some(Message::ToggleFullscreen(window::Mode::Fullscreen))
}
KeyCode::Down => {
Some(Message::ToggleFullscreen(window::Mode::Windowed))
}
_ => None,
},
_ => None,
})
}

View file

@ -146,7 +146,9 @@ impl Application for WebSocket {
}
}
row![input, button].spacing(10).align_items(Alignment::Fill)
row![input, button]
.spacing(10)
.align_items(Alignment::Center)
};
column![message_log, new_message_input]