Skip to content

Commit

Permalink
fix fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
bananaturtlesandwich committed Aug 26, 2023
1 parent e3ecb74 commit 0a7dfae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
name = "stove"
authors = ["spuds"]
repository = "https://github.com/bananaturtlesandwich/stove"
description = "an editor for cooked unreal engine 4 map files"
description = "an editor for cooked unreal engine map files"
readme = "README.md"
version = "0.10.3"
version = "0.11.0"
edition = "2021"

[dependencies]
Expand Down
11 changes: 8 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl Stove {
mut use_cache,
mut script,
mut autoupdate,
): (usize, Vec<String>, f32, String, bool, String, bool) = (
) = (
0,
vec![],
100000.0,
Expand Down Expand Up @@ -720,6 +720,7 @@ impl Stove {
format: wgpu::TextureFormat,
samples: u32,
size: &winit::dpi::PhysicalSize<u32>,
window: &winit::window::Window,
) {
egui::SidePanel::left("sidepanel").show(ctx, |ui| {
ui.horizontal(|ui| {
Expand Down Expand Up @@ -1039,7 +1040,7 @@ impl Stove {
self.save()
}
}
ctx.input(|input| self.handle_input(input, ctx, device, format, samples, size));
ctx.input(|input| self.handle_input(input, ctx, device, format, samples, size, window));
ctx.request_repaint();
}

Expand Down Expand Up @@ -1076,6 +1077,7 @@ impl Stove {
format: wgpu::TextureFormat,
samples: u32,
size: &winit::dpi::PhysicalSize<u32>,
window: &winit::window::Window,
) {
use egui::{Key, PointerButton};
if let Some(egui::DroppedFile {
Expand Down Expand Up @@ -1152,7 +1154,10 @@ impl Stove {
},
Key::Enter if modifiers.alt => {
self.fullscreen = !self.fullscreen;
// frame.set_fullscreen(self.fullscreen);
window.set_fullscreen(
self.fullscreen
.then_some(winit::window::Fullscreen::Borderless(None)),
);
}
Key::C if modifiers.ctrl => {
match self.avg_raw_loc() {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async fn main() {
let mut encoder = device.create_command_encoder(&Default::default());
let jobs = app.show_ui().then(|| {
let output = ctx.run(platform.take_egui_input(&window), |ctx| {
app.ui(ctx, &device, format, samples, &size)
app.ui(ctx, &device, format, samples, &size, &window)
});
let jobs = ctx.tessellate(output.shapes);
platform.handle_platform_output(&window, &ctx, output.platform_output);
Expand Down

0 comments on commit 0a7dfae

Please sign in to comment.