Draft first-class Theme support
RFC: https://github.com/iced-rs/rfcs/pull/6
This commit is contained in:
parent
5de337f214
commit
664251f3f5
113 changed files with 767 additions and 878 deletions
|
|
@ -47,12 +47,13 @@ impl Sandbox for Component {
|
|||
}
|
||||
|
||||
mod numeric_input {
|
||||
use iced::pure::{button, row, text, text_input};
|
||||
use iced_lazy::pure::{self, Component};
|
||||
use iced_native::alignment::{self, Alignment};
|
||||
use iced_native::text;
|
||||
use iced_native::widget;
|
||||
use iced_native::Length;
|
||||
use iced_pure::Element;
|
||||
use iced_pure::{button, row, text, text_input};
|
||||
|
||||
pub struct NumericInput<Message> {
|
||||
value: Option<u32>,
|
||||
|
|
@ -88,6 +89,9 @@ mod numeric_input {
|
|||
impl<Message, Renderer> Component<Message, Renderer> for NumericInput<Message>
|
||||
where
|
||||
Renderer: text::Renderer + 'static,
|
||||
Renderer::Theme: widget::button::StyleSheet,
|
||||
<Renderer::Theme as widget::button::StyleSheet>::Variant:
|
||||
Default + Copy,
|
||||
{
|
||||
type State = ();
|
||||
type Event = Event;
|
||||
|
|
@ -158,6 +162,9 @@ mod numeric_input {
|
|||
where
|
||||
Message: 'a,
|
||||
Renderer: 'static + text::Renderer,
|
||||
Renderer::Theme: widget::button::StyleSheet,
|
||||
<Renderer::Theme as widget::button::StyleSheet>::Variant:
|
||||
Default + Copy,
|
||||
{
|
||||
fn from(numeric_input: NumericInput<Message>) -> Self {
|
||||
pure::component(numeric_input)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue