Skip to content

Commit

Permalink
enable dpi awareness
Browse files Browse the repository at this point in the history
  • Loading branch information
bananaturtlesandwich committed Apr 9, 2024
1 parent 75eee9d commit 1798675
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ unreal_asset = { git = "https://github.com/astrotechies/unrealmodding", rev = "e
clap = { version = "4.5", features = ["derive"] }
rfd = "0.14"

[build-dependencies]
winres = "0.1"

[profile.dev.package."*"]
opt-level = 3
20 changes: 20 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
fn main() {
if std::env::var("CARGO_CFG_TARGET_OS") == Ok("windows".to_string()) {
winres::WindowsResource::new()
.set_manifest(
r#"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
"#,
)
.compile()
.expect("failed to change icon");
}
}

0 comments on commit 1798675

Please sign in to comment.