LiquidGUI [1.2.0.0]

- Linux Support
This commit is contained in:
2024-12-26 12:32:51 +00:00
parent 040fff0677
commit 03fca21675
6 changed files with 55 additions and 18 deletions
+1 -1
View File
@@ -6,6 +6,6 @@ class MessageHandler():
msg = QMessageBox() msg = QMessageBox()
msg.setWindowTitle("LiquidGUI Error") msg.setWindowTitle("LiquidGUI Error")
msg.setText("No suitable devices could be detected. Please ensure you have a cooler \ 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.setIcon(QMessageBox.Icon.Warning)
msg.exec() msg.exec()
+2 -2
View File
@@ -18,5 +18,5 @@ class MinMaxCurrent:
self.min = _cur self.min = _cur
return (f"🟢 Current: {self.cur}{_unit}\n" return (f"🟢 Current: {self.cur}{_unit}\n"
f"❄️ Min: {self.min}{_unit} / " f"Min: {self.min}{_unit} / "
f"☀️ Max: {self.max}{_unit}") f"Max: {self.max}{_unit}")
+22 -12
View File
@@ -1,20 +1,31 @@
# External Dependencies # External Dependencies v####################################
import sys import sys
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QPushButton from PySide6.QtWidgets import (QApplication,
from PySide6.QtCore import Qt, QTimer, QThreadPool QMainWindow,
from PySide6.QtGui import QFont, QIcon QWidget,
import darkdetect QVBoxLayout,
# Internal Imports QProgressBar,
import common QPushButton)
import globals from PySide6.QtCore import (Qt,
from MessageHandler import MessageHandler QTimer,
from styles import Labels QThreadPool)
from PySide6.QtGui import QIcon
## Internal Imports #########################################
import resources import resources
import common
from MessageHandler import MessageHandler
## Platform Imports #########################################
import globals
if globals.os == "Windows": if globals.os == "Windows":
from LiquidCTL_Helper_Windows import LiquidCTL_Helper from LiquidCTL_Helper_Windows import LiquidCTL_Helper
from styles import Labels_Windows as Labels
import win32mica import win32mica
import darkdetect
elif globals.os == "Linux": elif globals.os == "Linux":
from LiquidCTL_Helper_Linux import LiquidCTL_Helper from LiquidCTL_Helper_Linux import LiquidCTL_Helper
from styles import Labels_Linux as Labels
class MainWindow(QMainWindow): class MainWindow(QMainWindow):
""" Main application window. """ """ Main application window. """
@@ -120,8 +131,6 @@ def main():
window = MainWindow(LiquidCTL_Helper()) window = MainWindow(LiquidCTL_Helper())
window.setWindowIcon(icon) window.setWindowIcon(icon)
if globals.platform == "Windows":
window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
# Show error and quit app if no devices are found # Show error and quit app if no devices are found
if window.lctl.TestConnectionState(): if window.lctl.TestConnectionState():
@@ -129,6 +138,7 @@ def main():
sys.exit(1) sys.exit(1)
else: else:
if globals.platform == "Windows": if globals.platform == "Windows":
window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
if darkdetect.isDark(): if darkdetect.isDark():
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK) win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK)
elif darkdetect.isLight(): elif darkdetect.isLight():
+2 -2
View File
@@ -1,6 +1,6 @@
# Resource object code (Python 3) # Resource object code (Python 3)
# Created by: object code # 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! # WARNING! All changes made in this file will be lost!
from PySide6 import QtCore 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\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\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(): def qInitResources():
+27
View File
@@ -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))
@@ -7,7 +7,7 @@ class MainLabel(QLabel):
super().__init__() super().__init__()
self.setAlignment(Qt.AlignmentFlag.AlignCenter) self.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.setFont(QFont("Calibri", self.setFont(QFont("Calibri",
18, 14.5,
weight=QFont.Weight.ExtraBold)) weight=QFont.Weight.ExtraBold))
class SubLabel(QLabel): class SubLabel(QLabel):
""" Formatting for sub-labels. """ """ Formatting for sub-labels. """