This commit is contained in:
David Rice
2026-01-19 20:38:59 +00:00
parent 4490dd803a
commit 95332f3788
5 changed files with 146 additions and 24 deletions

View File

@@ -2,7 +2,7 @@
from PySide6.QtCore import (QCoreApplication, QMetaObject, QRect, Qt)
from PySide6.QtGui import (QBrush, QColor, QFont, QIcon, QPalette, QPixmap, QFontDatabase)
from PySide6.QtWidgets import (QCheckBox, QFrame, QLabel, QProgressBar, QSlider, QPushButton, QWidget, QVBoxLayout)
from PySide6.QtWidgets import (QRadioButton, QFrame, QLabel, QFileDialog, QPushButton, QWidget)
class Ui_MainWindow(object):
@@ -13,7 +13,8 @@ class Ui_MainWindow(object):
MainWindow.setToolButtonStyle(Qt.ToolButtonIconOnly)
MainWindow.setAnimated(True)
MainWindow.setDocumentMode(False)
MainWindow.setWindowIcon(QIcon('/home/david-rice/Python/Automotive-Power-Simulator-App/arriveico.png'))
#MainWindow.setWindowIcon(QIcon('/home/david-rice/Python/Automotive-Power-Simulator-App/arriveico.png'))
MainWindow.setWindowIcon(QIcon('/home/dfr84/Python/Automotive-Power-Simulator-App/arriveico.png'))
fontmain = QFont()
fontmain.setFamilies([u"Optimism Sans"])
fontmain.setPointSize(8)
@@ -21,7 +22,8 @@ class Ui_MainWindow(object):
MainWindow.setFont(fontmain)
# Ensure the path is correct for your system!
image_path = "/home/david-rice/Python/Automotive-Power-Simulator-App/appbackground.jpg" # Example Path
#image_path = "/home/david-rice/Python/Automotive-Power-Simulator-App/appbackground.jpg"
image_path = "/home/dfr84/Python/Automotive-Power-Simulator-App/appbackground.jpg"
# --- Define and Apply the Style Sheet ---
bg_style_sheet = f"""
@@ -98,45 +100,105 @@ class Ui_MainWindow(object):
self.snLabel = QLabel(self.test_area)
self.snLabel.setObjectName(u"snlabel")
self.snLabel.setGeometry(QRect(450, 5, 200, 15))
self.snLabel.setGeometry(QRect(350, 5, 200, 15))
self.snLabel.setAlignment(Qt.AlignCenter)
self.snLabel.setStyleSheet(text_label_style)
self.sn = QLabel(self.test_area)
self.sn.setObjectName(u"sn")
self.sn.setGeometry(QRect(450, 25, 200, 25))
self.sn.setGeometry(QRect(350, 25, 200, 25))
self.sn.setAlignment(Qt.AlignCenter)
self.sn.setStyleSheet(label_style)
self.powerButton = QPushButton(self.test_area)
self.powerButton.setObjectName(u"powerButton")
self.powerButton.setGeometry(QRect(25, 75, 200, 25))
self.powerButton.setGeometry(QRect(25, 150, 200, 25))
self.powerButton.setStyleSheet(button_style)
self.setvLabel = QLabel(self.test_area)
self.setvLabel.setObjectName(u"setvlabel")
self.setvLabel.setGeometry(QRect(450, 55, 200, 15))
self.setvLabel.setGeometry(QRect(350, 130, 200, 15))
self.setvLabel.setAlignment(Qt.AlignCenter)
self.setvLabel.setStyleSheet(text_label_style)
self.setv = QLabel(self.test_area)
self.setv.setObjectName(u"setv")
self.setv.setGeometry(QRect(450, 75, 200, 25))
self.setv.setGeometry(QRect(350, 150, 200, 25))
self.setv.setAlignment(Qt.AlignCenter)
self.setv.setStyleSheet(label_style)
self.actvLabel = QLabel(self.test_area)
self.actvLabel.setObjectName(u"actvlabel")
self.actvLabel.setGeometry(QRect(675, 55, 200, 15))
self.actvLabel.setGeometry(QRect(675, 130, 200, 15))
self.actvLabel.setAlignment(Qt.AlignCenter)
self.actvLabel.setStyleSheet(text_label_style)
self.actv = QLabel(self.test_area)
self.actv.setObjectName(u"actv")
self.actv.setGeometry(QRect(675, 75, 200, 25))
self.actv.setGeometry(QRect(675, 150, 200, 25))
self.actv.setAlignment(Qt.AlignCenter)
self.actv.setStyleSheet(label_style)
self.radiolocal = QRadioButton("LOCAL CONTROL", self.test_area)
self.radiolocal.setObjectName(u"radiolocal")
self.radiolocal.setGeometry(QRect(25, 75, 200, 25))
self.radioscript = QRadioButton("SCRIPT CONTROL", self.test_area)
self.radioscript.setObjectName(u"radioscript")
self.radioscript.setGeometry(QRect(350, 75, 200, 25))
self.radiopulse = QRadioButton("PULSE TRIGGERED", self.test_area)
self.radiopulse.setObjectName(u"radiopulse")
self.radiopulse.setGeometry(QRect(675, 75, 200, 25))
radiostyle = ("""
QRadioButton {
font-size: 14px;
background-color: #FF80D4;
border: 1px solid #FF33BB;
border-radius: 1px;
spacing: 10px;
padding-left: 30px;
}
QRadioButton::indicator {
subcontrol-origin: content;
subcontrol-position: center left;
width: 15px;
height: 15px;
}
""")
self.radiolocal.setStyleSheet(radiostyle)
self.radioscript.setStyleSheet(radiostyle)
self.radiopulse.setStyleSheet(radiostyle)
self.fileexplorer = QFileDialog (self.test_area)
self.fileexplorer.setOption(QFileDialog.Option.DontUseNativeDialog, True)
self.fileexplorer.setObjectName(u"fileexplorer")
self.fileexplorer.setGeometry(QRect(25, 150, 200, 25))
filedialogstyle = ("""
QFileDialog {
background-color: #FF80D4;
border: 4px solid #FF33BB;
}
/* Style the file list/tree area */
QTreeView, QListView {
background-color: white;
border: 1px solid #FF33BB;
selection-background-color: #FF33BB;
}
/* Style the bottom buttons */
QPushButton {
background-color: #FF33BB;
color: white;
border-radius: 4px;
min-width: 80px;
padding: 5px;
}
""")
self.fileexplorer.setStyleSheet(filedialogstyle)
frame_style = """
QFrame {
background-image: url("");