Add module special_emojis with apple, linux, windows & github logos

This commit is contained in:
Emil Ernerfeldt 2021-02-20 16:07:42 +01:00
parent 9b58d5d4d9
commit 4e041185f1
3 changed files with 56 additions and 4 deletions

View file

@ -238,3 +238,43 @@ macro_rules! github_link_file {
$crate::Hyperlink::new(url).text($label) $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.
}

View file

@ -99,10 +99,18 @@ impl DemoWindows {
ui.separator(); ui.separator();
ScrollArea::auto_sized().show(ui, |ui| { ScrollArea::auto_sized().show(ui, |ui| {
ui.label("egui is an immediate mode GUI library written in Rust."); use egui::special_emojis::{GITHUB, OS_APPLE, OS_LINUX, OS_WINDOWS};
ui.hyperlink_to(" egui home page", "https://github.com/emilk/egui");
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(); ui.separator();

View file

@ -95,7 +95,11 @@ impl WidgetGallery {
ui.end_row(); ui.end_row();
ui.add(doc_link_label("Hyperlink", "Hyperlink")); 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.end_row();
ui.add(doc_link_label("TextEdit", "TextEdit,text_edit")); ui.add(doc_link_label("TextEdit", "TextEdit,text_edit"));