diff --git a/MessageHandler.py b/MessageHandler.py index f52223b..e60c25a 100644 --- a/MessageHandler.py +++ b/MessageHandler.py @@ -6,6 +6,6 @@ class MessageHandler(): msg = QMessageBox() msg.setWindowTitle("LiquidGUI Error") msg.setText("No suitable devices could be detected. Please ensure you have a cooler \ - both compatible with LiquidCTL, and connected to the system.") +compatible with LiquidCTL, and connected to the system.") msg.setIcon(QMessageBox.Icon.Warning) msg.exec() \ No newline at end of file diff --git a/common.py b/common.py index 4f9de1b..05b5a11 100644 --- a/common.py +++ b/common.py @@ -18,5 +18,5 @@ class MinMaxCurrent: self.min = _cur return (f"🟢 Current: {self.cur}{_unit}\n" - f"❄️ Min: {self.min}{_unit} / " - f"☀️ Max: {self.max}{_unit}") + f"Min: {self.min}{_unit} / " + f"Max: {self.max}{_unit}") diff --git a/main.pyw b/main.pyw index f29a79d..e843206 100644 --- a/main.pyw +++ b/main.pyw @@ -1,20 +1,31 @@ -# External Dependencies +# External Dependencies v#################################### import sys -from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QPushButton -from PySide6.QtCore import Qt, QTimer, QThreadPool -from PySide6.QtGui import QFont, QIcon -import darkdetect -# Internal Imports -import common -import globals -from MessageHandler import MessageHandler -from styles import Labels +from PySide6.QtWidgets import (QApplication, + QMainWindow, + QWidget, + QVBoxLayout, + QProgressBar, + QPushButton) +from PySide6.QtCore import (Qt, + QTimer, + QThreadPool) +from PySide6.QtGui import QIcon +## Internal Imports ######################################### import resources +import common +from MessageHandler import MessageHandler +## Platform Imports ######################################### +import globals if globals.os == "Windows": from LiquidCTL_Helper_Windows import LiquidCTL_Helper + from styles import Labels_Windows as Labels import win32mica + import darkdetect elif globals.os == "Linux": from LiquidCTL_Helper_Linux import LiquidCTL_Helper + from styles import Labels_Linux as Labels + + class MainWindow(QMainWindow): """ Main application window. """ @@ -120,8 +131,6 @@ def main(): window = MainWindow(LiquidCTL_Helper()) window.setWindowIcon(icon) - if globals.platform == "Windows": - window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) # Show error and quit app if no devices are found if window.lctl.TestConnectionState(): @@ -129,6 +138,7 @@ def main(): sys.exit(1) else: if globals.platform == "Windows": + window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) if darkdetect.isDark(): win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK) elif darkdetect.isLight(): diff --git a/resources.py b/resources.py index 4125402..432f3c7 100644 --- a/resources.py +++ b/resources.py @@ -1,6 +1,6 @@ # Resource object code (Python 3) # Created by: object code -# Created by: The Resource Compiler for Qt version 6.7.2 +# Created by: The Resource Compiler for Qt version 6.8.1 # WARNING! All changes made in this file will be lost! from PySide6 import QtCore @@ -2621,7 +2621,7 @@ qt_resource_struct = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x90\x7f\xe4x\x0d\ +\x00\x00\x01\x93\x93\xe7\x1d\xdb\ " def qInitResources(): diff --git a/styles/Labels_Linux.py b/styles/Labels_Linux.py new file mode 100644 index 0000000..84aecc5 --- /dev/null +++ b/styles/Labels_Linux.py @@ -0,0 +1,27 @@ +from PySide6.QtWidgets import QLabel +from PySide6.QtGui import QFont +from PySide6.QtCore import Qt + +class MainLabel(QLabel): + def __init__(self): + super().__init__() + self.setAlignment(Qt.AlignmentFlag.AlignCenter) + self.setFont(QFont("Noto Sans", + 16, + weight=QFont.Weight.ExtraBold)) +class SubLabel(QLabel): + """ Formatting for sub-labels. """ + + def __init__(self, value): + super().__init__() + self.setFont(QFont("Noto Sans", 12, weight=QFont.Weight.Thin)) + self.setText(value) +class SubLabelValue(QLabel): + """ Formatting for values. """ + def __init__(self): + super().__init__() + self.setAlignment(Qt.AlignmentFlag.AlignRight) + self.setFont(QFont("Noto Sans Mono", 8)) + + + diff --git a/styles/Labels.py b/styles/Labels_Windows.py similarity index 96% rename from styles/Labels.py rename to styles/Labels_Windows.py index 50b5a06..3c548c1 100644 --- a/styles/Labels.py +++ b/styles/Labels_Windows.py @@ -7,7 +7,7 @@ class MainLabel(QLabel): super().__init__() self.setAlignment(Qt.AlignmentFlag.AlignCenter) self.setFont(QFont("Calibri", - 18, + 14.5, weight=QFont.Weight.ExtraBold)) class SubLabel(QLabel): """ Formatting for sub-labels. """