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

Misc code cleanup (#3398)

* eframe README: explain how to enable copy/paste

* Implement Debug for a couple of structs

* Code cleanup

* Better docs

* profile ron serialization

* CI: Allow "exclude from changelog" as the only label
This commit is contained in:
Emil Ernerfeldt
2023-09-27 09:06:17 +02:00
committed by GitHub
parent 4986b35701
commit 35945dea46
10 changed files with 42 additions and 12 deletions

View File

@@ -14,6 +14,15 @@ pub struct IconData {
pub height: u32,
}
impl std::fmt::Debug for IconData {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("IconData")
.field("width", &self.width)
.field("height", &self.height)
.finish_non_exhaustive()
}
}
impl IconData {
/// Convert into [`image::RgbaImage`]
///

View File

@@ -308,6 +308,7 @@ pub struct NativeOptions {
pub resizable: bool,
/// On desktop: make the window transparent.
///
/// You control the transparency with [`App::clear_color()`].
/// You should avoid having a [`egui::CentralPanel`], or make sure its frame is also transparent.
pub transparent: bool,

View File

@@ -130,6 +130,7 @@ fn save_to_disk(file_path: &PathBuf, kv: &HashMap<String, String>) {
let mut writer = std::io::BufWriter::new(file);
let config = Default::default();
crate::profile_scope!("ron::serialize");
if let Err(err) = ron::ser::to_writer_pretty(&mut writer, &kv, config)
.and_then(|_| writer.flush().map_err(|err| err.into()))
{