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

Use egui::ViewportBuilder in eframe::NativeOptions (#3572)

* Part of https://github.com/emilk/egui/issues/3556

This PR replaces a bunch of options in `eframe::NativeOptions` with
`egui::ViewportBuilder`. For instance:

``` diff
 let options = eframe::NativeOptions {
-    initial_window_size: Some(egui::vec2(320.0, 240.0)),
-    drag_and_drop_support: true,
+    viewport: egui::ViewportBuilder::default()
+        .with_inner_size([320.0, 240.0])
+        .with_drag_and_drop(true),
     centered: true,
     ..Default::default()
 };
```
This commit is contained in:
Emil Ernerfeldt
2023-11-19 11:08:47 +01:00
committed by GitHub
parent 3a8ed37f49
commit 39e60e367f
26 changed files with 420 additions and 435 deletions

View File

@@ -6,8 +6,9 @@ use std::{
/// The folder where `eframe` will store its state.
///
/// The given `app_id` is either [`crate::NativeOptions::app_id`] or
/// the title argument to [`crate::run_native`].
/// The given `app_id` is either the
/// [`egui::ViewportBuilder::app_id`] of [`crate::NativeOptions::viewport`]
/// or the title argument to [`crate::run_native`].
///
/// On native the path is picked using [`directories_next::ProjectDirs::data_dir`](https://docs.rs/directories-next/2.0.0/directories_next/struct.ProjectDirs.html#method.data_dir) which is:
/// * Linux: `/home/UserName/.local/share/APP_ID`