Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the About windows in the demo library #3400

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


<div align="center">
<a href="https://www.rerun.io/"><img src="media/rerun_io_logo.png" width="25%"></a>
<a href="https://www.rerun.io/"><img src="media/rerun_io_logo.png" width="250"></a>

egui development is sponsored by [Rerun](https://www.rerun.io/), a startup doing<br>
visualizations for computer vision and robotics.
Expand Down Expand Up @@ -405,7 +405,7 @@ Default fonts:
---

<div align="center">
<a href="https://www.rerun.io/"><img src="media/rerun_io_logo.png" width="50%"></a>
<a href="https://www.rerun.io/"><img src="media/rerun_io_logo.png" width="420"></a>

egui development is sponsored by [Rerun](https://www.rerun.io/), a startup doing<br>
visualizations for computer vision and robotics.
Expand Down
11 changes: 9 additions & 2 deletions crates/egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@
//!
//! # Understanding immediate mode
//!
//! `egui` is an immediate mode GUI library. It is useful to fully grok what "immediate mode" implies.
//! `egui` is an immediate mode GUI library.
//!
//! Immediate mode has its roots in gaming, where everything on the screen is painted at the
//! display refresh rate, i.e. at 60+ frames per second.
//! In immediate mode GUIs, the entire interface is laid out and painted at the same high rate.
//! This makes immediate mode GUIs especially well suited for highly interactive applications.
//!
//! It is useful to fully grok what "immediate mode" implies.
//!
//! Here is an example to illustrate it:
//!
Expand Down Expand Up @@ -198,7 +205,7 @@
//! # });
//! ```
//!
//! Here egui will read `value` to display the slider, then look if the mouse is dragging the slider and if so change the `value`.
//! Here egui will read `value` (an `f32`) to display the slider, then look if the mouse is dragging the slider and if so change the `value`.
//! Note that `egui` does not store the slider value for you - it only displays the current value, and changes it
//! by how much the slider has been dragged in the previous few milliseconds.
//! This means it is responsibility of the egui user to store the state (`value`) so that it persists between frames.
Expand Down
18 changes: 11 additions & 7 deletions crates/egui_demo_lib/src/demo/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ impl super::View for About {
ui.add_space(12.0); // ui.separator();
ui.heading("Links");
links(ui);

ui.add_space(12.0);

ui.horizontal_wrapped(|ui| {
ui.spacing_mut().item_spacing.x = 0.0;
ui.label("egui development is sponsored by ");
ui.hyperlink_to("Rerun.io", "https://www.rerun.io/");
ui.label(", a startup doing visualizations for computer vision and robotics.");
});
}
}

Expand All @@ -65,15 +74,10 @@ fn about_immediate_mode(ui: &mut egui::Ui) {
);
ui.add_space(8.0);

ui.label("Note how there are no callbacks or messages, and no button state to store.");

ui.label("Immediate mode has its roots in gaming, where everything on the screen is painted at the display refresh rate, i.e. at 60+ frames per second. \
In immediate mode GUIs, the entire interface is laid out and painted at the same high rate. \
This makes immediate mode GUIs especially well suited for highly interactive applications.");

ui.horizontal_wrapped(|ui| {
ui.spacing_mut().item_spacing.x = 0.0;
ui.label("More about immediate mode ");
ui.label("There are no callbacks or messages, and no button state to store. ");
ui.label("Read more about immediate mode ");
ui.hyperlink_to("here", "https://github.com/emilk/egui#why-immediate-mode");
ui.label(".");
});
Expand Down
Binary file modified media/rerun_io_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.