Layout is good, click boxes is wrong
This commit is contained in:
56
lib/utils.py
56
lib/utils.py
@@ -2,7 +2,7 @@
|
||||
from typing import NoReturn, Self
|
||||
|
||||
from PyQt6.QtCore import QCoreApplication, QDir, QStandardPaths, Qt
|
||||
from PyQt6.QtGui import QColor, QFont, QFontDatabase
|
||||
from PyQt6.QtGui import QColor, QFont, QFontDatabase, QTextCharFormat
|
||||
from PyQt6.QtNetwork import QNetworkAccessManager, QNetworkDiskCache
|
||||
from PyQt6.QtSql import QSqlQuery
|
||||
|
||||
@@ -41,11 +41,58 @@ class Resources:
|
||||
|
||||
subduedBackground: QColor
|
||||
|
||||
headerFormat = QTextCharFormat()
|
||||
labelFormat = QTextCharFormat()
|
||||
subduedFormat = QTextCharFormat()
|
||||
subduedItalicFormat = QTextCharFormat()
|
||||
sOnSFormat = QTextCharFormat()
|
||||
subduedLabelFormat = QTextCharFormat()
|
||||
phonticFormat = QTextCharFormat()
|
||||
boldFormat = QTextCharFormat()
|
||||
boldOnSFormat = QTextCharFormat()
|
||||
italicFormat = QTextCharFormat()
|
||||
textFormat = QTextCharFormat()
|
||||
smallCapsFormat = QTextCharFormat()
|
||||
|
||||
def __new__(cls: type[Self]) -> Self:
|
||||
if cls._instance:
|
||||
return cls._instance
|
||||
cls._instance = super(Resources, cls).__new__(cls)
|
||||
#
|
||||
# colors
|
||||
#
|
||||
cls.baseColor = QColor(Qt.GlobalColor.white)
|
||||
cls.linkColor = QColor("#4a7d95")
|
||||
cls.subduedColor = QColor(Qt.GlobalColor.gray)
|
||||
cls.subduedBackground = QColor("#444")
|
||||
#
|
||||
# Formats
|
||||
#
|
||||
LARGE = 36
|
||||
MEDIUM = 22
|
||||
SMALL = 18
|
||||
cls.headerFormat.setFontPointSize(LARGE)
|
||||
cls.labelFormat.setFontPointSize(MEDIUM)
|
||||
cls.sOnSFormat.setForeground(cls.subduedColor)
|
||||
#cls.sOnSFormat.setBackground(cls.subduedBackground)
|
||||
cls.sOnSFormat.setFontPointSize(SMALL)
|
||||
cls.subduedFormat.setForeground(cls.subduedColor)
|
||||
cls.subduedFormat.setFontPointSize(SMALL)
|
||||
cls.subduedLabelFormat.setForeground(cls.subduedColor)
|
||||
cls.subduedLabelFormat.setFontPointSize(SMALL)
|
||||
cls.phonticFormat.setFont(QFontDatabase.font("Gentium", None,20))
|
||||
cls.phonticFormat.setFontPointSize(SMALL)
|
||||
cls.boldFormat.setFontWeight(QFont.Weight.Bold)
|
||||
cls.boldFormat.setFontPointSize(SMALL)
|
||||
cls.boldOnSFormat.setFontWeight(QFont.Weight.Bold)
|
||||
cls.boldOnSFormat.setFontPointSize(SMALL)
|
||||
cls.boldOnSFormat.setBackground(cls.subduedBackground)
|
||||
cls.italicFormat.setFontItalic(True)
|
||||
cls.italicFormat.setFontPointSize(SMALL)
|
||||
cls.textFormat.setFontPointSize(SMALL)
|
||||
cls.smallCapsFormat.setFontPointSize(SMALL)
|
||||
cls.smallCapsFormat.setFontCapitalization(QFont.Capitalization.SmallCaps)
|
||||
#
|
||||
# Fonts
|
||||
#
|
||||
cls.headerFont = QFontDatabase.font("OpenDyslexic", None, 10)
|
||||
@@ -68,13 +115,6 @@ class Resources:
|
||||
cls.phonicFont = QFontDatabase.font("Gentium", None, 10)
|
||||
cls.phonicFont.setPixelSize(20)
|
||||
|
||||
#
|
||||
# colors
|
||||
#
|
||||
cls.baseColor = QColor(Qt.GlobalColor.white)
|
||||
cls.linkColor = QColor("#4a7d95")
|
||||
cls.subduedColor = QColor(Qt.GlobalColor.gray)
|
||||
cls.subduedBackground = QColor("#444")
|
||||
#
|
||||
# Setup the Network Manager
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user