wip: update to use latest iced
This commit is contained in:
parent
ca1469a6b2
commit
f4ad098647
49 changed files with 956 additions and 854 deletions
|
|
@ -6,7 +6,7 @@ use std::borrow::Cow;
|
|||
/// Creates a new [`Text`] widget with the provided content.
|
||||
///
|
||||
/// [`Text`]: widget::Text
|
||||
pub fn text<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
||||
pub fn text<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, crate::Theme, Renderer> {
|
||||
Text::new(text)
|
||||
}
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ pub enum Typography {
|
|||
}
|
||||
|
||||
/// [`Text`] widget with the Title 1 typography preset.
|
||||
pub fn title1<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
||||
pub fn title1<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, crate::Theme, Renderer> {
|
||||
Text::new(text)
|
||||
.size(32.0)
|
||||
.line_height(LineHeight::Absolute(44.0.into()))
|
||||
|
|
@ -33,28 +33,28 @@ pub fn title1<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
|||
}
|
||||
|
||||
/// [`Text`] widget with the Title 2 typography preset.
|
||||
pub fn title2<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
||||
pub fn title2<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, crate::Theme, Renderer> {
|
||||
Text::new(text)
|
||||
.size(28.0)
|
||||
.line_height(LineHeight::Absolute(36.0.into()))
|
||||
}
|
||||
|
||||
/// [`Text`] widget with the Title 3 typography preset.
|
||||
pub fn title3<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
||||
pub fn title3<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, crate::Theme, Renderer> {
|
||||
Text::new(text)
|
||||
.size(24.0)
|
||||
.line_height(LineHeight::Absolute(32.0.into()))
|
||||
}
|
||||
|
||||
/// [`Text`] widget with the Title 4 typography preset.
|
||||
pub fn title4<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
||||
pub fn title4<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, crate::Theme, Renderer> {
|
||||
Text::new(text)
|
||||
.size(20.0)
|
||||
.line_height(LineHeight::Absolute(28.0.into()))
|
||||
}
|
||||
|
||||
/// [`Text`] widget with the Heading typography preset.
|
||||
pub fn heading<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
||||
pub fn heading<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, crate::Theme, Renderer> {
|
||||
Text::new(text)
|
||||
.size(14.0)
|
||||
.line_height(LineHeight::Absolute(iced::Pixels(20.0)))
|
||||
|
|
@ -62,7 +62,7 @@ pub fn heading<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
|||
}
|
||||
|
||||
/// [`Text`] widget with the Caption Heading typography preset.
|
||||
pub fn caption_heading<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
||||
pub fn caption_heading<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, crate::Theme, Renderer> {
|
||||
Text::new(text)
|
||||
.size(10.0)
|
||||
.line_height(LineHeight::Absolute(iced::Pixels(14.0)))
|
||||
|
|
@ -70,21 +70,21 @@ pub fn caption_heading<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Rende
|
|||
}
|
||||
|
||||
/// [`Text`] widget with the Body typography preset.
|
||||
pub fn body<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
||||
pub fn body<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, crate::Theme, Renderer> {
|
||||
Text::new(text)
|
||||
.size(14.0)
|
||||
.line_height(LineHeight::Absolute(20.0.into()))
|
||||
}
|
||||
|
||||
/// [`Text`] widget with the Caption typography preset.
|
||||
pub fn caption<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
||||
pub fn caption<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, crate::Theme, Renderer> {
|
||||
Text::new(text)
|
||||
.size(10.0)
|
||||
.line_height(LineHeight::Absolute(14.0.into()))
|
||||
}
|
||||
|
||||
/// [`Text`] widget with the Monotext typography preset.
|
||||
pub fn monotext<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, Renderer> {
|
||||
pub fn monotext<'a>(text: impl Into<Cow<'a, str>> + 'a) -> Text<'a, crate::Theme, Renderer> {
|
||||
Text::new(text)
|
||||
.size(14.0)
|
||||
.line_height(LineHeight::Absolute(20.0.into()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue