Centralize font handling

closes #1098

Co-authored-by: Jazzzny <jazzzny225@gmail.com>
This commit is contained in:
Dhinak G
2023-09-18 12:05:21 -04:00
parent 211e8fbb71
commit 9676c2c08a
14 changed files with 134 additions and 111 deletions

View File

@@ -8,6 +8,9 @@ from resources import (
utilities
)
from resources.wx_gui import gui_support
class DownloadFrame(wx.Frame):
"""
@@ -36,19 +39,19 @@ class DownloadFrame(wx.Frame):
frame = self if not frame else frame
title_label = wx.StaticText(frame, label=f"Downloading: {self.item_name}", pos=(-1,5))
title_label.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
title_label.SetFont(gui_support.font_factory(19, wx.FONTWEIGHT_BOLD))
title_label.Centre(wx.HORIZONTAL)
label_amount = wx.StaticText(frame, label="0.00 B downloaded of 0.00B (0.00%)", pos=(-1, title_label.GetPosition()[1] + title_label.GetSize()[1] + 5))
label_amount.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
label_amount.SetFont(gui_support.font_factory(13, wx.FONTWEIGHT_NORMAL))
label_amount.Centre(wx.HORIZONTAL)
label_speed = wx.StaticText(frame, label="Average download speed: Unknown", pos=(-1, label_amount.GetPosition()[1] + label_amount.GetSize()[1] + 5))
label_speed.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
label_speed.SetFont(gui_support.font_factory(13, wx.FONTWEIGHT_NORMAL))
label_speed.Centre(wx.HORIZONTAL)
label_est_time = wx.StaticText(frame, label="Estimated time remaining: Unknown", pos=(-1, label_speed.GetPosition()[1] + label_speed.GetSize()[1] + 5))
label_est_time.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
label_est_time.SetFont(gui_support.font_factory(13, wx.FONTWEIGHT_NORMAL))
label_est_time.Centre(wx.HORIZONTAL)
progress_bar = wx.Gauge(frame, range=100, pos=(-1, label_est_time.GetPosition()[1] + label_est_time.GetSize()[1] + 5), size=(300, 20))