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:
@@ -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`]
|
||||
///
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user