mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Constrain demo windows to the space left after the panels (#7785)
This commit is contained in:
@@ -8,14 +8,15 @@ impl crate::Demo for About {
|
|||||||
"About egui"
|
"About egui"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.default_width(320.0)
|
.default_width(320.0)
|
||||||
.default_height(480.0)
|
.default_height(480.0)
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable([true, false])
|
.resizable([true, false])
|
||||||
.scroll(false)
|
.scroll(false)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,12 +26,13 @@ impl crate::Demo for CodeEditor {
|
|||||||
"🖮 Code Editor"
|
"🖮 Code Editor"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.default_height(500.0)
|
.default_height(500.0)
|
||||||
.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ impl crate::Demo for CodeExample {
|
|||||||
"🖮 Code Example"
|
"🖮 Code Example"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
@@ -113,7 +113,8 @@ impl crate::Demo for CodeExample {
|
|||||||
.default_size([390.0, 500.0])
|
.default_size([390.0, 500.0])
|
||||||
.scroll(false)
|
.scroll(false)
|
||||||
.resizable([true, false]) // resizable so we can shrink if the text edit grows
|
.resizable([true, false]) // resizable so we can shrink if the text edit grows
|
||||||
.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use egui::{
|
use egui::{
|
||||||
Color32, Context, Pos2, Rect, Ui,
|
Color32, Pos2, Rect, Ui,
|
||||||
containers::{Frame, Window},
|
containers::{Frame, Window},
|
||||||
emath, epaint,
|
emath, epaint,
|
||||||
epaint::PathStroke,
|
epaint::PathStroke,
|
||||||
@@ -18,13 +18,14 @@ impl crate::Demo for DancingStrings {
|
|||||||
"♫ Dancing Strings"
|
"♫ Dancing Strings"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut Ui, open: &mut bool) {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
Window::new(self.name())
|
Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.default_size(vec2(512.0, 256.0))
|
.default_size(vec2(512.0, 256.0))
|
||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use crate::View as _;
|
|||||||
use crate::is_mobile;
|
use crate::is_mobile;
|
||||||
use egui::containers::menu;
|
use egui::containers::menu;
|
||||||
use egui::style::StyleModifier;
|
use egui::style::StyleModifier;
|
||||||
use egui::{Context, Modifiers, ScrollArea, Ui};
|
use egui::{Modifiers, ScrollArea, Ui};
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
struct DemoGroup {
|
struct DemoGroup {
|
||||||
@@ -39,11 +39,11 @@ impl DemoGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn windows(&mut self, ctx: &Context, open: &mut BTreeSet<String>) {
|
pub fn windows(&mut self, ui: &mut Ui, open: &mut BTreeSet<String>) {
|
||||||
let Self { demos } = self;
|
let Self { demos } = self;
|
||||||
for demo in demos {
|
for demo in demos {
|
||||||
let mut is_open = open.contains(demo.name());
|
let mut is_open = open.contains(demo.name());
|
||||||
demo.show(ctx, &mut is_open);
|
demo.show(ui, &mut is_open);
|
||||||
set_open(open, demo.name(), is_open);
|
set_open(open, demo.name(), is_open);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ impl DemoGroups {
|
|||||||
tests.checkboxes(ui, open);
|
tests.checkboxes(ui, open);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn windows(&mut self, ctx: &Context, open: &mut BTreeSet<String>) {
|
pub fn windows(&mut self, ui: &mut Ui, open: &mut BTreeSet<String>) {
|
||||||
let Self {
|
let Self {
|
||||||
about,
|
about,
|
||||||
demos,
|
demos,
|
||||||
@@ -145,11 +145,11 @@ impl DemoGroups {
|
|||||||
} = self;
|
} = self;
|
||||||
{
|
{
|
||||||
let mut is_open = open.contains(about.name());
|
let mut is_open = open.contains(about.name());
|
||||||
about.show(ctx, &mut is_open);
|
about.show(ui, &mut is_open);
|
||||||
set_open(open, about.name(), is_open);
|
set_open(open, about.name(), is_open);
|
||||||
}
|
}
|
||||||
demos.windows(ctx, open);
|
demos.windows(ui, open);
|
||||||
tests.windows(ctx, open);
|
tests.windows(ui, open);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ impl DemoWindows {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.mobile_top_bar(ui);
|
self.mobile_top_bar(ui);
|
||||||
self.groups.windows(ui.ctx(), &mut self.open);
|
self.groups.windows(ui, &mut self.open);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,7 +295,7 @@ impl DemoWindows {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
self.groups.windows(ui.ctx(), &mut self.open);
|
self.groups.windows(ui, &mut self.open);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn demo_list_ui(&mut self, ui: &mut egui::Ui) {
|
fn demo_list_ui(&mut self, ui: &mut egui::Ui) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use egui::{Color32, Context, Frame, Id, Ui, Window, vec2};
|
use egui::{Color32, Frame, Id, Ui, Window, vec2};
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq)]
|
#[derive(Clone, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||||
@@ -27,14 +27,15 @@ impl crate::Demo for DragAndDropDemo {
|
|||||||
"✋ Drag and Drop"
|
"✋ Drag and Drop"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
Window::new(self.name())
|
Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.default_size(vec2(256.0, 256.0))
|
.default_size(vec2(256.0, 256.0))
|
||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ impl crate::Demo for ExtraViewport {
|
|||||||
"🗖 Extra Viewport"
|
"🗖 Extra Viewport"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
if !*open {
|
if !*open {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let id = egui::Id::new(self.name());
|
let id = egui::Id::new(self.name());
|
||||||
|
|
||||||
ctx.show_viewport_immediate(
|
ui.show_viewport_immediate(
|
||||||
egui::ViewportId(id),
|
egui::ViewportId(id),
|
||||||
egui::ViewportBuilder::default()
|
egui::ViewportBuilder::default()
|
||||||
.with_title(self.name())
|
.with_title(self.name())
|
||||||
@@ -28,7 +28,7 @@ impl crate::Demo for ExtraViewport {
|
|||||||
ui.label("This egui integration does not support multiple viewports");
|
ui.label("This egui integration does not support multiple viewports");
|
||||||
} else {
|
} else {
|
||||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||||
viewport_content(ui, ctx, open);
|
viewport_content(ui, open);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -36,13 +36,13 @@ impl crate::Demo for ExtraViewport {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn viewport_content(ui: &mut egui::Ui, ctx: &egui::Context, open: &mut bool) {
|
fn viewport_content(ui: &mut egui::Ui, open: &mut bool) {
|
||||||
ui.label("egui and eframe supports having multiple native windows like this, which egui calls 'viewports'.");
|
ui.label("egui and eframe supports having multiple native windows like this, which egui calls 'viewports'.");
|
||||||
|
|
||||||
ui.label(format!(
|
ui.label(format!(
|
||||||
"This viewport has id: {:?}, child of viewport {:?}",
|
"This viewport has id: {:?}, child of viewport {:?}",
|
||||||
ctx.viewport_id(),
|
ui.viewport_id(),
|
||||||
ctx.parent_viewport_id()
|
ui.parent_viewport_id()
|
||||||
));
|
));
|
||||||
|
|
||||||
ui.label("Here you can see all the open viewports:");
|
ui.label("Here you can see all the open viewports:");
|
||||||
|
|||||||
@@ -28,11 +28,14 @@ impl crate::Demo for FontBook {
|
|||||||
"🔤 Font Book"
|
"🔤 Font Book"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name()).open(open).show(ctx, |ui| {
|
egui::Window::new(self.name())
|
||||||
use crate::View as _;
|
.open(open)
|
||||||
self.ui(ui);
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
});
|
.show(ui, |ui| {
|
||||||
|
use crate::View as _;
|
||||||
|
self.ui(ui);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,11 +28,12 @@ impl crate::Demo for FrameDemo {
|
|||||||
"▣ Frame"
|
"▣ Frame"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,11 +8,12 @@ impl crate::Demo for Highlighting {
|
|||||||
"✨ Highlighting"
|
"✨ Highlighting"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.default_width(320.0)
|
.default_width(320.0)
|
||||||
.open(open)
|
.open(open)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ impl crate::Demo for InteractiveContainerDemo {
|
|||||||
"\u{20E3} Interactive Container"
|
"\u{20E3} Interactive Container"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.default_width(250.0)
|
.default_width(250.0)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ use std::sync::Arc;
|
|||||||
use super::{Demo, View};
|
use super::{Demo, View};
|
||||||
|
|
||||||
use egui::{
|
use egui::{
|
||||||
Align, Align2, Checkbox, CollapsingHeader, Color32, ComboBox, Context, FontId, Resize,
|
Align, Align2, Checkbox, CollapsingHeader, Color32, ComboBox, FontId, Resize, RichText, Sense,
|
||||||
RichText, Sense, Slider, Stroke, TextFormat, TextStyle, Ui, Vec2, Window, vec2,
|
Slider, Stroke, TextFormat, TextStyle, Ui, Vec2, Window, vec2,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Showcase some ui code
|
/// Showcase some ui code
|
||||||
@@ -49,12 +49,13 @@ impl Demo for MiscDemoWindow {
|
|||||||
"✨ Misc Demos"
|
"✨ Misc Demos"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
Window::new(self.name())
|
Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.vscroll(true)
|
.vscroll(true)
|
||||||
.hscroll(true)
|
.hscroll(true)
|
||||||
.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,5 +61,5 @@ pub trait Demo {
|
|||||||
fn name(&self) -> &'static str;
|
fn name(&self) -> &'static str;
|
||||||
|
|
||||||
/// Show windows, etc
|
/// Show windows, etc
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool);
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use egui::{ComboBox, Context, Id, Modal, ProgressBar, Ui, Widget as _, Window};
|
use egui::{ComboBox, Id, Modal, ProgressBar, Ui, Widget as _, Window};
|
||||||
|
|
||||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||||
#[cfg_attr(feature = "serde", serde(default))]
|
#[cfg_attr(feature = "serde", serde(default))]
|
||||||
@@ -32,13 +32,14 @@ impl crate::Demo for Modals {
|
|||||||
"🗖 Modals"
|
"🗖 Modals"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
Window::new(self.name())
|
Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,12 +27,13 @@ impl crate::Demo for MultiTouch {
|
|||||||
"👌 Multi Touch"
|
"👌 Multi Touch"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.default_size(vec2(544.0, 512.0))
|
.default_size(vec2(544.0, 512.0))
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use egui::{
|
use egui::{
|
||||||
Color32, Context, Frame, Grid, Pos2, Rect, Sense, Shape, Stroke, StrokeKind, Ui, Vec2,
|
Color32, Frame, Grid, Pos2, Rect, Sense, Shape, Stroke, StrokeKind, Ui, Vec2, Widget as _,
|
||||||
Widget as _, Window, emath,
|
Window, emath,
|
||||||
epaint::{self, CubicBezierShape, PathShape, QuadraticBezierShape},
|
epaint::{self, CubicBezierShape, PathShape, QuadraticBezierShape},
|
||||||
pos2,
|
pos2,
|
||||||
};
|
};
|
||||||
@@ -165,14 +165,15 @@ impl crate::Demo for PaintBezier {
|
|||||||
") Bézier Curve"
|
") Bézier Curve"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
Window::new(self.name())
|
Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.default_size([300.0, 350.0])
|
.default_size([300.0, 350.0])
|
||||||
.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use egui::{Color32, Context, Frame, Pos2, Rect, Sense, Stroke, Ui, Window, emath, vec2};
|
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", derive(serde::Deserialize, serde::Serialize))]
|
||||||
#[cfg_attr(feature = "serde", serde(default))]
|
#[cfg_attr(feature = "serde", serde(default))]
|
||||||
@@ -77,13 +77,14 @@ impl crate::Demo for Painting {
|
|||||||
"🖊 Painting"
|
"🖊 Painting"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
Window::new(self.name())
|
Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.default_size(vec2(512.0, 512.0))
|
.default_size(vec2(512.0, 512.0))
|
||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,15 @@ impl crate::Demo for Panels {
|
|||||||
"🗖 Panels"
|
"🗖 Panels"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
let window = egui::Window::new("Panels")
|
egui::Window::new("Panels")
|
||||||
.default_width(600.0)
|
.default_width(600.0)
|
||||||
.default_height(400.0)
|
.default_height(400.0)
|
||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.open(open);
|
.open(open)
|
||||||
window.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -128,13 +128,14 @@ impl crate::Demo for PopupsDemo {
|
|||||||
"\u{2755} Popups"
|
"\u{2755} Popups"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.default_width(250.0)
|
.default_width(250.0)
|
||||||
.constrain(false)
|
.constrain(false)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,14 +22,15 @@ impl crate::Demo for SceneDemo {
|
|||||||
"🔍 Scene"
|
"🔍 Scene"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
let window = egui::Window::new("Scene")
|
egui::Window::new("Scene")
|
||||||
.default_width(300.0)
|
.default_width(300.0)
|
||||||
.default_height(300.0)
|
.default_height(300.0)
|
||||||
.scroll(false)
|
.scroll(false)
|
||||||
.open(open);
|
.open(open)
|
||||||
window.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ impl crate::Demo for Screenshot {
|
|||||||
"📷 Screenshot"
|
"📷 Screenshot"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.default_width(250.0)
|
.default_width(250.0)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -30,13 +30,14 @@ impl crate::Demo for Scrolling {
|
|||||||
"↕ Scrolling"
|
"↕ Scrolling"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.hscroll(false)
|
.hscroll(false)
|
||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -43,11 +43,12 @@ impl crate::Demo for Sliders {
|
|||||||
"⬌ Sliders"
|
"⬌ Sliders"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,12 +11,13 @@ impl crate::Demo for StripDemo {
|
|||||||
"▣ Strip"
|
"▣ Strip"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.default_width(400.0)
|
.default_width(400.0)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,11 +47,12 @@ impl crate::Demo for TableDemo {
|
|||||||
"☰ Table"
|
"☰ Table"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.default_width(400.0)
|
.default_width(400.0)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,11 +15,14 @@ impl crate::Demo for ClipboardTest {
|
|||||||
"Clipboard Test"
|
"Clipboard Test"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name()).open(open).show(ctx, |ui| {
|
egui::Window::new(self.name())
|
||||||
use crate::View as _;
|
.open(open)
|
||||||
self.ui(ui);
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
});
|
.show(ui, |ui| {
|
||||||
|
use crate::View as _;
|
||||||
|
self.ui(ui);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ impl crate::Demo for CursorTest {
|
|||||||
"Cursor Test"
|
"Cursor Test"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name()).open(open).show(ctx, |ui| {
|
egui::Window::new(self.name())
|
||||||
use crate::View as _;
|
.open(open)
|
||||||
self.ui(ui);
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
});
|
.show(ui, |ui| {
|
||||||
|
use crate::View as _;
|
||||||
|
self.ui(ui);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,11 +24,14 @@ impl crate::Demo for GridTest {
|
|||||||
"Grid Test"
|
"Grid Test"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name()).open(open).show(ctx, |ui| {
|
egui::Window::new(self.name())
|
||||||
use crate::View as _;
|
.open(open)
|
||||||
self.ui(ui);
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
});
|
.show(ui, |ui| {
|
||||||
|
use crate::View as _;
|
||||||
|
self.ui(ui);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ impl crate::Demo for IdTest {
|
|||||||
"ID Test"
|
"ID Test"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name()).open(open).show(ctx, |ui| {
|
egui::Window::new(self.name())
|
||||||
use crate::View as _;
|
.open(open)
|
||||||
self.ui(ui);
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
});
|
.show(ui, |ui| {
|
||||||
|
use crate::View as _;
|
||||||
|
self.ui(ui);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,13 +70,14 @@ impl crate::Demo for InputEventHistory {
|
|||||||
"Input Event History"
|
"Input Event History"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.default_width(800.0)
|
.default_width(800.0)
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.scroll(false)
|
.scroll(false)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -59,13 +59,14 @@ impl crate::Demo for InputTest {
|
|||||||
"Input Test"
|
"Input Test"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.default_width(800.0)
|
.default_width(800.0)
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.scroll(false)
|
.scroll(false)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -78,11 +78,12 @@ impl crate::Demo for LayoutTest {
|
|||||||
"Layout Test"
|
"Layout Test"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -29,11 +29,12 @@ impl crate::Demo for ManualLayoutTest {
|
|||||||
"Manual Layout Test"
|
"Manual Layout Test"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.open(open)
|
.open(open)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,11 +15,14 @@ impl crate::Demo for SvgTest {
|
|||||||
"SVG Test"
|
"SVG Test"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name()).open(open).show(ctx, |ui| {
|
egui::Window::new(self.name())
|
||||||
use crate::View as _;
|
.open(open)
|
||||||
self.ui(ui);
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
});
|
.show(ui, |ui| {
|
||||||
|
use crate::View as _;
|
||||||
|
self.ui(ui);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,11 +124,12 @@ impl crate::Demo for TessellationTest {
|
|||||||
"Tessellation Test"
|
"Tessellation Test"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.open(open)
|
.open(open)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,13 +15,14 @@ impl crate::Demo for WindowResizeTest {
|
|||||||
"Window Resize Test"
|
"Window Resize Test"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
use egui::{Resize, ScrollArea, TextEdit, Window};
|
use egui::{Resize, ScrollArea, TextEdit, Window};
|
||||||
|
|
||||||
Window::new("↔ auto-sized")
|
Window::new("↔ auto-sized")
|
||||||
.open(open)
|
.open(open)
|
||||||
.auto_sized()
|
.auto_sized()
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
ui.label("This window will auto-size based on its contents.");
|
ui.label("This window will auto-size based on its contents.");
|
||||||
ui.heading("Resize this area:");
|
ui.heading("Resize this area:");
|
||||||
Resize::default().show(ui, |ui| {
|
Resize::default().show(ui, |ui| {
|
||||||
@@ -35,7 +36,8 @@ impl crate::Demo for WindowResizeTest {
|
|||||||
.vscroll(true)
|
.vscroll(true)
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.default_height(300.0)
|
.default_height(300.0)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
ui.label(
|
ui.label(
|
||||||
"This window is resizable and has a scroll area. You can shrink it to any size.",
|
"This window is resizable and has a scroll area. You can shrink it to any size.",
|
||||||
);
|
);
|
||||||
@@ -48,7 +50,8 @@ impl crate::Demo for WindowResizeTest {
|
|||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.default_height(300.0)
|
.default_height(300.0)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
ui.label("This window is resizable but has no built-in scroll area.");
|
ui.label("This window is resizable but has no built-in scroll area.");
|
||||||
ui.label("However, we have a sub-region with a scroll bar:");
|
ui.label("However, we have a sub-region with a scroll bar:");
|
||||||
ui.separator();
|
ui.separator();
|
||||||
@@ -64,7 +67,8 @@ impl crate::Demo for WindowResizeTest {
|
|||||||
.open(open)
|
.open(open)
|
||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
ui.label("This window is resizable but has no scroll area. This means it can only be resized to a size where all the contents is visible.");
|
ui.label("This window is resizable but has no scroll area. This means it can only be resized to a size where all the contents is visible.");
|
||||||
ui.label("egui will not clip the contents of a window, nor add whitespace to it.");
|
ui.label("egui will not clip the contents of a window, nor add whitespace to it.");
|
||||||
ui.separator();
|
ui.separator();
|
||||||
@@ -76,7 +80,8 @@ impl crate::Demo for WindowResizeTest {
|
|||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.default_height(300.0)
|
.default_height(300.0)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
ui.label("Shows how you can fill an area with a widget.");
|
ui.label("Shows how you can fill an area with a widget.");
|
||||||
ui.add_sized(ui.available_size(), TextEdit::multiline(&mut self.text));
|
ui.add_sized(ui.available_size(), TextEdit::multiline(&mut self.text));
|
||||||
});
|
});
|
||||||
@@ -86,7 +91,8 @@ impl crate::Demo for WindowResizeTest {
|
|||||||
.vscroll(false)
|
.vscroll(false)
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.default_size([250.0, 150.0])
|
.default_size([250.0, 150.0])
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
ui.label("This window has empty space that fills up the available space, preventing auto-shrink.");
|
ui.label("This window has empty space that fills up the available space, preventing auto-shrink.");
|
||||||
ui.vertical_centered(|ui| {
|
ui.vertical_centered(|ui| {
|
||||||
ui.add(crate::egui_github_link_file!());
|
ui.add(crate::egui_github_link_file!());
|
||||||
|
|||||||
@@ -19,11 +19,12 @@ impl crate::Demo for TextEditDemo {
|
|||||||
"🖹 TextEdit"
|
"🖹 TextEdit"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,11 +28,12 @@ impl crate::Demo for TextLayoutDemo {
|
|||||||
"🖹 Text Layout"
|
"🖹 Text Layout"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,15 +15,16 @@ impl crate::Demo for Tooltips {
|
|||||||
"🗖 Tooltips"
|
"🗖 Tooltips"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
let window = egui::Window::new("Tooltips")
|
egui::Window::new("Tooltips")
|
||||||
.constrain(false) // So we can test how tooltips behave close to the screen edge
|
.constrain(false) // So we can test how tooltips behave close to the screen edge
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
.default_size([450.0, 300.0])
|
.default_size([450.0, 300.0])
|
||||||
.scroll(false)
|
.scroll(false)
|
||||||
.open(open);
|
.open(open)
|
||||||
window.show(ctx, |ui| self.ui(ui));
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,12 @@ impl crate::Demo for UndoRedoDemo {
|
|||||||
"⟲ Undo Redo"
|
"⟲ Undo Redo"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -64,12 +64,13 @@ impl crate::Demo for WidgetGallery {
|
|||||||
"🗄 Widget Gallery"
|
"🗄 Widget Gallery"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
egui::Window::new(self.name())
|
egui::Window::new(self.name())
|
||||||
.open(open)
|
.open(open)
|
||||||
.resizable([true, false]) // resizable so we can shrink if the text edit grows
|
.resizable([true, false]) // resizable so we can shrink if the text edit grows
|
||||||
.default_width(280.0)
|
.default_width(280.0)
|
||||||
.show(ctx, |ui| {
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
|
.show(ui, |ui| {
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ impl crate::Demo for WindowOptions {
|
|||||||
"🗖 Window Options"
|
"🗖 Window Options"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||||
let Self {
|
let Self {
|
||||||
title,
|
title,
|
||||||
title_bar,
|
title_bar,
|
||||||
@@ -55,9 +55,9 @@ impl crate::Demo for WindowOptions {
|
|||||||
anchor_offset,
|
anchor_offset,
|
||||||
} = self.clone();
|
} = self.clone();
|
||||||
|
|
||||||
let enabled = ctx.input(|i| i.time) - disabled_time > 2.0;
|
let enabled = ui.input(|i| i.time) - disabled_time > 2.0;
|
||||||
if !enabled {
|
if !enabled {
|
||||||
ctx.request_repaint();
|
ui.request_repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
use crate::View as _;
|
use crate::View as _;
|
||||||
@@ -68,6 +68,7 @@ impl crate::Demo for WindowOptions {
|
|||||||
.collapsible(collapsible)
|
.collapsible(collapsible)
|
||||||
.title_bar(title_bar)
|
.title_bar(title_bar)
|
||||||
.scroll(scroll2)
|
.scroll(scroll2)
|
||||||
|
.constrain_to(ui.available_rect_before_wrap())
|
||||||
.enabled(enabled);
|
.enabled(enabled);
|
||||||
if closable {
|
if closable {
|
||||||
window = window.open(open);
|
window = window.open(open);
|
||||||
@@ -75,7 +76,7 @@ impl crate::Demo for WindowOptions {
|
|||||||
if anchored {
|
if anchored {
|
||||||
window = window.anchor(anchor, anchor_offset);
|
window = window.anchor(anchor, anchor_offset);
|
||||||
}
|
}
|
||||||
window.show(ctx, |ui| self.ui(ui));
|
window.show(ui, |ui| self.ui(ui));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:83fa0f1398d89692f52914ac015c9cb2dd4ead027de9956832c78480c0d4d9c1
|
oid sha256:bff16d453b960bb9abcdd9f72dab73f8f25da6339a0e1c310ed352f57080db93
|
||||||
size 32892
|
size 32426
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:7e5c1e2ce07d878a3cbcabea3463a8c7039f04f76a00d77b2dd22e67e6a4e21f
|
oid sha256:52d2233594c4bad348f5479dcfad9576ee5fd7d49faedb6f5ba74b374cdaf3ad
|
||||||
size 27430
|
size 26977
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:0ee82be647dee0911470b881b320ab0acfcde24f650080e934d2c144e24b766e
|
oid sha256:47f6cd15b88df83a9b2d8538e424041e661712f2e85312166a581f69f1254643
|
||||||
size 27210
|
size 26839
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:7ded3b3409d53c9ca105f00b94c055b39d00624548bb711a894e5e1ffa6f7633
|
oid sha256:9302478abb0b86fae1af3af45d91f032272a56a2098405525d08aba4f9534644
|
||||||
size 76751
|
size 76103
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:0f6e810e750b30c8c5c9b887e40bf6a28bd4ed7f86f9d0fb3461d766ad8fa743
|
oid sha256:6927950ccbc5c81d6fbfe0a90ddd79a4306518caced14bb60debd30c7e41d326
|
||||||
size 63152
|
size 62604
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:d08924744c5415658bb50a61c24a5a0f32da5980bf8a3bf9bc7fed7c438b8c38
|
oid sha256:366d18457aabf1ebdd42fdbce8819cc67a4f59db85c452623b02ee1d0e8fc50a
|
||||||
size 28653
|
size 27817
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:42c8b9fa8012d3fa003e15a6e9fca034290c289dd1d5c460f5a2733642cd511b
|
oid sha256:d194db1705b36c1ee6189878a323a591555493c9319b7c2ddfc0cb0541055aca
|
||||||
size 21449
|
size 20948
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:0586f037cc3d4b1c71071088d2fe78d79b4758fb1764ef90983263a2503f685d
|
oid sha256:3c5e803659e936268b476690427ef6a6802f477e078dc956a9d1c857b48da868
|
||||||
size 115118
|
size 114409
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:ec7746e0c7726a5dbd96f4b1889af692dbadf92ad9cecd1130bff66f197866d6
|
oid sha256:f5e67baf0696792e50f7ab3121874d055ddee2de0514712aacbf8e135ec4743d
|
||||||
size 25845
|
size 25425
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:50afb5e56eeb864d6887446eb3b59f1cfa0cb867d3fe6d34264f3db8ba8c45c7
|
oid sha256:55c5fb90736a31fbccd72be5994fc8c62b4b9da9842ad1e6bb795a1e1461a6f8
|
||||||
size 99359
|
size 98780
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:f951893a437aeebcfefb3d209ceb857319af8792fa37ad93d43e16becaef95b9
|
oid sha256:a4080ee1a16eea16c8f4246fe3e760ade7d0289b30d88068d1e49ffb88d88dca
|
||||||
size 18734
|
size 18280
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:1f2b751c6d8cc242f5cd8154f0dbb1ba6f9d5193f2081f693aff66f7a793c628
|
oid sha256:600d9e0fc193396f36b599e4bfad2547128160d2e56dc2a989cb5f978d5115ae
|
||||||
size 114391
|
size 113797
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:a2c4dcc17baff6562834e4ecad12bd3c7a84c8c1ad9e49292e165c4a9d15cc96
|
oid sha256:72d49d9a35e16e7413158ba14ce9cab762925f5f5e52fbbe16292de499a177f1
|
||||||
size 26075
|
size 25791
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:6380eb90d22f2106cdf281e0a36002574cdcd91461bcb38d386f233ad4501629
|
oid sha256:bb7e3887cf12bd00ea09b297ac361562a961f64c15b28360bc87f72f270a4065
|
||||||
size 51993
|
size 51649
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:38d59f1cb946946633c6d8ee0a9bf8e833069c39399ad04098788bd94e623428
|
oid sha256:3ae5e843cc9d847b0f3c4092f55b914699adb506cb807b0a97bfc4ec7d94537b
|
||||||
size 23092
|
size 22613
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:4c7e32b5bcc55d868fc4572892af7954a36c19952b13b87d551d14f992fe28d8
|
oid sha256:b0d38cb1eebf3ce7d661d094175b425db2b9eccc5e439b14256c5d801d4454d4
|
||||||
size 47798
|
size 47285
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:c4389d7f189deac9373fcac8eabf0e8f0d0c13132ea5fcbd27fab4798ae6c0c9
|
oid sha256:00e4c7659cd50044d473dd2c138392f78ac7eba27f2b52bae61246f5dc5b2782
|
||||||
size 23225
|
size 23156
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:809db3c8a05063eee51d81a5f4534ee6bf34b4fb6ecbab11270bd5e74b4e4b08
|
oid sha256:604f716e687fc26abba92769fe2dae75d850b18598d2e8a9524451ab0f760251
|
||||||
size 65871
|
size 65403
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:9bca3502a86fd33cbfe69510daa66e69b620ac4cc0f43821339b5a98a8dcfdc5
|
oid sha256:34de6fd788288174e8e6f1fa48cd49dbc7b14fcf649fe302aed49c8c50178aa8
|
||||||
size 33910
|
size 33469
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:c674aa4700a09da0ad48d29bc6c3846ac890312d2fb11ebf84c2206619991b60
|
oid sha256:115398e2b4b459afc2f1c49c4e60ef3f63e562650f05581372002c93030da632
|
||||||
size 38716
|
size 38374
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:1279e7725b992e055e26598d3d0e4e940b32cabff86331b450536e8ecaa4d97a
|
oid sha256:96760220222bdde8dd1b3d28f089af2892403b78df8d34d3d94dc1a604387083
|
||||||
size 18652
|
size 18241
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:fa1f59695d875e2c46dbec7264da6238a1cbf67d03aa5a58c13d9d2ee4d4f7a1
|
oid sha256:627114dcbda4f3d2255d34926ed0b77c679d248ed1d822d723479b1e6652c67a
|
||||||
size 249947
|
size 249258
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:a4cc3709746144190774b25b59f680cab92eefdd603010649982c374af921ecb
|
oid sha256:48d138634343edb251435bf6f9075502b913e806e8b280f3e6012977c13af16f
|
||||||
size 57237
|
size 56753
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:b00514b029e8f39c45ac9e00e8f8f8f08376f9c548a5dfaa72edc29d4bb14ce3
|
oid sha256:888ed4281c2c779b08bc1719302b9923f542026811cff8ae91e44ea1faa25783
|
||||||
size 26133
|
size 25804
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:25def5d3aa319eb1aba2808b7cb12febf0d8e433cb2500d480a8d447ea6e1628
|
oid sha256:23efb79ca13367f4d8886142d015815c5bdf99c0ed243ece294a7cfd365fd166
|
||||||
size 34073
|
size 33503
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:2b638a97f8f8a0c85b3eb5106da0ecc81f71e0f69de98ad0acaf698c6f197890
|
oid sha256:5d85faf6e7fa26741eb720e74695f3c207ea15097b118c3cafe5d52d5d85ea20
|
||||||
size 24128
|
size 23666
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:ed9dd9d592e3ec4683b4d9065de2cb93923117c3629b077bf18d07a11f5a2df5
|
oid sha256:875eb687f3a1eed52a6617e532edc5332b0a16296e2b6addac66d5bea0448b14
|
||||||
size 173162
|
size 172605
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:ade558053054358653ac60aea9af9b6b8060b8c905c6fdb90bd81538012fb6f7
|
oid sha256:fd3573be9ba5818b4edc371095f5c23b084e6c7eaae4f2fd3a6d2de051878c9d
|
||||||
size 119146
|
size 118567
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:9aaed5b7d7d24764f246b06cddce2f5ba24b2dd72894a62a43758046c74a66bc
|
oid sha256:9d8d87e4cb944def0dc28e3515243a8c1b07b9b0f88e802924d4381c1cda74db
|
||||||
size 27149
|
size 26763
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:be8d8c27e3f22f3aeade0d7e434adca9b876fef376846068e09092a5ede4b300
|
oid sha256:ed1be0294fb65b11c54c6dc9e4cecb383ace16dad748e3c42f2ed65b2fb05ea8
|
||||||
size 76018
|
size 75509
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:b56b83076623669f3dbb1afc0fe09b83c9fa9337c01fbe88374d62fc727a1452
|
oid sha256:7336c53885add09360df098b6b131323e8ad3ef0ec2b85bf022e78bc4269276a
|
||||||
size 70743
|
size 70255
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:8d866d8255cf7e15f4e82a94c13e4fdb4e35e69c4339762f05df872e538f3682
|
oid sha256:411dd61eb182a70d46c7fc1fa0f9a4b8aeae88d08b11d5af948c5acccfa9d133
|
||||||
size 61290
|
size 60950
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:e66e42f1f58cd8494fb01b9424d0cb8c4570b097267dfb9428f0cbd138eed772
|
oid sha256:78111e33d44a09beb9c1233dd2d5ef10103213a1c1c7df8b5e258d9684f1d93a
|
||||||
size 22200
|
size 21810
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:21df96ea57444f727f456c4c5efbf80b5df9d259f33b210171f445bb0c2888ad
|
oid sha256:89986132c5d2a3ccccf0a16cb2b0be07b7c5512838cc10ec9067022e7a238515
|
||||||
size 64423
|
size 63918
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:5960eebe2e6b2e5c47ffb62a709970a3a22c9a25dbf919b2d14361b9721707e3
|
oid sha256:e9498a706de403ee7db3603ecc896688e584fede367ed6087cdf10b798a3ab2d
|
||||||
size 14184
|
size 13698
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:5dc99e08a8a43186ab21ef2209973fcf58a9f9ab5923b66c747d31403d21aa50
|
oid sha256:42385da2eb74d54ba086aed973ade15f2a8d2be0c9281c05e6fb88846137bf81
|
||||||
size 36165
|
size 35870
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:a59fc052c1b447d78e63cb4887eed33bf4e794d8a3144f57a5652401bd200b2e
|
oid sha256:9f1b6fa0c48479606539f2d98befe1c9ee881846c0b55d7a53313962d556380d
|
||||||
size 485365
|
size 484629
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:0054283b203602742d9819ba275c44ea40211ba18bf56fc66dca4fca766184d3
|
oid sha256:b53b03212953e12915a0e41bff5f0cdea90f8f866220a01142edaeb915735a34
|
||||||
size 47076
|
size 47077
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:6a40e3e7314cb32398797665b2bebb237f1a9cc79e306df9c29f7f04faa3a435
|
oid sha256:22e5d61a141b5a8663feb8a47371f9259d2a77fdacb1245bce411ffc85ce2cae
|
||||||
size 47715
|
size 47716
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:b1ddff4f50b9a245d270cc13a0ebb9ac71d3590b83d401afb10ab107439cf235
|
oid sha256:120558ab0c267650744bd078aeace8d4122b3569c5998602f969766131d15c44
|
||||||
size 43893
|
size 43894
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:50dea7c459cf291e6c0b3166354a7e622af6682842ec36f295d532df8c064b38
|
oid sha256:af92548b6c8569081a91cb772b73988d9cb342498ddf9c0c86b6963cef8eda9e
|
||||||
size 43984
|
size 43985
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ impl<State> AppKind<'_, State> {
|
|||||||
}
|
}
|
||||||
ui.scope_builder(builder, |ui| {
|
ui.scope_builder(builder, |ui| {
|
||||||
Frame::central_panel(ui.style())
|
Frame::central_panel(ui.style())
|
||||||
|
// Only set outer margin, so we show no frame for tests with only free-floating windows/popups:
|
||||||
.outer_margin(8.0)
|
.outer_margin(8.0)
|
||||||
.inner_margin(0.0)
|
.inner_margin(0.0)
|
||||||
.show(ui, |ui| match self {
|
.show(ui, |ui| match self {
|
||||||
|
|||||||
Reference in New Issue
Block a user