1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Merge remote-tracking branch 'egui/master' into dynamic-grid

This commit is contained in:
René Rössler
2022-03-28 17:12:50 +02:00
42 changed files with 335 additions and 290 deletions

View File

@@ -30,7 +30,7 @@ impl Default for ColorTest {
}
impl epi::App for ColorTest {
fn update(&mut self, ctx: &egui::Context, frame: &epi::Frame) {
fn update(&mut self, ctx: &egui::Context, frame: &mut epi::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
if frame.is_web() {
ui.label(

View File

@@ -6,7 +6,7 @@ pub struct DemoApp {
}
impl epi::App for DemoApp {
fn update(&mut self, ctx: &egui::Context, _frame: &epi::Frame) {
fn update(&mut self, ctx: &egui::Context, _frame: &mut epi::Frame) {
self.demo_windows.ui(ctx);
}
}

View File

@@ -33,7 +33,7 @@ impl Default for FractalClock {
}
impl epi::App for FractalClock {
fn update(&mut self, ctx: &egui::Context, _frame: &epi::Frame) {
fn update(&mut self, ctx: &egui::Context, _frame: &mut epi::Frame) {
egui::CentralPanel::default()
.frame(Frame::dark_canvas(&ctx.style()))
.show(ctx, |ui| self.ui(ui, crate::seconds_since_midnight()));

View File

@@ -54,7 +54,7 @@ impl Default for HttpApp {
}
impl epi::App for HttpApp {
fn update(&mut self, ctx: &egui::Context, frame: &epi::Frame) {
fn update(&mut self, ctx: &egui::Context, frame: &mut epi::Frame) {
egui::TopBottomPanel::bottom("http_bottom").show(ctx, |ui| {
let layout = egui::Layout::top_down(egui::Align::Center).with_main_justify(true);
ui.allocate_ui_with_layout(ui.available_size(), layout, |ui| {
@@ -108,7 +108,7 @@ impl epi::App for HttpApp {
}
}
fn ui_url(ui: &mut egui::Ui, frame: &epi::Frame, url: &mut String) -> bool {
fn ui_url(ui: &mut egui::Ui, frame: &mut epi::Frame, url: &mut String) -> bool {
let mut trigger_fetch = false;
ui.horizontal(|ui| {

View File

@@ -12,7 +12,7 @@ enum RunMode {
/// For instance, a GUI for a thermostat need to repaint each time the temperature changes.
/// To ensure the UI is up to date you need to call `egui::Context::request_repaint()` each
/// time such an event happens. You can also chose to call `request_repaint()` once every second
/// or after every single frame - this is called `Continuous` mode,
/// or after every single frame - this is called "Continuous" mode,
/// and for games and interactive tools that need repainting every frame anyway, this should be the default.
Reactive,
@@ -73,7 +73,7 @@ impl Default for BackendPanel {
}
impl BackendPanel {
pub fn update(&mut self, ctx: &egui::Context, frame: &epi::Frame) {
pub fn update(&mut self, ctx: &egui::Context, frame: &mut epi::Frame) {
self.frame_history
.on_new_frame(ctx.input().time, frame.info().cpu_usage);
@@ -87,7 +87,7 @@ impl BackendPanel {
self.egui_windows.windows(ctx);
}
pub fn ui(&mut self, ui: &mut egui::Ui, frame: &epi::Frame) {
pub fn ui(&mut self, ui: &mut egui::Ui, frame: &mut epi::Frame) {
egui::trace!(ui);
ui.vertical_centered(|ui| {
ui.heading("💻 Backend");
@@ -142,7 +142,7 @@ impl BackendPanel {
}
}
fn integration_ui(&mut self, ui: &mut egui::Ui, frame: &epi::Frame) {
fn integration_ui(&mut self, ui: &mut egui::Ui, frame: &mut epi::Frame) {
if frame.is_web() {
ui.label("egui is an immediate mode GUI written in Rust, compiled to WebAssembly, rendered with WebGL.");
ui.label(

View File

@@ -30,7 +30,7 @@ impl Default for EasyMarkEditor {
}
impl epi::App for EasyMarkEditor {
fn update(&mut self, ctx: &egui::Context, _frame: &epi::Frame) {
fn update(&mut self, ctx: &egui::Context, _frame: &mut epi::Frame) {
egui::TopBottomPanel::bottom("easy_mark_bottom").show(ctx, |ui| {
let layout = egui::Layout::top_down(egui::Align::Center).with_main_justify(true);
ui.allocate_ui_with_layout(ui.available_size(), layout, |ui| {

View File

@@ -69,7 +69,7 @@ impl epi::App for WrapApp {
egui::Rgba::TRANSPARENT // we set a `CentralPanel` fill color in `demo_windows.rs`
}
fn update(&mut self, ctx: &egui::Context, frame: &epi::Frame) {
fn update(&mut self, ctx: &egui::Context, frame: &mut epi::Frame) {
if let Some(web_info) = frame.info().web_info.as_ref() {
if let Some(anchor) = web_info.location.hash.strip_prefix('#') {
self.selected_anchor = anchor.to_owned();
@@ -130,7 +130,7 @@ impl epi::App for WrapApp {
}
impl WrapApp {
fn bar_contents(&mut self, ui: &mut egui::Ui, frame: &epi::Frame) {
fn bar_contents(&mut self, ui: &mut egui::Ui, frame: &mut epi::Frame) {
// A menu-bar is a horizontal layout with some special styles applied.
// egui::menu::bar(ui, |ui| {
ui.horizontal_wrapped(|ui| {