Skip to content

Commit

Permalink
Fix for handling DPI factor on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mcebular committed Nov 9, 2023
1 parent 730971a commit 136eae8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
10 changes: 7 additions & 3 deletions Build.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<xml>
<files id='haxe'>
<compilerflag value="-I/../includes/" />
</files>
<section if="windows">
<target id="haxe" tool="linker" toolid="exe">
<section if="WXSTATIC">
<flag value="/MANIFESTINPUT:${this_dir}/src/manifest.xml" />
</section>
</target>
</section>
</xml>
1 change: 1 addition & 0 deletions src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import hx.widgets.StandardPaths.FileLayout;
import hx.widgets.styles.MessageDialogStyle;


@:buildXml('<include name="../Build.xml" />')
class Main {

public static final APP_NAME = "SyncthingStatus";
Expand Down
4 changes: 1 addition & 3 deletions src/SettingsFrame.hx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package ;

import hx.widgets.styles.BackgroundStyle;
import hx.widgets.styles.FrameStyle;
import hx.widgets.styles.WindowStyle;
import Util.getAboutString;
import hx.widgets.*;
import hx.widgets.styles.HyperlinkCtrlStyle;
Expand All @@ -19,6 +16,7 @@ class SettingsFrame extends Frame {

public function init() {
initUi();
trace("DPIScaleFactor=" + this.DPIScaleFactor);

// When clicking X to close window, don't actually close it, just hide it.
this.bind(EventType.CLOSE_WINDOW, (event: Event) -> {
Expand Down
31 changes: 31 additions & 0 deletions src/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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 xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<dpiAwareness>PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>

<assemblyIdentity
version="0.64.1.0"
processorArchitecture="x86"
name="Controls"
type="win32"
/>
<description>SyncthingStatus</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

0 comments on commit 136eae8

Please sign in to comment.