mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Simplify
This commit is contained in:
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -2159,7 +2159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
|
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi 0.3.2",
|
"hermit-abi 0.3.2",
|
||||||
"rustix 0.38.10",
|
"rustix 0.38.11",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -3244,9 +3244,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "0.38.10"
|
version = "0.38.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ed6248e1caa625eb708e266e06159f135e8c26f2bb7ceb72dc4b2766d0340964"
|
checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags 2.4.0",
|
||||||
"errno",
|
"errno",
|
||||||
@@ -3695,7 +3695,7 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
"fastrand 2.0.0",
|
"fastrand 2.0.0",
|
||||||
"redox_syscall 0.3.5",
|
"redox_syscall 0.3.5",
|
||||||
"rustix 0.38.10",
|
"rustix 0.38.11",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ pub trait App {
|
|||||||
// NOTE: a bright gray makes the shadows of the windows look weird.
|
// 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
|
// We use a bit of transparency so that if the user switches on the
|
||||||
// `transparent()` option they get immediate results.
|
// `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
|
// _visuals.window_fill() would also be a natural choice
|
||||||
}
|
}
|
||||||
@@ -499,7 +499,7 @@ impl Default for NativeOptions {
|
|||||||
min_window_size: None,
|
min_window_size: None,
|
||||||
max_window_size: None,
|
max_window_size: None,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
transparent: true,
|
transparent: false,
|
||||||
mouse_passthrough: false,
|
mouse_passthrough: false,
|
||||||
|
|
||||||
active: true,
|
active: true,
|
||||||
@@ -766,9 +766,6 @@ impl Frame {
|
|||||||
self.info.clone()
|
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.
|
/// 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> {
|
pub fn storage(&self) -> Option<&dyn Storage> {
|
||||||
self.storage.as_deref()
|
self.storage.as_deref()
|
||||||
|
|||||||
@@ -171,11 +171,6 @@ impl BackendPanel {
|
|||||||
frame.set_fullscreen(fullscreen);
|
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
|
if ui
|
||||||
.button("📱 Phone Size")
|
.button("📱 Phone Size")
|
||||||
@@ -398,39 +393,34 @@ impl EguiWindows {
|
|||||||
output_event_history,
|
output_event_history,
|
||||||
} = self;
|
} = self;
|
||||||
|
|
||||||
{
|
ctx.output(|o| {
|
||||||
ctx.output(|o| {
|
for event in &o.events {
|
||||||
for event in &o.events {
|
output_event_history.push_back(event.clone());
|
||||||
output_event_history.push_back(event.clone());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
while output_event_history.len() > 1000 {
|
|
||||||
output_event_history.pop_front();
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
while output_event_history.len() > 1000 {
|
||||||
|
output_event_history.pop_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
let tmp_ctx = ctx.clone();
|
|
||||||
egui::Window::new("🔧 Settings")
|
egui::Window::new("🔧 Settings")
|
||||||
.open(settings)
|
.open(settings)
|
||||||
.vscroll(true)
|
.vscroll(true)
|
||||||
.show(ctx, |ui| {
|
.show(ctx, |ui| {
|
||||||
tmp_ctx.settings_ui(ui);
|
ctx.settings_ui(ui);
|
||||||
});
|
});
|
||||||
|
|
||||||
let tmp_ctx = ctx.clone();
|
|
||||||
egui::Window::new("🔍 Inspection")
|
egui::Window::new("🔍 Inspection")
|
||||||
.open(inspection)
|
.open(inspection)
|
||||||
.vscroll(true)
|
.vscroll(true)
|
||||||
.show(ctx, |ui| {
|
.show(ctx, |ui| {
|
||||||
tmp_ctx.inspection_ui(ui);
|
ctx.inspection_ui(ui);
|
||||||
});
|
});
|
||||||
|
|
||||||
let tmp_ctx = ctx.clone();
|
|
||||||
egui::Window::new("📝 Memory")
|
egui::Window::new("📝 Memory")
|
||||||
.open(memory)
|
.open(memory)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.show(ctx, |ui| {
|
.show(ctx, |ui| {
|
||||||
tmp_ctx.memory_ui(ui);
|
ctx.memory_ui(ui);
|
||||||
});
|
});
|
||||||
|
|
||||||
egui::Window::new("📤 Output Events")
|
egui::Window::new("📤 Output Events")
|
||||||
|
|||||||
@@ -447,14 +447,12 @@ impl WrapApp {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Show dropped files (if any):
|
// Show dropped files (if any):
|
||||||
let is_empty = self.dropped_files.is_empty();
|
if !self.dropped_files.is_empty() {
|
||||||
if !is_empty {
|
|
||||||
let mut open = true;
|
let mut open = true;
|
||||||
let dropped_files = self.dropped_files.clone();
|
|
||||||
egui::Window::new("Dropped files")
|
egui::Window::new("Dropped files")
|
||||||
.open(&mut open)
|
.open(&mut open)
|
||||||
.show(ctx, |ui| {
|
.show(ctx, |ui| {
|
||||||
for file in &dropped_files {
|
for file in &self.dropped_files {
|
||||||
let mut info = if let Some(path) = &file.path {
|
let mut info = if let Some(path) = &file.path {
|
||||||
path.display().to_string()
|
path.display().to_string()
|
||||||
} else if !file.name.is_empty() {
|
} else if !file.name.is_empty() {
|
||||||
|
|||||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
||||||
|
|
||||||
use eframe::egui::{self};
|
use eframe::egui;
|
||||||
|
|
||||||
fn main() -> Result<(), eframe::Error> {
|
fn main() -> Result<(), eframe::Error> {
|
||||||
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
|
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
||||||
|
|
||||||
use eframe::egui::{self};
|
use eframe::egui;
|
||||||
|
|
||||||
fn main() -> Result<(), eframe::Error> {
|
fn main() -> Result<(), eframe::Error> {
|
||||||
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
|
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
||||||
|
|
||||||
use eframe::egui::{self};
|
use eframe::egui;
|
||||||
use egui_extras::RetainedImage;
|
use egui_extras::RetainedImage;
|
||||||
|
|
||||||
fn main() -> Result<(), eframe::Error> {
|
fn main() -> Result<(), eframe::Error> {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
||||||
|
|
||||||
|
use eframe::egui;
|
||||||
use eframe::egui::ColorImage;
|
use eframe::egui::ColorImage;
|
||||||
use eframe::egui::{self};
|
|
||||||
use egui_plot::{Legend, Line, Plot, PlotPoints};
|
use egui_plot::{Legend, Line, Plot, PlotPoints};
|
||||||
|
|
||||||
fn main() -> Result<(), eframe::Error> {
|
fn main() -> Result<(), eframe::Error> {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
||||||
|
|
||||||
use eframe::egui::{self};
|
use eframe::egui;
|
||||||
|
|
||||||
fn main() -> Result<(), eframe::Error> {
|
fn main() -> Result<(), eframe::Error> {
|
||||||
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
|
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
|
||||||
|
|||||||
Reference in New Issue
Block a user