diff options
Diffstat (limited to 'native/src/widget')
-rw-r--r-- | native/src/widget/button.rs | 4 | ||||
-rw-r--r-- | native/src/widget/checkbox.rs | 1 | ||||
-rw-r--r-- | native/src/widget/container.rs | 8 | ||||
-rw-r--r-- | native/src/widget/progress_bar.rs | 1 | ||||
-rw-r--r-- | native/src/widget/radio.rs | 1 | ||||
-rw-r--r-- | native/src/widget/scrollable.rs | 1 | ||||
-rw-r--r-- | native/src/widget/slider.rs | 1 | ||||
-rw-r--r-- | native/src/widget/text_input.rs | 1 |
8 files changed, 18 insertions, 0 deletions
diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs index 75ef2693..51b02172 100644 --- a/native/src/widget/button.rs +++ b/native/src/widget/button.rs @@ -114,6 +114,9 @@ where self } + /// Sets the style of the [`Button`]. + /// + /// [`Button`]: struct.Button.html pub fn style(mut self, style: impl Into<Renderer::Style>) -> Self { self.style = style.into(); self @@ -246,6 +249,7 @@ where /// [`Button`]: struct.Button.html /// [renderer]: ../../renderer/index.html pub trait Renderer: crate::Renderer + Sized { + /// The style supported by this renderer. type Style: Default; /// Draws a [`Button`]. diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index d88a59f4..95165997 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -183,6 +183,7 @@ where /// [`Checkbox`]: struct.Checkbox.html /// [renderer]: ../../renderer/index.html pub trait Renderer: crate::Renderer { + /// The style supported by this renderer. type Style: Default; /// Returns the default size of a [`Checkbox`]. diff --git a/native/src/widget/container.rs b/native/src/widget/container.rs index abe83264..5682fc87 100644 --- a/native/src/widget/container.rs +++ b/native/src/widget/container.rs @@ -183,7 +183,15 @@ where } } +/// The renderer of a [`Container`]. +/// +/// Your [renderer] will need to implement this trait before being +/// able to use a [`Container`] in your user interface. +/// +/// [`Container`]: struct.Container.html +/// [renderer]: ../../renderer/index.html pub trait Renderer: crate::Renderer { + /// The style supported by this renderer. type Style: Default; /// Draws a [`Container`]. diff --git a/native/src/widget/progress_bar.rs b/native/src/widget/progress_bar.rs index 0bc860dd..67d1ab83 100644 --- a/native/src/widget/progress_bar.rs +++ b/native/src/widget/progress_bar.rs @@ -127,6 +127,7 @@ where /// [`ProgressBar`]: struct.ProgressBar.html /// [renderer]: ../../renderer/index.html pub trait Renderer: crate::Renderer { + /// The style supported by this renderer. type Style: Default; /// The default height of a [`ProgressBar`]. diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs index b0a6080b..99743ec3 100644 --- a/native/src/widget/radio.rs +++ b/native/src/widget/radio.rs @@ -181,6 +181,7 @@ where /// [`Radio`]: struct.Radio.html /// [renderer]: ../../renderer/index.html pub trait Renderer: crate::Renderer { + /// The style supported by this renderer. type Style: Default; /// Returns the default size of a [`Radio`] button. diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index a062abd0..e83f25af 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -458,6 +458,7 @@ pub struct Scroller { /// [`Scrollable`]: struct.Scrollable.html /// [renderer]: ../../renderer/index.html pub trait Renderer: crate::Renderer + Sized { + /// The style supported by this renderer. type Style: Default; /// Returns the [`Scrollbar`] given the bounds and content bounds of a diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs index c35a933e..008203fe 100644 --- a/native/src/widget/slider.rs +++ b/native/src/widget/slider.rs @@ -217,6 +217,7 @@ where /// [`Slider`]: struct.Slider.html /// [renderer]: ../../renderer/index.html pub trait Renderer: crate::Renderer { + /// The style supported by this renderer. type Style: Default; /// Returns the height of the [`Slider`]. diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index efbd65c8..25032559 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -407,6 +407,7 @@ where /// [`TextInput`]: struct.TextInput.html /// [renderer]: ../../renderer/index.html pub trait Renderer: crate::Renderer + Sized { + /// The style supported by this renderer. type Style: Default; /// Returns the default size of the text of the [`TextInput`]. |