-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fonts: Remove Custom Fonts Causes Windows Glitch
UI: Move UI Files to More Proper Folder Structure UI: Completely Refactor to Use Custom Elements from base class Update Imports for all Files
- Loading branch information
Showing
22 changed files
with
208 additions
and
189 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from tkinter import Button | ||
|
||
|
||
def small_button(master, label, command): | ||
new_btn = Button( | ||
master.ui, | ||
text=label, | ||
**master.theme, | ||
command=command, | ||
font=master.FONTS["buttons"]["small"] | ||
) | ||
|
||
return new_btn | ||
|
||
|
||
def medium_button(master, label, command): | ||
new_btn = Button( | ||
master.ui, | ||
text=label, | ||
**master.theme, | ||
command=command, | ||
font=master.FONTS["buttons"]["medium"] | ||
) | ||
|
||
return new_btn | ||
|
||
|
||
def large_button(master, label, command): | ||
new_btn = Button( | ||
master.ui, | ||
text=label, | ||
**master.theme, | ||
command=command, | ||
font=master.FONTS["buttons"]["large"] | ||
) | ||
|
||
return new_btn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from tkinter import Checkbutton | ||
|
||
|
||
def check_btn(master, text, variable, command=None): | ||
new_checkbtn = Checkbutton( | ||
master.ui, | ||
text=text, | ||
variable=variable, | ||
**master.theme, | ||
command=command, | ||
font=master.FONTS["buttons"]["small"], | ||
activebackground=master.bg, | ||
activeforeground=master.fg, | ||
highlightcolor=master.bg, | ||
selectcolor=master.bg, | ||
onvalue=True, | ||
offvalue=False, | ||
) | ||
return new_checkbtn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from app.helpers.ui.elements.button import small_button, medium_button, large_button | ||
from app.helpers.ui.elements.label import small_label, medium_label, title_label | ||
from app.helpers.ui.elements.checkbutton import check_btn | ||
from app.helpers.ui.elements.radiobutton import radio_btn | ||
|
||
|
||
class tk_elements: | ||
def __init__(self): | ||
# Buttons | ||
self.small_btn = small_button | ||
self.medium_btn = medium_button | ||
self.large_btn = large_button | ||
|
||
# labels | ||
self.small_lbl = small_label | ||
self.medium_lbl = medium_label | ||
self.title_lbl = title_label | ||
|
||
# others | ||
self.check_btn = check_btn | ||
self.radio_btn = radio_btn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from tkinter import Label | ||
|
||
|
||
def small_label(master, text, bold): | ||
font_label = "small_bold" if bold else "small" | ||
new_label = Label(master.ui, text=text, **master.theme, font=master.FONTS[font_label]) | ||
return new_label | ||
|
||
|
||
def medium_label(master, text, bold): | ||
font_label = "medium_bold" if bold else "medium" | ||
new_label = Label(master.ui, text=text, **master.theme, font=master.FONTS[font_label]) | ||
return new_label | ||
|
||
|
||
def title_label(master, text): | ||
new_label = Label(master.ui, text=text, **master.theme, font=master.FONTS["title"]) | ||
return new_label |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from tkinter import Radiobutton | ||
|
||
|
||
def radio_btn(master, text, variable, value, command): | ||
new_radiobtn = Radiobutton( | ||
master.ui, | ||
text=text, | ||
variable=variable, | ||
value=value, | ||
**master.theme, | ||
selectcolor=master.bg, | ||
font=master.FONTS["buttons"]["small"], | ||
command=command, | ||
) | ||
return new_radiobtn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
BG = "#121212" | ||
FG = "#FFFFFF" | ||
ACCENT = "#e84545" | ||
|
||
THEME = {"background": BG, "foreground": FG} | ||
|
||
FONTS = { | ||
"small": ("Arial", 10, "normal"), | ||
"small_bold": ("Arial", 10, "bold"), | ||
"medium": ("Arial", 12, "normal"), | ||
"medium_bold": ("Arial", 12, "bold"), | ||
"title": ("Arial", 25, "bold"), | ||
"buttons": { | ||
"small": ("Arial", 9, "bold"), | ||
"medium": ("Arial", 11, "bold"), | ||
"large": ("Arial", 15, "bold"), | ||
}, | ||
} | ||
|
||
TTK_THEME = { | ||
"TProgressbar": { | ||
"configure": { | ||
"troughcolor": BG, | ||
"bordercolor": FG, | ||
"background": ACCENT, | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.