From ca036a557616fc262ac3738fa045b0824a9d3b15 Mon Sep 17 00:00:00 2001 From: Dunestorm Date: Sun, 14 Jul 2024 15:24:26 +0100 Subject: [PATCH] LiquidGUI [1.1.3.0] - Added emoji to value text. - Refactored label styling. --- common.py | 4 +++- file_version_info.txt | 8 ++++---- main.pyw | 26 +++++++++++--------------- setup.py | 12 ++++++++++++ styles/Labels.py | 27 +++++++++++++++++++++++++++ styles/SubLabel.py | 11 ----------- styles/SubLabelValue.py | 10 ---------- 7 files changed, 57 insertions(+), 41 deletions(-) create mode 100644 setup.py create mode 100644 styles/Labels.py delete mode 100644 styles/SubLabel.py delete mode 100644 styles/SubLabelValue.py diff --git a/common.py b/common.py index ce34773..4f9de1b 100644 --- a/common.py +++ b/common.py @@ -17,4 +17,6 @@ class MinMaxCurrent: if self.cur < self.min: self.min = _cur - return f"Current: {self.cur}{_unit}\n(Min: {self.min}{_unit} / Max: {self.max}{_unit})" + return (f"🟢 Current: {self.cur}{_unit}\n" + f"❄️ Min: {self.min}{_unit} / " + f"☀️ Max: {self.max}{_unit}") diff --git a/file_version_info.txt b/file_version_info.txt index f99b475..c35be34 100644 --- a/file_version_info.txt +++ b/file_version_info.txt @@ -7,8 +7,8 @@ VSVersionInfo( ffi=FixedFileInfo( # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4) # Set not needed items to zero 0. Must always contain 4 elements. - filevers=(1,1,2,0), - prodvers=(1,1,2,0), + filevers=(1,1,3,0), + prodvers=(1,1,3,0), # Contains a bitmask that specifies the valid bits 'flags'r mask=0x3f, # Contains a bitmask that specifies the Boolean attributes of the file. @@ -32,12 +32,12 @@ VSVersionInfo( u'040904B0', [StringStruct(u'CompanyName', u'Fil Sapia'), StringStruct(u'FileDescription', u'LiquidGUI'), - StringStruct(u'FileVersion', u'1.1.2.0'), + StringStruct(u'FileVersion', u'1.1.3.0'), StringStruct(u'InternalName', u'LiquidGUI'), StringStruct(u'LegalCopyright', u'© Fil Sapia. All rights reserved.'), StringStruct(u'OriginalFilename', u'LiquidGUI.exe'), StringStruct(u'ProductName', u'LiquidGUI'), - StringStruct(u'ProductVersion', u'1.1.2.0')]) + StringStruct(u'ProductVersion', u'1.1.3.0')]) ]), VarFileInfo([VarStruct(u'Translation', [0, 1200, 1033, 1252])]) ] diff --git a/main.pyw b/main.pyw index 40f44d1..48e60c6 100644 --- a/main.pyw +++ b/main.pyw @@ -8,8 +8,7 @@ import darkdetect # Internal Imports from LiquidCTL_Helper import LiquidCTL_Helper from MessageHandler import MessageHandler -from styles.SubLabel import SubLabel -from styles.SubLabelValue import SubLabelValue +from styles import Labels import common import resources, pkg_resources.extern @@ -19,41 +18,38 @@ class MainWindow(QMainWindow): def __init__(self, lctl): super(MainWindow, self).__init__() - self.setWindowTitle("LiquidGUI (v.1.1.2.0)") - self.setFixedSize(450, 450) + self.setWindowTitle("LiquidGUI (v.1.1.3.0)") + self.setFixedSize(450, 500) self.lctl = lctl # Widgets ########################################## - self.lbl_device_name = QLabel(font=QFont("Calibri", - 18, - weight=QFont.Weight.Bold), - alignment=Qt.AlignmentFlag.AlignCenter) + self.lbl_device_name = Labels.MainLabel() - self.lbl_temp = SubLabel(value="💧 Liquid Temperature:") + self.lbl_temp = Labels.SubLabel(value="💧 Liquid Temperature:") self.min_max_cur_temp = common.MinMaxCurrent() self.prg_temp = QProgressBar(textVisible=False, minimum=0, maximum=50) - self.lbl_value_prg_temp = SubLabelValue() + self.lbl_value_prg_temp = Labels.SubLabelValue() - self.lbl_fanspeed = SubLabel(value="🍃 Fan Speed:") + self.lbl_fanspeed = Labels.SubLabel(value="🍃 Fan Speed:") self.min_max_cur_fanspeed = common.MinMaxCurrent() self.prg_fanspeed = QProgressBar(textVisible=False, minimum=520, maximum=1700) - self.lbl_value_prg_fanspeed = SubLabelValue() + self.lbl_value_prg_fanspeed = Labels.SubLabelValue() - self.lbl_pumpspeed = SubLabel(value="⛽ Pump Speed:") + self.lbl_pumpspeed = Labels.SubLabel(value="⛽ Pump Speed:") self.min_max_cur_pumpspeed = common.MinMaxCurrent() self.prg_pumpspeed = QProgressBar(textVisible=False, minimum=1900, maximum=2700) - self.lbl_value_prg_pumpspeed = SubLabelValue() + self.lbl_value_prg_pumpspeed = Labels.SubLabelValue() self.btn_reset_min_max = QPushButton("Reset Min/Max") self.btn_reset_min_max.clicked.connect(self.on_reset_min_max) - self.lbl_fwvers = SubLabelValue() + self.lbl_fwvers = Labels.SubLabelValue() # Layout ########################################## widget = QWidget(self) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..91a7c21 --- /dev/null +++ b/setup.py @@ -0,0 +1,12 @@ +from setuptools import setup + +setup( + name='LiquidGUI', + version='1.1.3.0', + packages=[''], + url='', + license='', + author='Fil Sapia', + author_email='filippo333@gmail.com', + description='' +) diff --git a/styles/Labels.py b/styles/Labels.py new file mode 100644 index 0000000..50b5a06 --- /dev/null +++ b/styles/Labels.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("Calibri", + 18, + weight=QFont.Weight.ExtraBold)) +class SubLabel(QLabel): + """ Formatting for sub-labels. """ + + def __init__(self, value): + super().__init__() + self.setFont(QFont("Calibri", 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("Cascadia Code", 8)) + + + diff --git a/styles/SubLabel.py b/styles/SubLabel.py deleted file mode 100644 index 0b6ec56..0000000 --- a/styles/SubLabel.py +++ /dev/null @@ -1,11 +0,0 @@ -from PySide6.QtWidgets import QLabel -from PySide6.QtGui import QFont - - -class SubLabel(QLabel): - """ Formatting for sub-labels. """ - - def __init__(self, value): - super().__init__() - self.setFont(QFont("Calibri", 12, weight=QFont.Weight.Bold)) - self.setText(value) diff --git a/styles/SubLabelValue.py b/styles/SubLabelValue.py deleted file mode 100644 index 1a4a236..0000000 --- a/styles/SubLabelValue.py +++ /dev/null @@ -1,10 +0,0 @@ -from PySide6.QtWidgets import QLabel -from PySide6.QtGui import QFont -from PySide6.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)) \ No newline at end of file