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:
@@ -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:");
|
||||
|
||||
Reference in New Issue
Block a user