Skip to content

Commit

Permalink
feat/add subsystem flag to not open console in windows os,adjust abou…
Browse files Browse the repository at this point in the history
…t window height on windows
  • Loading branch information
Boni0 committed Sep 11, 2022
1 parent 67236e0 commit e73990c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/delegate.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::env;

use druid::commands::QUIT_APP;
use druid::{
AppDelegate, Command, DelegateCtx, Env, Handled, Selector, Size, Target, WindowDesc, WindowId,
Expand Down Expand Up @@ -173,6 +175,12 @@ impl AppDelegate<AppState> for MainDelegate {
let about_window = WindowDesc::new(ui::about_window_build());
self.about_window_id = Some(about_window.id);

let mut about_window_size = ABOUT_WINDOW_SIZE;

if env::consts::OS == "windows" {
about_window_size.height += 50.0;
}

ctx.new_window(
about_window
.title(format!("{} - {}", TITLE, ABOUT_TITLE))
Expand All @@ -181,7 +189,7 @@ impl AppDelegate<AppState> for MainDelegate {
width: 0.0,
height: 0.0,
})
.window_size(ABOUT_WINDOW_SIZE),
.window_size(about_window_size),
);

delegate_handled = Handled::Yes;
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![windows_subsystem = "windows"]

mod app;
mod assets;
mod consts;
Expand Down

0 comments on commit e73990c

Please sign in to comment.