wip: refacto qss, new assets

This commit is contained in:
2026-03-06 11:24:45 +01:00
parent 42768aa78a
commit a437de91df
11 changed files with 10793 additions and 132 deletions

View File

@@ -1,13 +1,12 @@
import sys
import os
from PyQt6 import QtGui, QtWidgets
from PyQt6 import uic
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QFontDatabase, QFont, QColor
from PyQt6.QtGui import QFontDatabase, QFont
from PyQt6.QtWidgets import QApplication, QMainWindow
# Compile resources.qrc into resources_rc.py
# rcc -g python resources.qrc -o resources_rc.py
# rcc -g python .\resources.qrc -o .\src\resources_rc.py
import resources as resources # This is generated from the .qrc file # noqa: F401
@@ -16,7 +15,7 @@ if sys.platform.startswith('linux'):
os.environ["QT_QPA_PLATFORM"] = "xcb"
if sys.platform=='windows' or sys.platform=="win32":
from win11toast import toast, notify # type: ignore
from win11toast import toast # type: ignore
# Remove this into final release
from fake_patch_notes import patch_note
@@ -49,15 +48,11 @@ class MainWindow(QMainWindow):
# Track mouse position for dragging
self._drag_pos = None
# Load font family from resource
font_family = load_custom_font()
uic.loadUi(f"{os.path.dirname(CURRENT)}/ui/mainwindow.ui", self)
# Adjust UI
self.maintitle_label.setFont(QFont(font_family, 38))
self.subtitle_label.setStyleSheet("color: rgb(163, 177, 198)")
#self.horizontalSlider.setStyle(ThinAddPageLineStyle(app.style(), QColor("#2196F3")))
# Fixe some qss properties not taken into account
self.subtitle_label.setStyleSheet("color: rgb(163, 177, 198);")
self.queue_position.setStyleSheet("color: rgb(17, 248, 183);")
if NO_STAFF :
self.staff_btn.hide()
@@ -69,7 +64,6 @@ class MainWindow(QMainWindow):
# Example: objectName = "close_btn"
self.close_btn.clicked.connect(self.close_link)
self.minimize_btn.clicked.connect(self.minimize_link)
self.connexion_btn.clicked.connect(self.connexion_btn_link)
def close_link(self):
@@ -113,13 +107,14 @@ if __name__ == "__main__":
with open(f"{os.path.dirname(CURRENT)}/styles/styles.qss", 'r') as f:
style = f.read()
# Set the stylesheet of the application
app.setStyleSheet(style)
# Load and set the global font
custom_font = QFont(load_custom_font(), 16)
if custom_font:
app.setFont(custom_font)
# Set the stylesheet of the application
app.setStyleSheet(style)
window = MainWindow()
window.show()
sys.exit(app.exec())

File diff suppressed because it is too large Load Diff