mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -04:00
Add control of line height and letter spacing (#3302)
* Add `TextFormat::extra_letter_spacing` * Add control of line height * Add to text layout demo * Move the text layout demo to its own window in the demo app * Fix doclink * Better document points vs pixels * Better documentation and code cleanup
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
/// Showcase [`TextEdit`].
|
||||
/// Showcase [`egui::TextEdit`].
|
||||
#[derive(PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||
#[cfg_attr(feature = "serde", serde(default))]
|
||||
pub struct TextEdit {
|
||||
pub struct TextEditDemo {
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
impl Default for TextEdit {
|
||||
impl Default for TextEditDemo {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
text: "Edit this text".to_owned(),
|
||||
@@ -14,7 +14,7 @@ impl Default for TextEdit {
|
||||
}
|
||||
}
|
||||
|
||||
impl super::Demo for TextEdit {
|
||||
impl super::Demo for TextEditDemo {
|
||||
fn name(&self) -> &'static str {
|
||||
"🖹 TextEdit"
|
||||
}
|
||||
@@ -30,7 +30,7 @@ impl super::Demo for TextEdit {
|
||||
}
|
||||
}
|
||||
|
||||
impl super::View for TextEdit {
|
||||
impl super::View for TextEditDemo {
|
||||
fn ui(&mut self, ui: &mut egui::Ui) {
|
||||
let Self { text } = self;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user