1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 14:50:03 -04:00

Add new ComboBox builder to replace the combo_box_with_label function

This commit is contained in:
Emil Ernerfeldt
2021-03-27 10:35:40 +01:00
parent 795282edc0
commit 41c9de2734
4 changed files with 155 additions and 33 deletions

View File

@@ -65,11 +65,13 @@ impl super::View for FontBook {
ui.separator();
egui::combo_box_with_label(ui, "Text style", format!("{:?}", self.text_style), |ui| {
for style in egui::TextStyle::all() {
ui.selectable_value(&mut self.text_style, style, format!("{:?}", style));
}
});
egui::ComboBox::from_label("Text style")
.selected_text(format!("{:?}", self.text_style))
.show_ui(ui, |ui| {
for style in egui::TextStyle::all() {
ui.selectable_value(&mut self.text_style, style, format!("{:?}", style));
}
});
ui.horizontal(|ui| {
ui.label("Show:");