Update: Fixed centered Issue for Suggested

Add in the correct centering settings

Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2023-12-10 21:13:27 +09:00
parent cdd3d8d7d8
commit e2831754d7
1 changed files with 15 additions and 31 deletions

View File

@ -13,8 +13,19 @@ import ttkbootstrap as ttk
pwin = ttk.Window(themename="darkly")
pwin.title("Suggested Packages")
pwin.resizable(False, False)
pwin.geometry('470x470')
WINDOW_HEIGHT = 470
WINDOW_WIDTH = 470
def center_screen():
""" gets the coordinates of the center of the screen """
screen_width = pwin.winfo_screenwidth()
screen_height = pwin.winfo_screenheight()
# Coordinates of the upper left corner of the window to make the window
# appear in the center
x_cordinate = int((screen_width / 2) - (WINDOW_WIDTH / 2))
y_cordinate = int((screen_height / 2) - (WINDOW_HEIGHT / 2))
pwin.geometry("{}x{}+{}+{}".format(WINDOW_WIDTH,
WINDOW_HEIGHT, x_cordinate, y_cordinate))
def check_packages():
""" Check if software is installed"""
@ -32,38 +43,9 @@ def check_packages():
backup_tool['state'] = tk.DISABLED
if os.path.exists('/usr/bin/gnome-software'):
store['state'] = tk.DISABLED
if os.path.exists('/usr/bin/keepassxc'):
store['state'] = tk.DISABLED
def test():
pth = ['/usr/bin/atril',
'/usr/bin/snap',
'/usr/bin/parole',
'/usr/bin/gufw',
'/usr/bin/flatpak',
'/usr/bin/timeshift',
'/usr/bin/keepassxc'
]
btn = [pdf_viewer
snap
media_player
fire_wall
flatpak
backup_tool
store
]
btn = [5,6,7,8]
for i in pth:
if os.path.exists(i):
for b in btn:
b['state'] = tk.DISABLED
def check_web_browsers():
""" Check what browsers are installed"""
@ -358,4 +340,6 @@ lblpmtitle = ttk.Label(pwin, style="F62817.TLabel",
check_base_snaps()
check_packages()
check_web_browsers()
# call Center screen
center_screen()
pwin.mainloop()