diff --git a/egui/src/lib.rs b/egui/src/lib.rs index 16b63e64..f9590ed9 100644 --- a/egui/src/lib.rs +++ b/egui/src/lib.rs @@ -238,3 +238,43 @@ macro_rules! github_link_file { $crate::Hyperlink::new(url).text($label) }}; } + +// ---------------------------------------------------------------------------- + +/// egui supports around 1216 emojis in total. +/// Here are some of the most useful: +/// ∞⊗⎗⎘⎙⏏⏴⏵⏶⏷ +/// ⏩⏪⏭⏮⏸⏹⏺■▶📾🔀🔁🔃 +/// ☀☁★☆☐☑☜☝☞☟⛃⛶✔ +/// ↺↻⟲⟳⬅➡⬆⬇⬈⬉⬊⬋⬌⬍⮨⮩⮪⮫ +/// ♡ +/// 📅📆 +/// 📈📉📊 +/// 📋📌📎📤📥🔆 +/// 🔈🔉🔊🔍🔎🔗🔘 +/// 🕓🖧🖩🖮🖱🖴🖵🖼🗀🗁🗋🗐🗑🗙🚫❓ +/// +/// NOTE: In egui all emojis are monochrome! +/// +/// You can explore them all in the Font Book in [the online demo](https://emilk.github.io/egui/). +/// +/// In addition, egui supports a few special emojis that are not part of the unicode standard. +/// This module contains some of them: +pub mod special_emojis { + /// Tux, the Linux penguin. + pub const OS_LINUX: char = '🐧'; + /// The Windows logo. + pub const OS_WINDOWS: char = ''; + /// The Android logo. + pub const OS_ANDROID: char = ''; + /// The Apple logo. + pub const OS_APPLE: char = ''; + + /// The Github logo. + pub const GITHUB: char = ''; + + /// The word `git`. + pub const GIT: char = ''; + + // I really would like to have ferris here. +} diff --git a/egui_demo_lib/src/apps/demo/demo_windows.rs b/egui_demo_lib/src/apps/demo/demo_windows.rs index 76af2368..ce57fef8 100644 --- a/egui_demo_lib/src/apps/demo/demo_windows.rs +++ b/egui_demo_lib/src/apps/demo/demo_windows.rs @@ -99,10 +99,18 @@ impl DemoWindows { ui.separator(); ScrollArea::auto_sized().show(ui, |ui| { - ui.label("egui is an immediate mode GUI library written in Rust."); - ui.hyperlink_to(" egui home page", "https://github.com/emilk/egui"); + use egui::special_emojis::{GITHUB, OS_APPLE, OS_LINUX, OS_WINDOWS}; - ui.label("egui can be run on the web, or natively on 🐧"); + ui.label("egui is an immediate mode GUI library written in Rust."); + ui.hyperlink_to( + format!("{} egui home page", GITHUB), + "https://github.com/emilk/egui", + ); + + ui.label(format!( + "egui can be run on the web, or natively on {}{}{}", + OS_APPLE, OS_LINUX, OS_WINDOWS, + )); ui.separator(); diff --git a/egui_demo_lib/src/apps/demo/widget_gallery.rs b/egui_demo_lib/src/apps/demo/widget_gallery.rs index f41dc939..07cd1924 100644 --- a/egui_demo_lib/src/apps/demo/widget_gallery.rs +++ b/egui_demo_lib/src/apps/demo/widget_gallery.rs @@ -95,7 +95,11 @@ impl WidgetGallery { ui.end_row(); ui.add(doc_link_label("Hyperlink", "Hyperlink")); - ui.hyperlink_to(" egui home page", "https://github.com/emilk/egui"); + use egui::special_emojis::GITHUB; + ui.hyperlink_to( + format!("{} egui home page", GITHUB), + "https://github.com/emilk/egui", + ); ui.end_row(); ui.add(doc_link_label("TextEdit", "TextEdit,text_edit"));