Add line_height to checkbox::Icon
This commit is contained in:
parent
16bf8fc762
commit
180cb073bd
2 changed files with 6 additions and 1 deletions
|
|
@ -59,6 +59,7 @@ impl Application for Example {
|
||||||
font: ICON_FONT,
|
font: ICON_FONT,
|
||||||
code_point: '\u{e901}',
|
code_point: '\u{e901}',
|
||||||
size: None,
|
size: None,
|
||||||
|
line_height: text::LineHeight::Relative(1.0),
|
||||||
shaping: text::Shaping::Basic,
|
shaping: text::Shaping::Basic,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,7 @@ where
|
||||||
font: Renderer::ICON_FONT,
|
font: Renderer::ICON_FONT,
|
||||||
code_point: Renderer::CHECKMARK_ICON,
|
code_point: Renderer::CHECKMARK_ICON,
|
||||||
size: None,
|
size: None,
|
||||||
|
line_height: text::LineHeight::default(),
|
||||||
shaping: text::Shaping::Basic,
|
shaping: text::Shaping::Basic,
|
||||||
},
|
},
|
||||||
style: Default::default(),
|
style: Default::default(),
|
||||||
|
|
@ -279,6 +280,7 @@ where
|
||||||
font,
|
font,
|
||||||
code_point,
|
code_point,
|
||||||
size,
|
size,
|
||||||
|
line_height,
|
||||||
shaping,
|
shaping,
|
||||||
} = &self.icon;
|
} = &self.icon;
|
||||||
let size = size.unwrap_or(bounds.height * 0.7);
|
let size = size.unwrap_or(bounds.height * 0.7);
|
||||||
|
|
@ -288,7 +290,7 @@ where
|
||||||
content: &code_point.to_string(),
|
content: &code_point.to_string(),
|
||||||
font: *font,
|
font: *font,
|
||||||
size,
|
size,
|
||||||
line_height: text::LineHeight::default(),
|
line_height: *line_height,
|
||||||
bounds: Rectangle {
|
bounds: Rectangle {
|
||||||
x: bounds.center_x(),
|
x: bounds.center_x(),
|
||||||
y: bounds.center_y(),
|
y: bounds.center_y(),
|
||||||
|
|
@ -347,6 +349,8 @@ pub struct Icon<Font> {
|
||||||
pub code_point: char,
|
pub code_point: char,
|
||||||
/// Font size of the content.
|
/// Font size of the content.
|
||||||
pub size: Option<f32>,
|
pub size: Option<f32>,
|
||||||
|
/// The line height of the icon.
|
||||||
|
pub line_height: text::LineHeight,
|
||||||
/// The shaping strategy of the icon.
|
/// The shaping strategy of the icon.
|
||||||
pub shaping: text::Shaping,
|
pub shaping: text::Shaping,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue