Skip to content

Commit

Permalink
Fixed windows size for big resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
LOUDO56 committed May 1, 2024
1 parent b1fe422 commit 16069d4
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 8 deletions.
Binary file removed .DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ setup builder
pmr-software.json
*.spec
*.txt
*.png
SetupTemplate.iss
src/__pycache__
src/**/__pycache__
src/**/__pycache__
.DS_Store
src/.DS_Store
Binary file removed src/.DS_Store
Binary file not shown.
5 changes: 0 additions & 5 deletions src/macro/macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from tkinter import messagebox
from pynput import mouse, keyboard
from pynput.mouse import Button
from pynput.keyboard import Key
from utils.get_key_pressed import getKeyPressed
from utils.record_file_management import RecordFileManagement
from utils.warning_pop_up_save import confirm_save
Expand All @@ -13,10 +12,6 @@
from sys import platform
from threading import Thread

if platform.lower() == "win32":
import ctypes
PROCESS_PER_MONITOR_DPI_AWARE = 2
ctypes.windll.shcore.SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE)


class Macro:
Expand Down
6 changes: 6 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from windows import MainApp
from sys import platform

if platform.lower() == "win32":
import ctypes
PROCESS_PER_MONITOR_DPI_AWARE = 2
ctypes.windll.shcore.SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE)

if __name__ == "__main__":
MainApp()
2 changes: 1 addition & 1 deletion src/utils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Version:
def __init__(self, userSettings):
self.version = "1.1.2"
self.version = "1.1.3"
self.new_version = ""
if userSettings["Others"]["Check_update"]:
self.update = self.checkVersion()
Expand Down
17 changes: 16 additions & 1 deletion src/windows/popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,22 @@ def __init__(self, name, w, h, parent):
hs = self.winfo_screenheight()
x = (ws / 2) - (w / 2)
y = (hs / 2) - (h / 2)
self.geometry('%dx%d+%d+%d' % (w, h, x, y))
extra_width = 0
extra_height = 0
if platform.lower() == "win32":
import ctypes
user32 = ctypes.windll.user32
screensize = user32.GetSystemMetrics(0)
if screensize > 2450:
extra_width = 110
extra_height = 50
if screensize > 3000:
extra_width = 200
extra_height = 100
if screensize > 3500:
extra_width = 200
extra_height = 150
self.geometry('%dx%d+%d+%d' % (w + extra_width, h + extra_height, x, y))
self.resizable(False, False)
if platform == "win32":
self.attributes("-toolwindow", 1)
Expand Down

0 comments on commit 16069d4

Please sign in to comment.