gpui: Impl Default for TextRun (#41084)
Release Notes: - N/A When I was implementing Input, I often used `TextRun`, but `background`, `underline` and `strikethrough` were often not used. So make change to simplify it.
This commit is contained in:
@@ -739,7 +739,7 @@ impl Display for FontStyle {
|
||||
}
|
||||
|
||||
/// A styled run of text, for use in [`crate::TextLayout`].
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Default)]
|
||||
pub struct TextRun {
|
||||
/// A number of utf8 bytes
|
||||
pub len: usize,
|
||||
@@ -813,6 +813,12 @@ pub struct Font {
|
||||
pub style: FontStyle,
|
||||
}
|
||||
|
||||
impl Default for Font {
|
||||
fn default() -> Self {
|
||||
font(".SystemUIFont")
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a [`Font`] for a given name.
|
||||
pub fn font(family: impl Into<SharedString>) -> Font {
|
||||
Font {
|
||||
|
||||
Reference in New Issue
Block a user