mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Implement user-named TextStyle:s
This commit is contained in:
@@ -54,7 +54,7 @@ impl super::View for FontBook {
|
||||
egui::ComboBox::from_label("Text style")
|
||||
.selected_text(format!("{:?}", self.text_style))
|
||||
.show_ui(ui, |ui| {
|
||||
for style in egui::TextStyle::all() {
|
||||
for style in egui::TextStyle::built_in() {
|
||||
ui.selectable_value(
|
||||
&mut self.text_style,
|
||||
style.clone(),
|
||||
@@ -81,7 +81,7 @@ impl super::View for FontBook {
|
||||
ui.fonts()
|
||||
.lock()
|
||||
.fonts
|
||||
.font_mut(&text_style)
|
||||
.font_for_style(&text_style)
|
||||
.characters()
|
||||
.iter()
|
||||
.filter(|chr| !chr.is_whitespace() && !chr.is_ascii_control())
|
||||
|
||||
@@ -261,7 +261,7 @@ impl Widget for &mut LegendDemo {
|
||||
egui::Grid::new("settings").show(ui, |ui| {
|
||||
ui.label("Text style:");
|
||||
ui.horizontal(|ui| {
|
||||
TextStyle::all().for_each(|style| {
|
||||
TextStyle::built_in().for_each(|style| {
|
||||
ui.selectable_value(
|
||||
&mut config.text_style,
|
||||
style.clone(),
|
||||
|
||||
Reference in New Issue
Block a user