Merge branch 'master' into beacon
This commit is contained in:
commit
8bd5de72ea
371 changed files with 33138 additions and 12950 deletions
|
|
@ -1,8 +1,6 @@
|
|||
use iced_wgpu::Renderer;
|
||||
use iced_widget::{column, container, row, slider, text, text_input};
|
||||
use iced_winit::core::alignment;
|
||||
use iced_winit::core::{Color, Element, Length, Theme};
|
||||
use iced_winit::runtime::{Command, Program};
|
||||
use iced_widget::{bottom, column, row, slider, text, text_input};
|
||||
use iced_winit::core::{Color, Element, Theme};
|
||||
|
||||
pub struct Controls {
|
||||
background_color: Color,
|
||||
|
|
@ -28,12 +26,8 @@ impl Controls {
|
|||
}
|
||||
}
|
||||
|
||||
impl Program for Controls {
|
||||
type Theme = Theme;
|
||||
type Message = Message;
|
||||
type Renderer = Renderer;
|
||||
|
||||
fn update(&mut self, message: Message) -> Command<Message> {
|
||||
impl Controls {
|
||||
pub fn update(&mut self, message: Message) {
|
||||
match message {
|
||||
Message::BackgroundColorChanged(color) => {
|
||||
self.background_color = color;
|
||||
|
|
@ -42,11 +36,9 @@ impl Program for Controls {
|
|||
self.input = input;
|
||||
}
|
||||
}
|
||||
|
||||
Command::none()
|
||||
}
|
||||
|
||||
fn view(&self) -> Element<Message, Theme, Renderer> {
|
||||
pub fn view(&self) -> Element<Message, Theme, Renderer> {
|
||||
let background_color = self.background_color;
|
||||
|
||||
let sliders = row![
|
||||
|
|
@ -75,21 +67,17 @@ impl Program for Controls {
|
|||
.width(500)
|
||||
.spacing(20);
|
||||
|
||||
container(
|
||||
bottom(
|
||||
column![
|
||||
text("Background color").color(Color::WHITE),
|
||||
text(format!("{background_color:?}"))
|
||||
.size(14)
|
||||
.color(Color::WHITE),
|
||||
text_input("Placeholder", &self.input)
|
||||
.on_input(Message::InputChanged),
|
||||
text!("{background_color:?}").size(14).color(Color::WHITE),
|
||||
sliders,
|
||||
text_input("Type something...", &self.input)
|
||||
.on_input(Message::InputChanged),
|
||||
]
|
||||
.spacing(10),
|
||||
)
|
||||
.padding(10)
|
||||
.height(Length::Fill)
|
||||
.align_y(alignment::Vertical::Bottom)
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue