Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjok07 authored Aug 23, 2022
1 parent 59f909a commit bd5aa8f
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions UVR.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
import urllib.request
import pyAesCrypt
from __version__ import VERSION
from win32api import GetSystemMetrics
from screeninfo import get_monitors

def get_screen_height():
monitors = get_monitors()
if len(monitors) == 0:
raise Exception("Failed to get screen height")
return monitors[0].height

try:
with open(os.path.join(os.getcwd(), 'tmp', 'splash.txt'), 'w') as f:
Expand Down Expand Up @@ -491,15 +497,15 @@ class MainWindow(TkinterDnD.Tk):
# --Constants--
# Layout

if GetSystemMetrics(1) >= 900:
if get_screen_height() >= 900:
IMAGE_HEIGHT = 140
FILEPATHS_HEIGHT = 85
OPTIONS_HEIGHT = 275
CONVERSIONBUTTON_HEIGHT = 35
COMMAND_HEIGHT = 200
PROGRESS_HEIGHT = 30
PADDING = 10
elif GetSystemMetrics(1) <= 720:
elif get_screen_height() <= 720:
IMAGE_HEIGHT = 135
FILEPATHS_HEIGHT = 85
OPTIONS_HEIGHT = 274
Expand Down Expand Up @@ -536,7 +542,7 @@ def __init__(self):
height=height,
xpad=int(self.winfo_screenwidth()/2 - 635/2),
ypad=int(self.winfo_screenheight()/2 - height/2 - 30)))
if GetSystemMetrics(1) >= 900:
if get_screen_height() >= 900:
pass
else:
self.tk.call('tk', 'scaling', 1.1)
Expand All @@ -560,7 +566,7 @@ def __init__(self):
size=(30, 30))
self.key_img = open_image(path=key_path,
size=(30, 30))
if GetSystemMetrics(1) >= 900:
if get_screen_height() >= 900:
self.gen_opt_img = open_image(path=gen_opt_path,
size=(900, 826))
self.mdx_opt_img = open_image(path=mdx_opt_path,
Expand All @@ -575,7 +581,7 @@ def __init__(self):
size=(900, 826))
self.credits_img = open_image(path=credits_path,
size=(100, 100))
elif GetSystemMetrics(1) <= 720:
elif get_screen_height() <= 720:
self.gen_opt_img = open_image(path=gen_opt_path,
size=(740, 826))
self.mdx_opt_img = open_image(path=mdx_opt_path,
Expand Down Expand Up @@ -4079,10 +4085,10 @@ def help(self):
Open Help Guide
"""
help_guide_opt = Toplevel(self)
if GetSystemMetrics(1) >= 900:
if get_screen_height() >= 900:
window_height = 810
window_width = 1080
elif GetSystemMetrics(1) <= 720:
elif get_screen_height() <= 720:
window_height = 640
window_width = 930
else:
Expand All @@ -4100,7 +4106,7 @@ def help(self):

help_guide_opt.geometry("{}x{}+{}+{}".format(window_width, window_height, x_cordinate, y_cordinate))

if GetSystemMetrics(1) >= 900:
if get_screen_height() >= 900:
x = root.winfo_x()
y = root.winfo_y()
help_guide_opt.geometry("+%d+%d" %(x-220,y+5))
Expand Down Expand Up @@ -4177,7 +4183,7 @@ def close_win():
frame0=Frame(tab7,highlightbackground='red',highlightthicknes=0)
frame0.grid(row=0,column=0,padx=0,pady=30)

if GetSystemMetrics(1) >= 900:
if get_screen_height() >= 900:
l0=tk.Label(frame0,text="Notes",font=("Century Gothic", "16", "bold"), justify="center", fg="#f4f4f4")
l0.grid(row=1,column=0,padx=20,pady=10)

Expand Down Expand Up @@ -6125,10 +6131,10 @@ def error_log(self):
"""
error_log_screen= Toplevel(root)

if GetSystemMetrics(1) >= 900:
if get_screen_height() >= 900:
window_height = 810
window_width = 1080
elif GetSystemMetrics(1) <= 720:
elif get_screen_height() <= 720:
window_height = 640
window_width = 930
else:
Expand All @@ -6149,7 +6155,7 @@ def error_log(self):

error_log_screen.geometry("{}x{}+{}+{}".format(window_width, window_height, x_cordinate, y_cordinate))

if GetSystemMetrics(1) >= 900:
if get_screen_height() >= 900:
x = root.winfo_x()
y = root.winfo_y()
error_log_screen.geometry("+%d+%d" %(x-220,y+5))
Expand Down

0 comments on commit bd5aa8f

Please sign in to comment.