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

More newlines for improved readability (#1880)

* Add blank lines above all `fn`, `impl`, `struct`, etc
* Even newlines between docstringed struct and enum fields
* Improve some documentation
This commit is contained in:
Emil Ernerfeldt
2022-08-02 17:26:33 +02:00
committed by GitHub
parent 5d8ef5326b
commit 10788ccc92
56 changed files with 306 additions and 12 deletions

View File

@@ -365,6 +365,7 @@ impl Default for WebOptions {
pub enum Theme {
/// Dark mode: light text on a dark background.
Dark,
/// Light mode: dark text on a light background.
Light,
}
@@ -389,10 +390,13 @@ impl Theme {
pub enum WebGlContextOption {
/// Force Use WebGL1.
WebGl1,
/// Force use WebGL2.
WebGl2,
/// Use WebGl2 first.
BestFirst,
/// Use WebGl1 first
CompatibilityFirst,
}
@@ -714,6 +718,7 @@ pub struct IntegrationInfo {
pub trait Storage {
/// Get the value for the given key.
fn get_string(&self, key: &str) -> Option<String>;
/// Set the value for the given key.
fn set_string(&mut self, key: &str, value: String);
@@ -729,7 +734,9 @@ impl Storage for DummyStorage {
fn get_string(&self, _key: &str) -> Option<String> {
None
}
fn set_string(&mut self, _key: &str, _value: String) {}
fn flush(&mut self) {}
}

View File

@@ -354,6 +354,7 @@ impl EpiIntegration {
#[cfg(feature = "persistence")]
const STORAGE_EGUI_MEMORY_KEY: &str = "egui";
#[cfg(feature = "persistence")]
const STORAGE_WINDOW_KEY: &str = "window";

View File

@@ -360,6 +360,7 @@ pub type AppRunnerRef = Arc<Mutex<AppRunner>>;
pub struct AppRunnerContainer {
pub runner: AppRunnerRef,
/// Set to `true` if there is a panic.
/// Used to ignore callbacks after a panic.
pub panicked: Arc<AtomicBool>,
@@ -454,8 +455,10 @@ impl epi::Storage for LocalStorage {
fn get_string(&self, key: &str) -> Option<String> {
local_storage_get(key)
}
fn set_string(&mut self, key: &str, value: String) {
local_storage_set(key, &value);
}
fn flush(&mut self) {}
}