Revert "feat: Set whether to show decorations (#660)" (#671)

This reverts commit 0db74f3000.
This commit is contained in:
Emil Ernerfeldt 2021-08-28 12:29:19 +02:00 committed by GitHub
parent 776770cdcd
commit e98ae2ea7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 25 deletions

View file

@ -3,7 +3,6 @@ All notable changes to the `eframe` crate.
## Unreleased ## Unreleased
* `Frame` now provides `set_decorations` to set whether to show window decorations.
## 0.14.0 - 2021-08-24 ## 0.14.0 - 2021-08-24

View file

@ -202,7 +202,6 @@ pub fn run(mut app: Box<dyn epi::App>, native_options: epi::NativeOptions) {
http: http.clone(), http: http.clone(),
output: &mut app_output, output: &mut app_output,
repaint_signal: repaint_signal.clone(), repaint_signal: repaint_signal.clone(),
decorated: native_options.decorated,
} }
.build(); .build();
app.setup(ctx, &mut frame, storage.as_deref()); app.setup(ctx, &mut frame, storage.as_deref());
@ -227,7 +226,6 @@ pub fn run(mut app: Box<dyn epi::App>, native_options: epi::NativeOptions) {
http: http.clone(), http: http.clone(),
output: &mut app_output, output: &mut app_output,
repaint_signal: repaint_signal.clone(), repaint_signal: repaint_signal.clone(),
decorated: native_options.decorated,
} }
.build(); .build();
@ -325,7 +323,6 @@ pub fn run(mut app: Box<dyn epi::App>, native_options: epi::NativeOptions) {
http: http.clone(), http: http.clone(),
output: &mut app_output, output: &mut app_output,
repaint_signal: repaint_signal.clone(), repaint_signal: repaint_signal.clone(),
decorated: native_options.decorated,
} }
.build(); .build();
app.update(ctx, &mut frame); app.update(ctx, &mut frame);
@ -349,13 +346,7 @@ pub fn run(mut app: Box<dyn epi::App>, native_options: epi::NativeOptions) {
} }
{ {
let epi::backend::AppOutput { let epi::backend::AppOutput { quit, window_size } = app_output;
quit,
window_size,
decorated,
} = app_output;
display.gl_window().window().set_decorations(decorated);
if let Some(window_size) = window_size { if let Some(window_size) = window_size {
display.gl_window().window().set_inner_size( display.gl_window().window().set_inner_size(

View file

@ -179,7 +179,6 @@ impl AppRunner {
http: runner.http.clone(), http: runner.http.clone(),
output: &mut app_output, output: &mut app_output,
repaint_signal: runner.needs_repaint.clone(), repaint_signal: runner.needs_repaint.clone(),
decorated: false,
} }
.build(); .build();
runner.app.setup( runner.app.setup(
@ -252,7 +251,6 @@ impl AppRunner {
http: self.http.clone(), http: self.http.clone(),
output: &mut app_output, output: &mut app_output,
repaint_signal: self.needs_repaint.clone(), repaint_signal: self.needs_repaint.clone(),
decorated: false,
} }
.build(); .build();
@ -268,7 +266,6 @@ impl AppRunner {
let epi::backend::AppOutput { let epi::backend::AppOutput {
quit: _, // Can't quit a web page quit: _, // Can't quit a web page
window_size: _, // Can't resize a web page window_size: _, // Can't resize a web page
decorated: _, // Can't show decorations
} = app_output; } = app_output;
} }

View file

@ -251,12 +251,6 @@ impl<'a> Frame<'a> {
self.0.output.window_size = Some(size); self.0.output.window_size = Some(size);
} }
/// Set whether to show window decorations (i.e. a frame around you app).
/// If false it will be difficult to move and resize the app.
pub fn set_decorations(&mut self, decorated: bool) {
self.0.output.decorated = decorated;
}
/// If you need to request a repaint from another thread, clone this and send it to that other thread. /// If you need to request a repaint from another thread, clone this and send it to that other thread.
pub fn repaint_signal(&self) -> std::sync::Arc<dyn RepaintSignal> { pub fn repaint_signal(&self) -> std::sync::Arc<dyn RepaintSignal> {
self.0.repaint_signal.clone() self.0.repaint_signal.clone()
@ -492,8 +486,6 @@ pub mod backend {
pub output: &'a mut AppOutput, pub output: &'a mut AppOutput,
/// If you need to request a repaint from another thread, clone this and send it to that other thread. /// If you need to request a repaint from another thread, clone this and send it to that other thread.
pub repaint_signal: std::sync::Arc<dyn RepaintSignal>, pub repaint_signal: std::sync::Arc<dyn RepaintSignal>,
/// If the window has decorations
pub decorated: bool,
} }
impl<'a> FrameBuilder<'a> { impl<'a> FrameBuilder<'a> {
@ -512,8 +504,5 @@ pub mod backend {
/// Set to some size to resize the outer window (e.g. glium window) to this size. /// Set to some size to resize the outer window (e.g. glium window) to this size.
pub window_size: Option<egui::Vec2>, pub window_size: Option<egui::Vec2>,
/// If the window has decorations
pub decorated: bool,
} }
} }