Skip to content

Commit

Permalink
[Winforms] Reintroduce AutoScaleDimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0r committed Jun 22, 2023
1 parent 920fc64 commit 5613a24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webview/platforms/winforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import System.Windows.Forms as WinForms
from System import Environment, Func, Int32, IntPtr, Type
from System.Drawing import Color, ColorTranslator, Icon, Point, Size
from System.Drawing import Color, ColorTranslator, Icon, Point, Size, SizeF
from System.Threading import ApartmentState, Thread, ThreadStart

kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
Expand Down Expand Up @@ -167,6 +167,7 @@ def __init__(self, window, cache_dir):
self.StartPosition = WinForms.FormStartPosition.CenterScreen

self.AutoScaleMode = WinForms.AutoScaleMode.Dpi
self.AutoScaleDimensions = SizeF(96.0, 96.0)

if not window.resizable:
self.FormBorderStyle = WinForms.FormBorderStyle.FixedSingle
Expand Down Expand Up @@ -227,7 +228,7 @@ def __init__(self, window, cache_dir):

if not window.focus:
windll.user32.SetWindowLongW(self.Handle.ToInt32(), -20, windll.user32.GetWindowLongW(self.Handle.ToInt32(), -20) | 0x8000000)

self.Activated += self.on_activated
self.Shown += self.on_shown
self.FormClosed += self.on_close
Expand Down

0 comments on commit 5613a24

Please sign in to comment.