1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

Various spelling fixes, docs improvements and code cleanup

This commit is contained in:
Emil Ernerfeldt
2021-03-31 23:12:42 +02:00
parent 1f965d16a2
commit f6770f0183
13 changed files with 36 additions and 34 deletions

View File

@@ -1,15 +1,10 @@
use egui::{containers::*, *};
#[derive(Default)]
#[cfg_attr(feature = "persistence", derive(serde::Deserialize, serde::Serialize))]
#[cfg_attr(feature = "persistence", serde(default))]
pub struct DancingStrings {}
impl Default for DancingStrings {
fn default() -> Self {
Self {}
}
}
impl super::Demo for DancingStrings {
fn name(&self) -> &'static str {
"♫ Dancing Strings"

View File

@@ -83,8 +83,6 @@ fn set_open(open: &mut BTreeSet<String>, key: &'static str, is_open: bool) {
#[cfg_attr(feature = "persistence", serde(default))]
pub struct DemoWindows {
open_windows: OpenWindows,
/// open, title, view
demos: Demos,
}
@@ -115,6 +113,10 @@ impl DemoWindows {
ui.heading("Windows:");
self.demos.checkboxes(ui);
ui.separator();
ui.label("egui:");
self.open_windows.checkboxes(ui);
ui.separator();
@@ -209,8 +211,6 @@ impl OpenWindows {
memory,
} = self;
ui.separator();
ui.label("egui:");
ui.checkbox(settings, "🔧 Settings");
ui.checkbox(inspection, "🔍 Inspection");
ui.checkbox(memory, "📝 Memory");

View File

@@ -16,13 +16,14 @@ impl super::Demo for CursorTest {
impl super::View for CursorTest {
fn ui(&mut self, ui: &mut egui::Ui) {
ui.heading("Hover to switch cursor icon:");
ui.vertical_centered_justified(|ui| {
ui.heading("Hover to switch cursor icon:");
for &cursor_icon in &egui::CursorIcon::ALL {
let _ = ui
.button(format!("{:?}", cursor_icon))
.on_hover_cursor(cursor_icon);
}
ui.add(crate::__egui_github_link_file!());
});
}
}
@@ -295,14 +296,14 @@ impl super::View for InputTest {
egui::PointerButton::Middle,
] {
if response.clicked_by(button) {
new_info += &format!("Clicked by {:?}\n", button);
new_info += &format!("Clicked by {:?} button\n", button);
}
if response.double_clicked_by(button) {
new_info += &format!("Double-clicked by {:?}\n", button);
new_info += &format!("Double-clicked by {:?} button\n", button);
}
if response.dragged_by(button) {
new_info += &format!(
"Dragged by {:?}, delta: {:?}\n",
"Dragged by {:?} button, delta: {:?}\n",
button,
response.drag_delta()
);