-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathabout_developer.py
More file actions
67 lines (56 loc) · 3.13 KB
/
about_developer.py
File metadata and controls
67 lines (56 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# CrossTask Team
# Developers: @zlElo and @DarkGloves
# Licensed under GPL 3.0
from customtkinter import *
from PIL import Image
import tkinter as tk
import os
import webbrowser
import platform
import customtkinter
import json
class Icons():
def __init__(self, size:tuple) -> None:
self.github = CTkImage(Image.open(os.path.join(os.getcwd(), 'img', 'light', 'github.png')), Image.open(os.path.join(os.getcwd(), 'img', 'dark', 'github.png')), size=size)
self.mail = CTkImage(Image.open(os.path.join(os.getcwd(), 'img', 'light', 'mail.png')), Image.open(os.path.join(os.getcwd(), 'img', 'dark', 'mail.png')), size=size)
self.telegram = CTkImage(Image.open(os.path.join(os.getcwd(), 'img', 'light', 'telegram.png')), Image.open(os.path.join(os.getcwd(), 'img', 'dark', 'telegram.png')), size=size)
class DevelopersPopup(CTkToplevel):
def __init__(self):
super().__init__()
self.geometry('400x190')
self.resizable(False, False)
self.title('Developers')
# read settings
doc_path = os.path.join(os.path.expanduser('~'), 'Documents')
with open(f'{doc_path}/CrossTask/Settings/settings.json', 'r') as f:
data = json.load(f)
theme = data['theme']
f.close()
if theme == "System":
customtkinter.set_appearance_mode("system")
elif theme == "Dark":
customtkinter.set_appearance_mode("dark")
elif theme == "White":
customtkinter.set_appearance_mode("white")
CTkLabel(self, text='This project has been developed by:', font=('Arial', 16, 'bold')).pack(pady=10)
self._developerFrame('DarkGloves', 'https://github.com/DarkGloves').pack(pady=15)
self._developerFrame('zlElo', 'https://github.com/zlElo').pack(pady=(0,5))
# platform check for window icon
operating_system = platform.system()
if operating_system == 'Windows':
self.after(200, lambda: self.iconbitmap(os.path.join(os.getcwd(), 'img', 'bitmap.ico')))
elif operating_system == 'Linux':
pass
else:
# setup macos window icon
img = tk.Image("photo", file="content/logo_crosstask-removebg.png")
self.after(200, lambda: self.tk.call('wm','iconphoto', self._w, img))
def _developerFrame(self, devName:str, githubProfile:str=False, mailAdress:str=False):
frame = CTkFrame(self, corner_radius=5)
frame.rowconfigure((0), weight=1)
frame.columnconfigure((0), weight=8)
frame.columnconfigure((1,2), weight=1)
CTkLabel(frame, text=devName, font=('Arial', 16)).grid(row=0, column=0, pady=5, sticky=NSEW, padx=5)
CTkButton(frame, text=None, hover_color='gray30', image=Icons((20,20)).github, width=0, height=0,fg_color='transparent', corner_radius=15, command=lambda : webbrowser.open(githubProfile)).grid(column=1, row=0, padx=10) if githubProfile else None
CTkButton(frame, text=None, hover_color='gray30', image=Icons((20,20)).mail, width=0, height=0,fg_color='transparent', corner_radius=15).grid(column=2, row=0, padx=(0,10)) if mailAdress else None
return frame