Create iced_widget subcrate and re-organize the whole codebase
This commit is contained in:
parent
c54409d171
commit
3a0d34c024
209 changed files with 1959 additions and 2183 deletions
|
|
@ -47,9 +47,8 @@ impl Sandbox for Component {
|
|||
|
||||
mod numeric_input {
|
||||
use iced::alignment::{self, Alignment};
|
||||
use iced::widget::{self, button, row, text, text_input};
|
||||
use iced::{Element, Length};
|
||||
use iced_lazy::{self, Component};
|
||||
use iced::widget::{button, component, row, text, text_input, Component};
|
||||
use iced::{Element, Length, Renderer};
|
||||
|
||||
pub struct NumericInput<Message> {
|
||||
value: Option<u32>,
|
||||
|
|
@ -82,13 +81,7 @@ mod numeric_input {
|
|||
}
|
||||
}
|
||||
|
||||
impl<Message, Renderer> Component<Message, Renderer> for NumericInput<Message>
|
||||
where
|
||||
Renderer: iced_native::text::Renderer + 'static,
|
||||
Renderer::Theme: widget::button::StyleSheet
|
||||
+ widget::text_input::StyleSheet
|
||||
+ widget::text::StyleSheet,
|
||||
{
|
||||
impl<Message> Component<Message, Renderer> for NumericInput<Message> {
|
||||
type State = ();
|
||||
type Event = Event;
|
||||
|
||||
|
|
@ -151,17 +144,12 @@ mod numeric_input {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, Message, Renderer> From<NumericInput<Message>>
|
||||
for Element<'a, Message, Renderer>
|
||||
impl<'a, Message> From<NumericInput<Message>> for Element<'a, Message, Renderer>
|
||||
where
|
||||
Message: 'a,
|
||||
Renderer: 'static + iced_native::text::Renderer,
|
||||
Renderer::Theme: widget::button::StyleSheet
|
||||
+ widget::text_input::StyleSheet
|
||||
+ widget::text::StyleSheet,
|
||||
{
|
||||
fn from(numeric_input: NumericInput<Message>) -> Self {
|
||||
iced_lazy::component(numeric_input)
|
||||
component(numeric_input)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue