mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Simplify
This commit is contained in:
@@ -203,7 +203,7 @@ pub trait App {
|
||||
// NOTE: a bright gray makes the shadows of the windows look weird.
|
||||
// We use a bit of transparency so that if the user switches on the
|
||||
// `transparent()` option they get immediate results.
|
||||
egui::Color32::from_rgba_unmultiplied(12, 12, 12, 0).to_normalized_gamma_f32()
|
||||
egui::Color32::from_rgba_unmultiplied(12, 12, 12, 180).to_normalized_gamma_f32()
|
||||
|
||||
// _visuals.window_fill() would also be a natural choice
|
||||
}
|
||||
@@ -499,7 +499,7 @@ impl Default for NativeOptions {
|
||||
min_window_size: None,
|
||||
max_window_size: None,
|
||||
resizable: true,
|
||||
transparent: true,
|
||||
transparent: false,
|
||||
mouse_passthrough: false,
|
||||
|
||||
active: true,
|
||||
@@ -766,9 +766,6 @@ impl Frame {
|
||||
self.info.clone()
|
||||
}
|
||||
|
||||
/// If this is the main window will return true!
|
||||
/// When is a single window mode will always return true!
|
||||
|
||||
/// A place where you can store custom data in a way that persists when you restart the app.
|
||||
pub fn storage(&self) -> Option<&dyn Storage> {
|
||||
self.storage.as_deref()
|
||||
|
||||
@@ -171,11 +171,6 @@ impl BackendPanel {
|
||||
frame.set_fullscreen(fullscreen);
|
||||
}
|
||||
}
|
||||
{
|
||||
let mut force_embedding = ui.ctx().force_embedding();
|
||||
ui.checkbox(&mut force_embedding, "Force Embedding");
|
||||
ui.ctx().set_force_embedding(force_embedding);
|
||||
}
|
||||
|
||||
if ui
|
||||
.button("📱 Phone Size")
|
||||
@@ -398,39 +393,34 @@ impl EguiWindows {
|
||||
output_event_history,
|
||||
} = self;
|
||||
|
||||
{
|
||||
ctx.output(|o| {
|
||||
for event in &o.events {
|
||||
output_event_history.push_back(event.clone());
|
||||
}
|
||||
});
|
||||
while output_event_history.len() > 1000 {
|
||||
output_event_history.pop_front();
|
||||
ctx.output(|o| {
|
||||
for event in &o.events {
|
||||
output_event_history.push_back(event.clone());
|
||||
}
|
||||
});
|
||||
while output_event_history.len() > 1000 {
|
||||
output_event_history.pop_front();
|
||||
}
|
||||
|
||||
let tmp_ctx = ctx.clone();
|
||||
egui::Window::new("🔧 Settings")
|
||||
.open(settings)
|
||||
.vscroll(true)
|
||||
.show(ctx, |ui| {
|
||||
tmp_ctx.settings_ui(ui);
|
||||
ctx.settings_ui(ui);
|
||||
});
|
||||
|
||||
let tmp_ctx = ctx.clone();
|
||||
egui::Window::new("🔍 Inspection")
|
||||
.open(inspection)
|
||||
.vscroll(true)
|
||||
.show(ctx, |ui| {
|
||||
tmp_ctx.inspection_ui(ui);
|
||||
ctx.inspection_ui(ui);
|
||||
});
|
||||
|
||||
let tmp_ctx = ctx.clone();
|
||||
egui::Window::new("📝 Memory")
|
||||
.open(memory)
|
||||
.resizable(false)
|
||||
.show(ctx, |ui| {
|
||||
tmp_ctx.memory_ui(ui);
|
||||
ctx.memory_ui(ui);
|
||||
});
|
||||
|
||||
egui::Window::new("📤 Output Events")
|
||||
|
||||
@@ -447,14 +447,12 @@ impl WrapApp {
|
||||
});
|
||||
|
||||
// Show dropped files (if any):
|
||||
let is_empty = self.dropped_files.is_empty();
|
||||
if !is_empty {
|
||||
if !self.dropped_files.is_empty() {
|
||||
let mut open = true;
|
||||
let dropped_files = self.dropped_files.clone();
|
||||
egui::Window::new("Dropped files")
|
||||
.open(&mut open)
|
||||
.show(ctx, |ui| {
|
||||
for file in &dropped_files {
|
||||
for file in &self.dropped_files {
|
||||
let mut info = if let Some(path) = &file.path {
|
||||
path.display().to_string()
|
||||
} else if !file.name.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user