Yuan Chang
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
15 additions and
0 deletions
-
egui/src/widget_text.rs
|
|
@ -1,3 +1,4 @@ |
|
|
|
use std::borrow::Cow; |
|
|
|
use std::sync::Arc; |
|
|
|
|
|
|
|
use crate::{ |
|
|
@ -65,6 +66,13 @@ impl From<String> for RichText { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
impl From<Cow<'_, str>> for RichText { |
|
|
|
#[inline] |
|
|
|
fn from(text: Cow<'_, str>) -> Self { |
|
|
|
Self::new(text) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
impl RichText { |
|
|
|
#[inline] |
|
|
|
pub fn new(text: impl Into<String>) -> Self { |
|
|
@ -605,6 +613,13 @@ impl From<String> for WidgetText { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
impl From<Cow<'_, str>> for WidgetText { |
|
|
|
#[inline] |
|
|
|
fn from(text: Cow<'_, str>) -> Self { |
|
|
|
Self::RichText(RichText::new(text)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
impl From<RichText> for WidgetText { |
|
|
|
#[inline] |
|
|
|
fn from(rich_text: RichText) -> Self { |
|
|
|