Sprinkle demo app with emojis
This commit is contained in:
parent
4db9b82435
commit
48a8553661
11 changed files with 36 additions and 35 deletions
|
@ -587,13 +587,13 @@ impl Context {
|
|||
pub fn settings_ui(&self, ui: &mut Ui) {
|
||||
use crate::containers::*;
|
||||
|
||||
CollapsingHeader::new("Style")
|
||||
CollapsingHeader::new("🎑 Style")
|
||||
.default_open(true)
|
||||
.show(ui, |ui| {
|
||||
self.style_ui(ui);
|
||||
});
|
||||
|
||||
CollapsingHeader::new("Fonts")
|
||||
CollapsingHeader::new("🔠 Fonts")
|
||||
.default_open(false)
|
||||
.show(ui, |ui| {
|
||||
let mut font_definitions = self.fonts().definitions().clone();
|
||||
|
@ -602,7 +602,7 @@ impl Context {
|
|||
self.set_fonts(font_definitions);
|
||||
});
|
||||
|
||||
CollapsingHeader::new("Painting")
|
||||
CollapsingHeader::new("✒ Painting")
|
||||
.default_open(true)
|
||||
.show(ui, |ui| {
|
||||
let mut tesselation_options = self.options.lock().tesselation_options;
|
||||
|
@ -625,11 +625,11 @@ impl Context {
|
|||
.on_hover_text("Is Egui currently listening for text input");
|
||||
ui.advance_cursor(16.0);
|
||||
|
||||
CollapsingHeader::new("Input")
|
||||
CollapsingHeader::new("📥 Input")
|
||||
.default_open(false)
|
||||
.show(ui, |ui| ui.input().clone().ui(ui));
|
||||
|
||||
CollapsingHeader::new("Paint stats")
|
||||
CollapsingHeader::new("📊 Paint stats")
|
||||
.default_open(true)
|
||||
.show(ui, |ui| {
|
||||
self.paint_stats.lock().ui(ui);
|
||||
|
|
|
@ -89,7 +89,7 @@ impl FrameHistory {
|
|||
);
|
||||
crate::demos::warn_if_debug_build(ui);
|
||||
|
||||
crate::CollapsingHeader::new("CPU usage history")
|
||||
crate::CollapsingHeader::new("📊 CPU usage history")
|
||||
.default_open(false)
|
||||
.show(ui, |ui| {
|
||||
self.graph(ui);
|
||||
|
@ -304,7 +304,7 @@ impl app::App for DemoApp {
|
|||
&mut integration_context.tex_allocator,
|
||||
);
|
||||
|
||||
crate::Window::new("Backend")
|
||||
crate::Window::new("💻 Backend")
|
||||
.min_width(360.0)
|
||||
.scroll(false)
|
||||
.show(ctx, |ui| {
|
||||
|
|
|
@ -14,7 +14,7 @@ impl Default for DancingStrings {
|
|||
|
||||
impl Demo for DancingStrings {
|
||||
fn name(&self) -> &str {
|
||||
"Dancing Strings"
|
||||
"♫ Dancing Strings"
|
||||
}
|
||||
|
||||
fn show(&mut self, ctx: &Arc<Context>, open: &mut bool) {
|
||||
|
|
|
@ -103,10 +103,12 @@ impl DemoWindows {
|
|||
}
|
||||
|
||||
crate::SidePanel::left(Id::new("side_panel"), 200.0).show(ctx, |ui| {
|
||||
ui.heading("Egui Demo");
|
||||
ui.heading("✒ Egui Demo");
|
||||
crate::demos::warn_if_debug_build(ui);
|
||||
ui.label("Egui is an immediate mode GUI library written in Rust.");
|
||||
ui.add(crate::Hyperlink::new("https://github.com/emilk/egui").text("Egui home page"));
|
||||
ui.add(crate::Hyperlink::new("https://github.com/emilk/egui").text(" Egui home page"));
|
||||
|
||||
ui.label("Egui can be run on the web, or natively on 🐧");
|
||||
|
||||
ui.separator();
|
||||
ui.label(
|
||||
|
@ -117,7 +119,7 @@ impl DemoWindows {
|
|||
}
|
||||
ui.separator();
|
||||
|
||||
ui.heading("Windows:");
|
||||
ui.heading("S Windows:");
|
||||
ui.indent("windows", |ui| {
|
||||
self.open_windows.checkboxes(ui);
|
||||
self.demos.checkboxes(ui);
|
||||
|
@ -147,34 +149,34 @@ impl DemoWindows {
|
|||
..
|
||||
} = self;
|
||||
|
||||
Window::new("Demo")
|
||||
Window::new("✨ Demo")
|
||||
.open(&mut open_windows.demo)
|
||||
.scroll(true)
|
||||
.show(ctx, |ui| {
|
||||
demo_window.ui(ui);
|
||||
});
|
||||
|
||||
Window::new("Settings")
|
||||
Window::new("🔧 Settings")
|
||||
.open(&mut open_windows.settings)
|
||||
.show(ctx, |ui| {
|
||||
ctx.settings_ui(ui);
|
||||
});
|
||||
|
||||
Window::new("Inspection")
|
||||
Window::new("🔍 Inspection")
|
||||
.open(&mut open_windows.inspection)
|
||||
.scroll(true)
|
||||
.show(ctx, |ui| {
|
||||
ctx.inspection_ui(ui);
|
||||
});
|
||||
|
||||
Window::new("Memory")
|
||||
Window::new("📝 Memory")
|
||||
.open(&mut open_windows.memory)
|
||||
.resizable(false)
|
||||
.show(ctx, |ui| {
|
||||
ctx.memory_ui(ui);
|
||||
});
|
||||
|
||||
Window::new("Color Test")
|
||||
Window::new("🎨 Color Test")
|
||||
.default_size([800.0, 1024.0])
|
||||
.scroll(true)
|
||||
.open(&mut open_windows.color_test)
|
||||
|
@ -299,18 +301,18 @@ impl OpenWindows {
|
|||
color_test,
|
||||
} = self;
|
||||
ui.label("Egui:");
|
||||
ui.checkbox(settings, "Settings");
|
||||
ui.checkbox(inspection, "Inspection");
|
||||
ui.checkbox(memory, "Memory");
|
||||
ui.checkbox(settings, "🔧 Settings");
|
||||
ui.checkbox(inspection, "🔍 Inspection");
|
||||
ui.checkbox(memory, "📝 Memory");
|
||||
ui.separator();
|
||||
ui.checkbox(demo, "Demo");
|
||||
ui.checkbox(demo, "✨ Demo");
|
||||
ui.separator();
|
||||
ui.checkbox(resize, "Resize examples");
|
||||
ui.checkbox(color_test, "Color test")
|
||||
ui.checkbox(resize, "↔ Resize examples");
|
||||
ui.checkbox(color_test, "🎨 Color test")
|
||||
.on_hover_text("For testing the integrations painter");
|
||||
ui.separator();
|
||||
ui.label("Misc:");
|
||||
ui.checkbox(fractal_clock, "Fractal Clock");
|
||||
ui.checkbox(fractal_clock, "🕑 Fractal Clock");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -333,7 +335,7 @@ fn show_menu_bar(ui: &mut Ui, windows: &mut OpenWindows, seconds_since_midnight:
|
|||
menu::menu(ui, "Windows", |ui| windows.checkboxes(ui));
|
||||
menu::menu(ui, "About", |ui| {
|
||||
ui.label("This is Egui");
|
||||
ui.add(Hyperlink::new("https://github.com/emilk/egui").text("Egui home page"));
|
||||
ui.add(Hyperlink::new("https://github.com/emilk/egui").text(" Egui home page"));
|
||||
});
|
||||
|
||||
if let Some(time) = seconds_since_midnight {
|
||||
|
|
|
@ -97,7 +97,7 @@ impl Default for DragAndDropDemo {
|
|||
|
||||
impl Demo for DragAndDropDemo {
|
||||
fn name(&self) -> &str {
|
||||
"Drag and Drop"
|
||||
"✋ Drag and Drop"
|
||||
}
|
||||
|
||||
fn show(&mut self, ctx: &std::sync::Arc<Context>, open: &mut bool) {
|
||||
|
|
|
@ -37,7 +37,7 @@ impl FractalClock {
|
|||
open: &mut bool,
|
||||
seconds_since_midnight: Option<f64>,
|
||||
) {
|
||||
Window::new("FractalClock")
|
||||
Window::new("🕑 Fractal Clock")
|
||||
.open(open)
|
||||
.default_size(vec2(512.0, 512.0))
|
||||
.scroll(false)
|
||||
|
|
|
@ -45,7 +45,7 @@ pub trait Demo {
|
|||
pub fn warn_if_debug_build(ui: &mut crate::Ui) {
|
||||
if crate::has_debug_assertions() {
|
||||
ui.label(
|
||||
crate::Label::new("[Debug build]")
|
||||
crate::Label::new("‼ Debug build ‼")
|
||||
.small()
|
||||
.text_color(crate::color::RED),
|
||||
)
|
||||
|
|
|
@ -5,7 +5,7 @@ pub struct Tests {}
|
|||
|
||||
impl demos::Demo for Tests {
|
||||
fn name(&self) -> &str {
|
||||
"Tests"
|
||||
"📋 Tests"
|
||||
}
|
||||
|
||||
fn show(&mut self, ctx: &std::sync::Arc<crate::Context>, open: &mut bool) {
|
||||
|
|
|
@ -410,7 +410,7 @@ impl InputState {
|
|||
ui.style_mut().body_text_style = crate::paint::TextStyle::Monospace;
|
||||
ui.collapsing("Raw Input", |ui| raw.ui(ui));
|
||||
|
||||
crate::containers::CollapsingHeader::new("mouse")
|
||||
crate::containers::CollapsingHeader::new("🖱 Mouse")
|
||||
.default_open(true)
|
||||
.show(ui, |ui| {
|
||||
mouse.ui(ui);
|
||||
|
|
|
@ -139,11 +139,10 @@ impl Painter {
|
|||
self.text(rect.min, LEFT_TOP, text.into(), text_style, color);
|
||||
}
|
||||
|
||||
pub fn error(&self, pos: Pos2, text: impl Into<String>) {
|
||||
let text = text.into();
|
||||
pub fn error(&self, pos: Pos2, text: impl std::fmt::Display) {
|
||||
let text_style = TextStyle::Monospace;
|
||||
let font = &self.fonts()[text_style];
|
||||
let galley = font.layout_multiline(text, f32::INFINITY);
|
||||
let galley = font.layout_multiline(format!("🔥 {}", text), f32::INFINITY);
|
||||
let rect = anchor_rect(Rect::from_min_size(pos, galley.size), LEFT_TOP);
|
||||
self.add(PaintCmd::Rect {
|
||||
rect: rect.expand(2.0),
|
||||
|
|
|
@ -355,9 +355,9 @@ impl Style {
|
|||
ui.radio_value(body_text_style, value, format!("{:?}", value));
|
||||
}
|
||||
});
|
||||
ui.collapsing("Spacing", |ui| spacing.ui(ui));
|
||||
ui.collapsing("Interaction", |ui| interaction.ui(ui));
|
||||
ui.collapsing("Visuals", |ui| visuals.ui(ui));
|
||||
ui.collapsing("📏 Spacing", |ui| spacing.ui(ui));
|
||||
ui.collapsing("☝ Interaction", |ui| interaction.ui(ui));
|
||||
ui.collapsing("🎨 Visuals", |ui| visuals.ui(ui));
|
||||
ui.add(Slider::f32(animation_time, 0.0..=1.0).text("animation_time"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue