repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/tests/egui_tests/tests/test_sides.rs
tests/egui_tests/tests/test_sides.rs
use egui::{TextWrapMode, Vec2, containers::Sides}; use egui_kittest::{Harness, SnapshotResults}; #[test] fn sides_container_tests() { let mut results = SnapshotResults::new(); test_variants("default", |sides| sides, &mut results); test_variants( "shrink_left", |sides| sides.shrink_left()....
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/tests/egui_tests/tests/test_widgets.rs
tests/egui_tests/tests/test_widgets.rs
#![expect(clippy::unwrap_used)] // it's a test use egui::accesskit::Role; use egui::load::SizedTexture; use egui::{ Align, AtomExt as _, AtomLayout, Button, Color32, ColorImage, Direction, DragValue, Event, Grid, IntoAtoms as _, Layout, PointerButton, Response, Slider, Stroke, StrokeKind, TextEdit, TextWra...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/tests/test_inline_glow_paint/src/main.rs
tests/test_inline_glow_paint/src/main.rs
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release #![expect( // it's a test: clippy::undocumented_unsafe_blocks, clippy::unwrap_used, rustdoc::missing_crate_level_docs )] // Test that we can paint to the screen using glow directly. use efra...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/tests/test_egui_extras_compilation/src/main.rs
tests/test_egui_extras_compilation/src/main.rs
//! Regression test for <https://github.com/emilk/egui/issues/4771> fn main() {}
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/tests/test_size_pass/src/main.rs
tests/test_size_pass/src/main.rs
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release #![expect(rustdoc::missing_crate_level_docs)] // it's a test use eframe::egui; fn main() -> eframe::Result { env_logger::init(); // Use `RUST_LOG=debug` to see logs. let options = eframe::NativeOpt...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/tests/test_viewports/src/main.rs
tests/test_viewports/src/main.rs
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release #![expect(clippy::unwrap_used, rustdoc::missing_crate_level_docs)] // it's a test use std::sync::Arc; use eframe::egui; use egui::{Id, InnerResponse, UiBuilder, ViewportBuilder, ViewportId, mutex::RwLock}; ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/tests/test_ui_stack/src/main.rs
tests/test_ui_stack/src/main.rs
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release #![expect(rustdoc::missing_crate_level_docs)] // it's an example use std::sync::Arc; use eframe::egui; use eframe::egui::{Rangef, Shape, UiKind}; use egui_extras::Column; fn main() -> eframe::Result { ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_glow/src/winit.rs
crates/egui_glow/src/winit.rs
pub use egui_winit::{self, EventResponse}; use egui::{ViewportId, ViewportOutput}; use egui_winit::winit; use crate::shader_version::ShaderVersion; /// Use [`egui`] from a [`glow`] app based on [`winit`]. pub struct EguiGlow { pub egui_ctx: egui::Context, pub egui_winit: egui_winit::State, pub painter: c...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_glow/src/lib.rs
crates/egui_glow/src/lib.rs
//! [`egui`] bindings for [`glow`](https://github.com/grovesNL/glow). //! //! The main type you want to look at is [`Painter`]. //! //! If you are writing an app, you may want to look at [`eframe`](https://docs.rs/eframe) instead. //! //! ## Feature flags #![cfg_attr(feature = "document-features", doc = document_featur...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_glow/src/painter.rs
crates/egui_glow/src/painter.rs
#![expect(clippy::unwrap_used)] #![expect(unsafe_code)] use std::{collections::HashMap, sync::Arc}; use egui::{ emath::Rect, epaint::{Mesh, PaintCallbackInfo, Primitive, Vertex}, }; use glow::HasContext as _; use memoffset::offset_of; use crate::check_for_gl_error; use crate::misc_util::{compile_shader, link...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_glow/src/misc_util.rs
crates/egui_glow/src/misc_util.rs
#![expect(unsafe_code)] use glow::HasContext as _; pub(crate) unsafe fn compile_shader( gl: &glow::Context, shader_type: u32, source: &str, ) -> Result<glow::Shader, String> { unsafe { let shader = gl.create_shader(shader_type)?; gl.shader_source(shader, source); gl.compile_s...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_glow/src/shader_version.rs
crates/egui_glow/src/shader_version.rs
#![expect(clippy::undocumented_unsafe_blocks)] #![expect(clippy::unwrap_used)] // TODO(emilk): avoid unwraps #![expect(unsafe_code)] use std::convert::TryInto as _; /// Helper for parsing and interpreting the OpenGL shader version. #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum ShaderVersion { Gl120, ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_glow/src/vao.rs
crates/egui_glow/src/vao.rs
#![expect(unsafe_code)] #![expect(clippy::unwrap_used)] use glow::HasContext as _; use crate::check_for_gl_error; // ---------------------------------------------------------------------------- #[derive(Debug)] pub(crate) struct BufferInfo { pub location: u32, // pub vector_size: i32, pub data_type: u32...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_glow/examples/pure_glow.rs
crates/egui_glow/examples/pure_glow.rs
//! Example how to use pure `egui_glow`. #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release #![expect(rustdoc::missing_crate_level_docs, clippy::unwrap_used)] // it's an example #![expect(clippy::undocumented_unsafe_blocks)] #![expect(unsafe_code)] use std:...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/src/config.rs
crates/egui_kittest/src/config.rs
#![cfg(feature = "snapshot")] use std::io; use std::path::PathBuf; /// Configuration for `egui_kittest`. /// /// It's loaded once (per process) by searching for a `kittest.toml` file in the project root /// (the directory containing `Cargo.lock`). #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] #[serde(...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/src/app_kind.rs
crates/egui_kittest/src/app_kind.rs
use egui::Frame; type AppKindContextState<'a, State> = Box<dyn FnMut(&egui::Context, &mut State) + 'a>; type AppKindUiState<'a, State> = Box<dyn FnMut(&mut egui::Ui, &mut State) + 'a>; type AppKindContext<'a> = Box<dyn FnMut(&egui::Context) + 'a>; type AppKindUi<'a> = Box<dyn FnMut(&mut egui::Ui) + 'a>; /// In order ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/src/texture_to_image.rs
crates/egui_kittest/src/texture_to_image.rs
use egui_wgpu::wgpu; use egui_wgpu::wgpu::{Device, Extent3d, Queue, Texture}; use image::RgbaImage; use std::iter; use std::mem::size_of; use std::sync::mpsc::channel; use crate::wgpu::WAIT_TIMEOUT; pub(crate) fn texture_to_image(device: &Device, queue: &Queue, texture: &Texture) -> RgbaImage { let buffer_dimensi...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/src/node.rs
crates/egui_kittest/src/node.rs
use egui::accesskit::ActionRequest; use egui::mutex::Mutex; use egui::{Modifiers, PointerButton, Pos2, accesskit}; use kittest::{AccessKitNode, NodeT, debug_fmt_node}; use std::fmt::{Debug, Formatter}; pub(crate) enum EventType { Event(egui::Event), Modifiers(Modifiers), } pub(crate) type EventQueue = Mutex<V...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/src/builder.rs
crates/egui_kittest/src/builder.rs
use crate::app_kind::AppKind; use crate::{Harness, LazyRenderer, TestRenderer}; use egui::{Pos2, Rect, Vec2}; use std::marker::PhantomData; /// Builder for [`Harness`]. #[must_use] pub struct HarnessBuilder<State = ()> { pub(crate) screen_rect: Rect, pub(crate) pixels_per_point: f32, pub(crate) theme: egui...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/src/lib.rs
crates/egui_kittest/src/lib.rs
#![cfg_attr(doc, doc = include_str!("../README.md"))] //! //! ## Feature flags #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] #![expect(clippy::unwrap_used)] // TODO(emilk): avoid unwraps mod builder; #[cfg(feature = "snapshot")] mod snapshot; #[cfg(feature = "snapshot")] p...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/src/renderer.rs
crates/egui_kittest/src/renderer.rs
use egui::TexturesDelta; pub trait TestRenderer { /// We use this to pass the glow / wgpu render state to [`eframe::Frame`]. #[cfg(feature = "eframe")] fn setup_eframe(&self, _cc: &mut eframe::CreationContext<'_>, _frame: &mut eframe::Frame) {} /// Handle a [`TexturesDelta`] by updating the renderer's...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/src/wgpu.rs
crates/egui_kittest/src/wgpu.rs
use std::sync::Arc; use std::{iter::once, time::Duration}; use egui::TexturesDelta; use egui_wgpu::{RenderState, ScreenDescriptor, WgpuSetup, wgpu}; use image::RgbaImage; use crate::texture_to_image::texture_to_image; /// Timeout for waiting on the GPU to finish rendering. /// /// Windows will reset native drivers a...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/src/snapshot.rs
crates/egui_kittest/src/snapshot.rs
use std::fmt::Display; use std::io::ErrorKind; use std::path::PathBuf; use image::ImageError; use crate::{Harness, config::config}; pub type SnapshotResult = Result<(), SnapshotError>; #[non_exhaustive] #[derive(Clone, Debug)] pub struct SnapshotOptions { /// The threshold for the image comparison. /// ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/tests/regression_tests.rs
crates/egui_kittest/tests/regression_tests.rs
use egui::accesskit::{self, Role}; use egui::{Button, ComboBox, Image, Modifiers, Popup, Vec2, Widget as _}; #[cfg(all(feature = "wgpu", feature = "snapshot"))] use egui_kittest::SnapshotResults; use egui_kittest::{Harness, kittest::Queryable as _}; #[test] pub fn focus_should_skip_over_disabled_buttons() { let mu...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/tests/tests.rs
crates/egui_kittest/tests/tests.rs
use egui::{Modifiers, ScrollArea, Vec2, include_image}; use egui_kittest::{Harness, SnapshotResults}; use kittest::Queryable as _; #[test] fn test_shrink() { let mut harness = Harness::new_ui(|ui| { ui.label("Hello, world!"); ui.separator(); ui.label("This is a test"); }); harness....
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/tests/accesskit.rs
crates/egui_kittest/tests/accesskit.rs
//! Tests the accesskit accessibility output of egui. use egui::{ CentralPanel, Context, RawInput, Ui, Window, accesskit::{NodeId, Role, TreeUpdate}, }; /// Baseline test that asserts there are no spurious nodes in the /// accesskit output when the ui is empty. /// /// This gives reasonable certainty that any...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/tests/menu.rs
crates/egui_kittest/tests/menu.rs
use egui::containers::menu::{MenuBar, MenuConfig, SubMenuButton}; use egui::{PopupCloseBehavior, Ui, include_image}; use egui_kittest::{Harness, SnapshotResults}; use kittest::Queryable as _; struct TestMenu { config: MenuConfig, checked: bool, } impl TestMenu { fn new(config: MenuConfig) -> Self { ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_kittest/tests/popup.rs
crates/egui_kittest/tests/popup.rs
use kittest::Queryable as _; #[test] fn test_interactive_tooltip() { struct State { link_clicked: bool, } let mut harness = egui_kittest::Harness::new_ui_state( |ui, state| { ui.label("I have a tooltip").on_hover_ui(|ui| { if ui.link("link").clicked() { ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui-winit/src/safe_area.rs
crates/egui-winit/src/safe_area.rs
#[cfg(target_os = "ios")] pub use ios::get_safe_area_insets; #[cfg(target_os = "ios")] mod ios { use egui::{SafeAreaInsets, epaint::MarginF32}; use objc2::{ClassType, rc::Retained}; use objc2_foundation::{MainThreadMarker, NSObjectProtocol}; use objc2_ui_kit::{UIApplication, UISceneActivationState, UIW...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui-winit/src/window_settings.rs
crates/egui-winit/src/window_settings.rs
use egui::ViewportBuilder; /// Can be used to store native window settings (position and size). #[derive(Clone, Copy, Debug, Default)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct WindowSettings { /// Position of window conte...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui-winit/src/lib.rs
crates/egui-winit/src/lib.rs
//! [`egui`] bindings for [`winit`](https://github.com/rust-windowing/winit). //! //! The library translates winit events to egui, handled copy/paste, //! updates the cursor, open links clicked in egui, etc. //! //! ## Feature flags #![cfg_attr(feature = "document-features", doc = document_features::document_features!(...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
true
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui-winit/src/clipboard.rs
crates/egui-winit/src/clipboard.rs
use raw_window_handle::RawDisplayHandle; /// Handles interfacing with the OS clipboard. /// /// If the "clipboard" feature is off, or we cannot connect to the OS clipboard, /// then a fallback clipboard that just works within the same app is used instead. pub struct Clipboard { #[cfg(all( not(any(target_os...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/lib.rs
crates/egui_demo_lib/src/lib.rs
//! Demo-code for showing how egui is used. //! //! This library can be used to test 3rd party egui integrations (see for instance <https://github.com/not-fl3/egui-miniquad/blob/master/examples/demo.rs>). //! //! The demo is also used in benchmarks and tests. //! //! ## Feature flags #![cfg_attr(feature = "document-fea...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/rendering_test.rs
crates/egui_demo_lib/src/rendering_test.rs
use std::collections::HashMap; use egui::{ Align2, Color32, FontId, Image, Mesh, Pos2, Rect, Response, Rgba, RichText, Sense, Shape, Stroke, TextureHandle, TextureOptions, Ui, Vec2, emath::GuiRounding as _, epaint, lerp, pos2, vec2, widgets::color_picker::show_color, }; const GRADIENT_SIZE: Vec2 = vec2(25...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/easy_mark/easy_mark_viewer.rs
crates/egui_demo_lib/src/easy_mark/easy_mark_viewer.rs
use super::easy_mark_parser as easy_mark; use egui::{ Align, Align2, Hyperlink, Layout, Response, RichText, Sense, Separator, Shape, TextStyle, Ui, vec2, }; /// Parse and display a VERY simple and small subset of Markdown. pub fn easy_mark(ui: &mut Ui, easy_mark: &str) { easy_mark_it(ui, easy_mark::Parser:...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/easy_mark/easy_mark_editor.rs
crates/egui_demo_lib/src/easy_mark/easy_mark_editor.rs
use egui::{ Key, KeyboardShortcut, Modifiers, ScrollArea, TextBuffer, TextEdit, Ui, text::CCursorRange, }; #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct EasyMarkEditor { code: String, highlight_editor: bool, show_r...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/easy_mark/easy_mark_highlighter.rs
crates/egui_demo_lib/src/easy_mark/easy_mark_highlighter.rs
use crate::easy_mark::easy_mark_parser; /// Highlight easymark, memoizing previous output to save CPU. /// /// In practice, the highlighter is fast enough not to need any caching. #[derive(Default)] pub struct MemoizedEasymarkHighlighter { style: egui::Style, code: String, output: egui::text::LayoutJob, } ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/easy_mark/easy_mark_parser.rs
crates/egui_demo_lib/src/easy_mark/easy_mark_parser.rs
//! A parser for `EasyMark`: a very simple markup language. //! //! WARNING: `EasyMark` is subject to change. // //! # `EasyMark` design goals: //! 1. easy to parse //! 2. easy to learn //! 3. similar to markdown #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum Item<'a> { /// `\n` // TODO(emilk): add Styl...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/easy_mark/mod.rs
crates/egui_demo_lib/src/easy_mark/mod.rs
//! Experimental markup language mod easy_mark_editor; mod easy_mark_highlighter; pub mod easy_mark_parser; mod easy_mark_viewer; pub use easy_mark_editor::EasyMarkEditor; pub use easy_mark_highlighter::MemoizedEasymarkHighlighter; pub use easy_mark_parser as parser; pub use easy_mark_viewer::easy_mark;
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/multi_touch.rs
crates/egui_demo_lib/src/demo/multi_touch.rs
use egui::{ Color32, Event, Frame, Pos2, Rect, Sense, Stroke, Vec2, emath::{RectTransform, Rot2}, vec2, }; pub struct MultiTouch { rotation: f32, translation: Vec2, zoom: f32, last_touch_time: f64, } impl Default for MultiTouch { fn default() -> Self { Self { rotati...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/painting.rs
crates/egui_demo_lib/src/demo/painting.rs
use egui::{Color32, Frame, Pos2, Rect, Sense, Stroke, Ui, Window, emath, vec2}; #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct Painting { /// in 0-1 normalized coordinates lines: Vec<Vec<Pos2>>, stroke: Stroke, } impl ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/highlighting.rs
crates/egui_demo_lib/src/demo/highlighting.rs
#[derive(Default)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct Highlighting {} impl crate::Demo for Highlighting { fn name(&self) -> &'static str { "✨ Highlighting" } fn show(&mut self, ui: &mut egui::Ui, op...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/toggle_switch.rs
crates/egui_demo_lib/src/demo/toggle_switch.rs
//! Source code example of how to create your own widget. //! This is meant to be read as a tutorial, hence the plethora of comments. /// iOS-style toggle switch: /// /// ``` text /// _____________ /// / /.....\ /// | |.......| /// \_______\_____/ /// ``` /// /// ## Example: /// ``` ignore ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/frame_demo.rs
crates/egui_demo_lib/src/demo/frame_demo.rs
/// Shows off a table with dynamic layout #[derive(PartialEq)] pub struct FrameDemo { frame: egui::Frame, } impl Default for FrameDemo { fn default() -> Self { Self { frame: egui::Frame::new() .inner_margin(12) .outer_margin(24) .corner_radius...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/password.rs
crates/egui_demo_lib/src/demo/password.rs
//! Source code example about creating a widget which uses `egui::Memory` to store UI state. //! //! This is meant to be read as a tutorial, hence the plethora of comments. /// Password entry field with ability to toggle character hiding. /// /// ## Example: /// ``` ignore /// password_ui(ui, &mut my_password); /// ``...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/code_editor.rs
crates/egui_demo_lib/src/demo/code_editor.rs
// ---------------------------------------------------------------------------- #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct CodeEditor { language: String, code: String, } impl Default for CodeEditor { fn default() -...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/strip_demo.rs
crates/egui_demo_lib/src/demo/strip_demo.rs
use egui::{Color32, TextStyle}; use egui_extras::{Size, StripBuilder}; /// Shows off a table with dynamic layout #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[derive(Default)] pub struct StripDemo {} impl crate::Demo for StripDemo { fn name(&self) -> &'static str { "▣ Stri...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/undo_redo.rs
crates/egui_demo_lib/src/demo/undo_redo.rs
use egui::{Button, util::undoer::Undoer}; #[derive(Debug, PartialEq, Eq, Clone)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct State { pub toggle_value: bool, pub text: String, } impl Default for State { fn default() ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/scrolling.rs
crates/egui_demo_lib/src/demo/scrolling.rs
use egui::{ Align, Align2, Color32, DragValue, NumExt as _, Rect, ScrollArea, Sense, Slider, TextStyle, TextWrapMode, Ui, Vec2, Widget as _, pos2, scroll_area::ScrollBarVisibility, }; #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[derive(Clone, Copy, Debug, Default, PartialEq)] ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/screenshot.rs
crates/egui_demo_lib/src/demo/screenshot.rs
use egui::{Image, UserData, ViewportCommand, Widget as _}; use std::sync::Arc; /// Showcase [`ViewportCommand::Screenshot`]. #[derive(PartialEq, Eq, Default)] pub struct Screenshot { image: Option<(Arc<egui::ColorImage>, egui::TextureHandle)>, continuous: bool, } impl crate::Demo for Screenshot { fn name(...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/scene.rs
crates/egui_demo_lib/src/demo/scene.rs
use egui::{Pos2, Rect, Scene, Vec2}; use super::widget_gallery; #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub struct SceneDemo { widget_gallery: widget_gallery::WidgetGallery, scene_rect: Rect, } impl Default for SceneDemo { fn default() -> Self { Self { ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/panels.rs
crates/egui_demo_lib/src/demo/panels.rs
#[derive(Clone, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub struct Panels {} impl crate::Demo for Panels { fn name(&self) -> &'static str { "🗖 Panels" } fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) { use crate::View a...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/dancing_strings.rs
crates/egui_demo_lib/src/demo/dancing_strings.rs
use egui::{ Color32, Pos2, Rect, Ui, containers::{Frame, Window}, emath, epaint, epaint::PathStroke, hex_color, lerp, pos2, remap, vec2, }; #[derive(Default)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct Danci...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/popups.rs
crates/egui_demo_lib/src/demo/popups.rs
use crate::rust_view_ui; use egui::color_picker::{Alpha, color_picker_color32}; use egui::containers::menu::{MenuConfig, SubMenuButton}; use egui::{ Align, Align2, Atom, Button, ComboBox, Frame, Id, Layout, Popup, PopupCloseBehavior, RectAlign, RichText, Tooltip, Ui, UiBuilder, include_image, }; /// Showcase [...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/drag_and_drop.rs
crates/egui_demo_lib/src/demo/drag_and_drop.rs
use egui::{Color32, Frame, Id, Ui, Window, vec2}; #[derive(Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub struct DragAndDropDemo { /// columns with items columns: Vec<Vec<String>>, } impl Default for DragAndDropDemo { fn default() -> Self { ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/window_options.rs
crates/egui_demo_lib/src/demo/window_options.rs
use egui::{UiKind, Vec2b}; #[derive(Clone, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub struct WindowOptions { title: String, title_bar: bool, closable: bool, collapsible: bool, resizable: bool, constrain: bool, scroll2: Vec2b, disabled_ti...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/font_book.rs
crates/egui_demo_lib/src/demo/font_book.rs
use std::collections::BTreeMap; struct GlyphInfo { name: String, // What fonts it is available in fonts: Vec<String>, } pub struct FontBook { filter: String, font_id: egui::FontId, available_glyphs: BTreeMap<egui::FontFamily, BTreeMap<char, GlyphInfo>>, } impl Default for FontBook { fn d...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/mod.rs
crates/egui_demo_lib/src/demo/mod.rs
//! Demo-code for showing how egui is used. //! //! The demo-code is also used in benchmarks and tests. // ---------------------------------------------------------------------------- pub mod about; pub mod code_editor; pub mod code_example; pub mod dancing_strings; pub mod demo_app_windows; pub mod drag_and_drop; pu...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/code_example.rs
crates/egui_demo_lib/src/demo/code_example.rs
#[derive(Debug)] pub struct CodeExample { name: String, age: u32, } impl Default for CodeExample { fn default() -> Self { Self { name: "Arthur".to_owned(), age: 42, } } } impl CodeExample { fn samples_in_grid(&mut self, ui: &mut egui::Ui) { // Note: ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/modals.rs
crates/egui_demo_lib/src/demo/modals.rs
use egui::{ComboBox, Id, Modal, ProgressBar, Ui, Widget as _, Window}; #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct Modals { user_modal_open: bool, save_modal_open: bool, save_progress: Option<f32>, role: &'stati...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/misc_demo_window.rs
crates/egui_demo_lib/src/demo/misc_demo_window.rs
use std::sync::Arc; use super::{Demo, View}; use egui::{ Align, Align2, Checkbox, CollapsingHeader, Color32, ComboBox, FontId, Resize, RichText, Sense, Slider, Stroke, TextFormat, TextStyle, Ui, Vec2, Window, vec2, }; /// Showcase some ui code #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::S...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/text_edit.rs
crates/egui_demo_lib/src/demo/text_edit.rs
/// Showcase [`egui::TextEdit`]. #[derive(PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct TextEditDemo { pub text: String, } impl Default for TextEditDemo { fn default() -> Self { Self { t...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/widget_gallery.rs
crates/egui_demo_lib/src/demo/widget_gallery.rs
#[derive(Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] enum Enum { First, Second, Third, } /// Shows off one example of each major type of widget. #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub struct WidgetGallery { en...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/sliders.rs
crates/egui_demo_lib/src/demo/sliders.rs
use egui::{Slider, SliderClamping, SliderOrientation, Ui, style::HandleShape}; /// Showcase sliders #[derive(PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct Sliders { pub min: f64, pub max: f64, pub logarithm...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/paint_bezier.rs
crates/egui_demo_lib/src/demo/paint_bezier.rs
use egui::{ Color32, Frame, Grid, Pos2, Rect, Sense, Shape, Stroke, StrokeKind, Ui, Vec2, Widget as _, Window, emath, epaint::{self, CubicBezierShape, PathShape, QuadraticBezierShape}, pos2, }; #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", se...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/interactive_container.rs
crates/egui_demo_lib/src/demo/interactive_container.rs
use egui::{Frame, Label, RichText, Sense, UiBuilder, Widget as _}; /// Showcase [`egui::Ui::response`]. #[derive(PartialEq, Eq, Default)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct InteractiveContainerDemo { count: usize, }...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/extra_viewport.rs
crates/egui_demo_lib/src/demo/extra_viewport.rs
#[derive(Default)] pub struct ExtraViewport {} impl crate::Demo for ExtraViewport { fn is_enabled(&self, ctx: &egui::Context) -> bool { !ctx.embed_viewports() } fn name(&self) -> &'static str { "🗖 Extra Viewport" } fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) { ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tooltips.rs
crates/egui_demo_lib/src/demo/tooltips.rs
#[derive(Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub struct Tooltips { enabled: bool, } impl Default for Tooltips { fn default() -> Self { Self { enabled: true } } } impl crate::Demo for Tooltips { fn name(&self) -> &'static str { ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/demo_app_windows.rs
crates/egui_demo_lib/src/demo/demo_app_windows.rs
use std::collections::BTreeSet; use super::About; use crate::Demo; use crate::View as _; use crate::is_mobile; use egui::containers::menu; use egui::style::StyleModifier; use egui::{Modifiers, ScrollArea, Ui}; // ---------------------------------------------------------------------------- struct DemoGroup { demos...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/text_layout.rs
crates/egui_demo_lib/src/demo/text_layout.rs
/// Showcase text layout #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct TextLayoutDemo { break_anywhere: bool, max_rows: usize, overflow_character: Option<char>, extra_letter_spacing: f32, line_height_pixels: u32...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/about.rs
crates/egui_demo_lib/src/demo/about.rs
#[derive(Default)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct About {} impl crate::Demo for About { fn name(&self) -> &'static str { "About egui" } fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) { ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/table_demo.rs
crates/egui_demo_lib/src/demo/table_demo.rs
use egui::{TextStyle, TextWrapMode}; #[derive(PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] enum DemoType { Manual, ManyHomogeneous, ManyHeterogenous, } /// Shows off a table with dynamic layout #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Seri...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/input_event_history.rs
crates/egui_demo_lib/src/demo/tests/input_event_history.rs
//! Show the history of all the input events to struct HistoryEntry { summary: String, entries: Vec<String>, } #[derive(Default)] struct DeduplicatedHistory { history: std::collections::VecDeque<HistoryEntry>, } impl DeduplicatedHistory { fn add(&mut self, summary: String, full: String) { if ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/window_resize_test.rs
crates/egui_demo_lib/src/demo/tests/window_resize_test.rs
pub struct WindowResizeTest { text: String, } impl Default for WindowResizeTest { fn default() -> Self { Self { text: crate::LOREM_IPSUM_LONG.to_owned(), } } } impl crate::Demo for WindowResizeTest { fn name(&self) -> &'static str { "Window Resize Test" } f...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/layout_test.rs
crates/egui_demo_lib/src/demo/tests/layout_test.rs
use egui::{Align, Direction, Layout, Resize, Slider, Ui, vec2}; #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct LayoutTest { // Identical to contents of `egui::Layout` layout: LayoutSettings, // Extra for testing wrappi...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/svg_test.rs
crates/egui_demo_lib/src/demo/tests/svg_test.rs
pub struct SvgTest { color: egui::Color32, } impl Default for SvgTest { fn default() -> Self { Self { color: egui::Color32::LIGHT_RED, } } } impl crate::Demo for SvgTest { fn name(&self) -> &'static str { "SVG Test" } fn show(&mut self, ui: &mut egui::Ui, o...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/manual_layout_test.rs
crates/egui_demo_lib/src/demo/tests/manual_layout_test.rs
#[derive(Clone, Copy, Debug, PartialEq)] enum WidgetType { Label, Button, TextEdit, } #[derive(Clone, Debug, PartialEq)] pub struct ManualLayoutTest { widget_offset: egui::Vec2, widget_size: egui::Vec2, widget_type: WidgetType, text_edit_contents: String, } impl Default for ManualLayoutTes...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/input_test.rs
crates/egui_demo_lib/src/demo/tests/input_test.rs
struct HistoryEntry { text: String, repeated: usize, } #[derive(Default)] struct DeduplicatedHistory { history: std::collections::VecDeque<HistoryEntry>, } impl DeduplicatedHistory { fn add(&mut self, text: String) { if let Some(entry) = self.history.back_mut() && entry.text == tex...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/clipboard_test.rs
crates/egui_demo_lib/src/demo/tests/clipboard_test.rs
pub struct ClipboardTest { text: String, } impl Default for ClipboardTest { fn default() -> Self { Self { text: "Example text you can copy-and-paste".to_owned(), } } } impl crate::Demo for ClipboardTest { fn name(&self) -> &'static str { "Clipboard Test" } ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/mod.rs
crates/egui_demo_lib/src/demo/tests/mod.rs
mod clipboard_test; mod cursor_test; mod grid_test; mod id_test; mod input_event_history; mod input_test; mod layout_test; mod manual_layout_test; mod svg_test; mod tessellation_test; mod window_resize_test; pub use clipboard_test::ClipboardTest; pub use cursor_test::CursorTest; pub use grid_test::GridTest; pub use id...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/id_test.rs
crates/egui_demo_lib/src/demo/tests/id_test.rs
#[derive(Default)] pub struct IdTest {} impl crate::Demo for IdTest { fn name(&self) -> &'static str { "ID Test" } fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) { egui::Window::new(self.name()) .open(open) .constrain_to(ui.available_rect_before_wrap()) ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/cursor_test.rs
crates/egui_demo_lib/src/demo/tests/cursor_test.rs
#[derive(Default)] pub struct CursorTest {} impl crate::Demo for CursorTest { fn name(&self) -> &'static str { "Cursor Test" } fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) { egui::Window::new(self.name()) .open(open) .constrain_to(ui.available_rect_before_...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/tessellation_test.rs
crates/egui_demo_lib/src/demo/tests/tessellation_test.rs
use std::sync::Arc; use egui::{ Color32, Pos2, Rect, Sense, StrokeKind, Vec2, emath::{GuiRounding as _, TSTransform}, epaint::{self, RectShape}, vec2, }; #[derive(Clone, Debug, PartialEq)] pub struct TessellationTest { shape: RectShape, magnification_pixel_size: f32, tessellation_options:...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/src/demo/tests/grid_test.rs
crates/egui_demo_lib/src/demo/tests/grid_test.rs
#[derive(PartialEq)] pub struct GridTest { num_cols: usize, num_rows: usize, min_col_width: f32, max_col_width: f32, text_length: usize, } impl Default for GridTest { fn default() -> Self { Self { num_cols: 4, num_rows: 4, min_col_width: 10.0, ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/tests/misc.rs
crates/egui_demo_lib/tests/misc.rs
use egui::{Color32, accesskit::Role}; use egui_kittest::{Harness, kittest::Queryable as _}; #[test] fn test_kerning() { let mut results = egui_kittest::SnapshotResults::new(); for pixels_per_point in [1.0, 2.0] { for theme in [egui::Theme::Dark, egui::Theme::Light] { let mut harness = Harne...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/tests/image_blending.rs
crates/egui_demo_lib/tests/image_blending.rs
use egui::{hex_color, include_image}; use egui_kittest::Harness; #[test] fn test_image_blending() { let mut results = egui_kittest::SnapshotResults::new(); for pixels_per_point in [1.0, 2.0] { let mut harness = Harness::builder() .with_pixels_per_point(pixels_per_point) .build_u...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/egui_demo_lib/benches/benchmark.rs
crates/egui_demo_lib/benches/benchmark.rs
use std::fmt::Write as _; use criterion::{BatchSize, Criterion, criterion_group, criterion_main}; use egui::epaint::TextShape; use egui::load::SizedTexture; use egui::{Button, Id, RichText, TextureId, Ui, UiBuilder, Vec2}; use egui_demo_lib::LOREM_IPSUM_LONG; use rand::Rng as _; #[global_allocator] static GLOBAL: mi...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint_default_fonts/src/lib.rs
crates/epaint_default_fonts/src/lib.rs
//! A library containing built-in fonts for `epaint`, embedded as bytes. //! //! This is intended to be consumed through the `epaint` crate. /// A typeface designed for source code. /// /// Hack is designed to be a workhorse typeface for source code. It has deep /// roots in the free, open source typeface community an...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/stroke.rs
crates/epaint/src/stroke.rs
use std::{fmt::Debug, sync::Arc}; use emath::GuiRounding as _; use super::{Color32, ColorMode, Pos2, Rect, emath}; /// Describes the width and color of a line. /// /// The default stroke is the same as [`Stroke::NONE`]. #[derive(Clone, Copy, Debug, Default, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Des...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/shadow.rs
crates/epaint/src/shadow.rs
use crate::{Color32, CornerRadius, MarginF32, Rect, RectShape, Vec2}; /// The color and fuzziness of a fuzzy shape. /// /// Can be used for a rectangular shadow with a soft penumbra. /// /// Very similar to a box-shadow in CSS. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/viewport.rs
crates/epaint/src/viewport.rs
use crate::Rect; /// Size of the viewport in whole, physical pixels. pub struct ViewportInPixels { /// Physical pixel offset for left side of the viewport. pub left_px: i32, /// Physical pixel offset for top side of the viewport. pub top_px: i32, /// Physical pixel offset for bottom side of the v...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/stats.rs
crates/epaint/src/stats.rs
//! Collect statistics about what is being painted. use crate::{ClippedShape, Galley, Mesh, Primitive, Shape}; /// Size of the elements in a vector/array. #[derive(Clone, Copy, Default, PartialEq)] enum ElementSize { #[default] Unknown, Homogeneous(usize), Heterogenous, } /// Aggregate information ab...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/lib.rs
crates/epaint/src/lib.rs
//! A simple 2D graphics library for turning simple 2D shapes and text into textured triangles. //! //! Made for [`egui`](https://github.com/emilk/egui/). //! //! Create some [`Shape`]:s and pass them to [`Tessellator::tessellate_shapes`] to generate [`Mesh`]:es //! that you can then paint using some graphics API of yo...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/image.rs
crates/epaint/src/image.rs
use emath::Vec2; use crate::{Color32, textures::TextureOptions}; use std::sync::Arc; /// An image stored in RAM. /// /// To load an image file, see [`ColorImage::from_rgba_unmultiplied`]. /// /// This is currently an enum with only one variant, but more image types may be added in the future. /// /// See also: [`Colo...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/mutex.rs
crates/epaint/src/mutex.rs
//! Wrappers around `parking_lot` locks, with a simple deadlock detection mechanism. // ---------------------------------------------------------------------------- const DEADLOCK_DURATION: std::time::Duration = std::time::Duration::from_secs(10); /// Provides interior mutability. /// /// It's tailored for internal ...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/margin.rs
crates/epaint/src/margin.rs
use emath::{Rect, Vec2, vec2}; /// A value for all four sides of a rectangle, /// often used to express padding or spacing. /// /// Can be added and subtracted to/from [`Rect`]s. /// /// Negative margins are possible, but may produce weird behavior. /// Use with care. /// /// All values are stored as [`i8`] to keep th...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/margin_f32.rs
crates/epaint/src/margin_f32.rs
use emath::{Rect, Vec2, vec2}; use crate::Margin; /// A value for all four sides of a rectangle, /// often used to express padding or spacing. /// /// Can be added and subtracted to/from [`Rect`]s. /// /// For storage, use [`crate::Margin`] instead. #[derive(Clone, Copy, Debug, Default, PartialEq)] #[cfg_attr(feature...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/tessellator.rs
crates/epaint/src/tessellator.rs
//! Converts graphics primitives into textured triangles. //! //! This module converts lines, circles, text and more represented by [`Shape`] //! into textured triangles represented by [`Mesh`]. #![expect(clippy::identity_op)] use emath::{GuiRounding as _, NumExt as _, Pos2, Rect, Rot2, Vec2, pos2, remap, vec2}; use...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
true
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/corner_radius.rs
crates/epaint/src/corner_radius.rs
/// How rounded the corners of things should be. /// /// This specific the _corner radius_ of the underlying geometric shape (e.g. rectangle). /// If there is a stroke, then the stroke will have an inner and outer corner radius /// which will depends on its width and [`crate::StrokeKind`]. /// /// The rounding uses `u8...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false
emilk/egui
https://github.com/emilk/egui/blob/9e95b9ca50c224077617434707f7bd29bd70938b/crates/epaint/src/mesh.rs
crates/epaint/src/mesh.rs
use crate::{Color32, TextureId, WHITE_UV, emath}; use emath::{Pos2, Rect, Rot2, TSTransform, Vec2}; /// The 2D vertex type. /// /// Should be friendly to send to GPU as is. #[repr(C)] #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] #[cfg(any(not(feature = "unity"), feature = "_override_unity"))] #[cfg_attr(featu...
rust
Apache-2.0
9e95b9ca50c224077617434707f7bd29bd70938b
2026-01-04T15:36:36.351731Z
false