LiquidGUI [1.1.0.0] Dev

- Code cleanup & refactoring.
- Platform specific code.
This commit is contained in:
2024-07-09 22:00:56 +01:00
parent aed37b7fae
commit 65456aa5c6
6 changed files with 64 additions and 36 deletions
+26
View File
@@ -0,0 +1,26 @@
from PyQt6.QtWidgets import QLabel
from PyQt6.QtGui import QFont
from PyQt6.QtCore import Qt
import styles
class MainLabel(QLabel):
""" Formatting for the main label. """
def __init__(self, value):
super().__init__()
self.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.setFont(QFont(styles.sublabel_font, 16, weight=QFont.Weight.Bold))
self.setText(value)
class SubLabel(QLabel):
""" Formatting for sub-labels. """
def __init__(self, value):
super().__init__()
self.setFont(QFont(styles.mainlabel_font, 10, weight=QFont.Weight.Bold))
self.setText(value)
class SubLabelValue(QLabel):
""" Formatting for values. """
def __init__(self):
super().__init__()
self.setAlignment(Qt.AlignmentFlag.AlignRight)
self.setFont(QFont(styles.sublabelvalue_font, 8))
-9
View File
@@ -1,9 +0,0 @@
from PyQt6.QtWidgets import QLabel
from PyQt6.QtGui import QFont
class SubLabel(QLabel):
""" Formatting for sub-labels. """
def __init__(self, value):
super().__init__()
self.setFont(QFont("Calibre", 10, weight=QFont.Weight.Bold))
self.setText(value)
-10
View File
@@ -1,10 +0,0 @@
from PyQt6.QtWidgets import QLabel
from PyQt6.QtGui import QFont
from PyQt6.QtCore import Qt
class SubLabelValue(QLabel):
""" Formatting for values. """
def __init__(self):
super().__init__()
self.setAlignment(Qt.AlignmentFlag.AlignRight)
self.setFont(QFont("Cascadia Code", 8))
+15
View File
@@ -0,0 +1,15 @@
from PyQt6.QtGui import QFont
import globals
mainlabel_font = None
sublabel_font = None
sublabelvalue_font = None
if globals.os_type == "Windows":
sublabelvalue_font = "Cascadia Code"
sublabel_font = "Calibre"
mainlabel_font = "Calibre"
elif globals.os_type == "Linux":
sublabelvalue_font = "Liberation Mono"
sublabel_font = "Cantarell"
mainlabel_font = "Cantarell"