1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Add TextEdit::hint_text for showing a weak hint text when empty

This commit is contained in:
Emil Ernerfeldt
2021-02-03 21:05:50 +01:00
parent 4e7e128b2b
commit 0f37b009d6
4 changed files with 30 additions and 7 deletions

View File

@@ -21,7 +21,7 @@ impl Default for WidgetGallery {
boolean: false,
radio: Enum::First,
scalar: 42.0,
string: "Hello World!".to_owned(),
string: Default::default(),
color: egui::Color32::LIGHT_BLUE.linear_multiply(0.5),
}
}
@@ -66,7 +66,7 @@ impl super::View for WidgetGallery {
ui.end_row();
ui.label("Text Input:");
ui.text_edit_singleline(string);
ui.add(egui::TextEdit::singleline(string).hint_text("Write something here"));
ui.end_row();
ui.label("Checkbox:");