moved the styling into seperate files that are now contained in the styling directory ; workflow should work with this!
All checks were successful
Build MuCaPy Executable / build-and-package (push) Successful in 1m43s
All checks were successful
Build MuCaPy Executable / build-and-package (push) Successful in 1m43s
This commit is contained in:
@@ -9,6 +9,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-package:
|
build-and-package:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -27,10 +28,13 @@ jobs:
|
|||||||
run: pip install pyinstaller
|
run: pip install pyinstaller
|
||||||
|
|
||||||
- name: Build executable with PyInstaller
|
- name: Build executable with PyInstaller
|
||||||
run: pyinstaller --onefile --windowed mucapy/main.py
|
run: |
|
||||||
|
pyinstaller --onefile --windowed mucapy/main.py \
|
||||||
|
--add-data "mucapy/styling:mucapy/styling"
|
||||||
|
|
||||||
- name: Upload executable artifact
|
- name: Upload executable artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: mucapy-executable
|
name: mucapy-executable
|
||||||
path: dist/
|
path: dist/
|
||||||
|
|
||||||
|
|||||||
197
mucapy/main.py
197
mucapy/main.py
@@ -851,39 +851,9 @@ class AboutWindow(QDialog):
|
|||||||
close_btn.setFixedWidth(100)
|
close_btn.setFixedWidth(100)
|
||||||
layout.addWidget(close_btn, alignment=Qt.AlignCenter)
|
layout.addWidget(close_btn, alignment=Qt.AlignCenter)
|
||||||
|
|
||||||
self.setStyleSheet("""
|
# Set Styling for About Section
|
||||||
QDialog {
|
with open("styling/about.qss","r") as aboutstyle:
|
||||||
background-color: #2D2D2D;
|
self.setStyleSheet(aboutstyle.read())
|
||||||
color: #DDD;
|
|
||||||
}
|
|
||||||
QLabel {
|
|
||||||
color: #DDD;
|
|
||||||
}
|
|
||||||
QGroupBox {
|
|
||||||
border: 1px solid #555;
|
|
||||||
border-radius: 6px;
|
|
||||||
margin-top: 10px;
|
|
||||||
padding: 4px;
|
|
||||||
background-color: #252525;
|
|
||||||
}
|
|
||||||
QGroupBox::title {
|
|
||||||
subcontrol-origin: margin;
|
|
||||||
left: 10px;
|
|
||||||
padding: 0 3px;
|
|
||||||
color: #DDD;
|
|
||||||
}
|
|
||||||
QPushButton {
|
|
||||||
background-color: #3A3A3A;
|
|
||||||
color: #DDD;
|
|
||||||
border: 1px solid #555;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 5px;
|
|
||||||
min-width: 80px;
|
|
||||||
}
|
|
||||||
QPushButton:hover {
|
|
||||||
background-color: #4A4A4A;
|
|
||||||
}
|
|
||||||
""")
|
|
||||||
|
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
|
|
||||||
@@ -1455,86 +1425,8 @@ class MainWindow(QMainWindow):
|
|||||||
self.hw_timer.start(1000) # Update every second
|
self.hw_timer.start(1000) # Update every second
|
||||||
|
|
||||||
# Set dark theme style
|
# Set dark theme style
|
||||||
self.setStyleSheet("""
|
with open("styling/mainwindow.qss", "r") as mainstyle:
|
||||||
QMainWindow, QWidget {
|
self.setStyleSheet(mainstyle.read())
|
||||||
background-color: #2D2D2D;
|
|
||||||
color: #DDD;
|
|
||||||
}
|
|
||||||
QLabel {
|
|
||||||
color: #DDD;
|
|
||||||
}
|
|
||||||
QPushButton {
|
|
||||||
background-color: #3A3A3A;
|
|
||||||
color: #DDD;
|
|
||||||
border: 1px solid #555;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
QPushButton:hover {
|
|
||||||
background-color: #4A4A4A;
|
|
||||||
}
|
|
||||||
QPushButton:pressed {
|
|
||||||
background-color: #2A2A2A;
|
|
||||||
}
|
|
||||||
QPushButton:disabled {
|
|
||||||
background-color: #2A2A2A;
|
|
||||||
color: #777;
|
|
||||||
}
|
|
||||||
QComboBox, QSpinBox {
|
|
||||||
background-color: #3A3A3A;
|
|
||||||
color: #DDD;
|
|
||||||
border: 1px solid #555;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 3px;
|
|
||||||
}
|
|
||||||
QGroupBox {
|
|
||||||
border: 1px solid #555;
|
|
||||||
border-radius: 4px;
|
|
||||||
margin-top: 10px;
|
|
||||||
padding-top: 15px;
|
|
||||||
background-color: #252525;
|
|
||||||
}
|
|
||||||
QGroupBox::title {
|
|
||||||
subcontrol-origin: margin;
|
|
||||||
left: 10px;
|
|
||||||
padding: 0 3px;
|
|
||||||
color: #DDD;
|
|
||||||
}
|
|
||||||
QMenuBar {
|
|
||||||
background-color: #252525;
|
|
||||||
color: #DDD;
|
|
||||||
}
|
|
||||||
QMenuBar::item {
|
|
||||||
background-color: transparent;
|
|
||||||
padding: 5px 10px;
|
|
||||||
}
|
|
||||||
QMenuBar::item:selected {
|
|
||||||
background-color: #3A3A3A;
|
|
||||||
}
|
|
||||||
QMenu {
|
|
||||||
background-color: #252525;
|
|
||||||
border: 1px solid #444;
|
|
||||||
color: #DDD;
|
|
||||||
}
|
|
||||||
QMenu::item:selected {
|
|
||||||
background-color: #3A3A3A;
|
|
||||||
}
|
|
||||||
QScrollArea {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
QDockWidget {
|
|
||||||
titlebar-close-icon: url(none);
|
|
||||||
titlebar-normal-icon: url(none);
|
|
||||||
}
|
|
||||||
QDockWidget::title {
|
|
||||||
background: #252525;
|
|
||||||
padding-left: 5px;
|
|
||||||
}
|
|
||||||
QToolButton {
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
""")
|
|
||||||
|
|
||||||
# Set palette for better dark mode support
|
# Set palette for better dark mode support
|
||||||
palette = self.palette()
|
palette = self.palette()
|
||||||
@@ -2047,18 +1939,11 @@ class MainWindow(QMainWindow):
|
|||||||
self.cpu_progress.setRange(0, 100)
|
self.cpu_progress.setRange(0, 100)
|
||||||
self.cpu_progress.setTextVisible(True)
|
self.cpu_progress.setTextVisible(True)
|
||||||
self.cpu_progress.setFormat("%p%")
|
self.cpu_progress.setFormat("%p%")
|
||||||
self.cpu_progress.setStyleSheet("""
|
|
||||||
QProgressBar {
|
# Set Styling from cpu progress QSS file
|
||||||
border: 1px solid #555;
|
with open("styling/cpu_progress.qss","r") as cpu_progress_style:
|
||||||
border-radius: 2px;
|
self.cpu_progress.setStyleSheet(cpu_progress_style.read())
|
||||||
text-align: center;
|
|
||||||
background-color: #2A2A2A;
|
|
||||||
}
|
|
||||||
QProgressBar::chunk {
|
|
||||||
background-color: #3A6EA5;
|
|
||||||
width: 1px;
|
|
||||||
}
|
|
||||||
""")
|
|
||||||
cpu_layout.addWidget(self.cpu_progress)
|
cpu_layout.addWidget(self.cpu_progress)
|
||||||
hw_monitor_layout.addLayout(cpu_layout)
|
hw_monitor_layout.addLayout(cpu_layout)
|
||||||
|
|
||||||
@@ -2072,19 +1957,10 @@ class MainWindow(QMainWindow):
|
|||||||
core_bar.setRange(0, 100)
|
core_bar.setRange(0, 100)
|
||||||
core_bar.setTextVisible(True)
|
core_bar.setTextVisible(True)
|
||||||
core_bar.setFormat("%p%")
|
core_bar.setFormat("%p%")
|
||||||
core_bar.setStyleSheet("""
|
|
||||||
QProgressBar {
|
with open("styling/core_bar.qss","r") as core_bar_styling:
|
||||||
border: 1px solid #555;
|
core_bar.setStyleSheet(core_bar_styling.read())
|
||||||
border-radius: 2px;
|
|
||||||
text-align: center;
|
|
||||||
background-color: #2A2A2A;
|
|
||||||
max-height: 12px;
|
|
||||||
}
|
|
||||||
QProgressBar::chunk {
|
|
||||||
background-color: #3A6EA5;
|
|
||||||
width: 1px;
|
|
||||||
}
|
|
||||||
""")
|
|
||||||
cores_layout.addWidget(core_label, i, 0)
|
cores_layout.addWidget(core_label, i, 0)
|
||||||
cores_layout.addWidget(core_bar, i, 1)
|
cores_layout.addWidget(core_bar, i, 1)
|
||||||
self.core_bars.append(core_bar)
|
self.core_bars.append(core_bar)
|
||||||
@@ -2314,44 +2190,17 @@ class MainWindow(QMainWindow):
|
|||||||
for bar in [self.cpu_progress] + self.core_bars:
|
for bar in [self.cpu_progress] + self.core_bars:
|
||||||
value = bar.value()
|
value = bar.value()
|
||||||
if value < 60:
|
if value < 60:
|
||||||
bar.setStyleSheet("""
|
with open("styling/bar/u60.qss","r") as u60_style:
|
||||||
QProgressBar {
|
bar.setStyleSheet(u60_style.read())
|
||||||
border: 1px solid #555;
|
|
||||||
border-radius: 2px;
|
|
||||||
text-align: center;
|
|
||||||
background-color: #2A2A2A;
|
|
||||||
}
|
|
||||||
QProgressBar::chunk {
|
|
||||||
background-color: #3A6EA5;
|
|
||||||
width: 1px;
|
|
||||||
}
|
|
||||||
""")
|
|
||||||
elif value < 85:
|
elif value < 85:
|
||||||
bar.setStyleSheet("""
|
with open("styling/bar/a85.qss","r") as a85_styling:
|
||||||
QProgressBar {
|
bar.setStyleSheet(a85_styling.read())
|
||||||
border: 1px solid #555;
|
|
||||||
border-radius: 2px;
|
|
||||||
text-align: center;
|
|
||||||
background-color: #2A2A2A;
|
|
||||||
}
|
|
||||||
QProgressBar::chunk {
|
|
||||||
background-color: #E5A823;
|
|
||||||
width: 1px;
|
|
||||||
}
|
|
||||||
""")
|
|
||||||
else:
|
else:
|
||||||
bar.setStyleSheet("""
|
with open("styling/bar/else.qss", "r") as else_style:
|
||||||
QProgressBar {
|
bar.setStyleSheet(else_style.read())
|
||||||
border: 1px solid #555;
|
|
||||||
border-radius: 2px;
|
|
||||||
text-align: center;
|
|
||||||
background-color: #2A2A2A;
|
|
||||||
}
|
|
||||||
QProgressBar::chunk {
|
|
||||||
background-color: #A23535;
|
|
||||||
width: 1px;
|
|
||||||
}
|
|
||||||
""")
|
|
||||||
|
|
||||||
def toggle_detection(self):
|
def toggle_detection(self):
|
||||||
"""Toggle detection enabled/disabled"""
|
"""Toggle detection enabled/disabled"""
|
||||||
|
|||||||
36
mucapy/styling/about.qss
Normal file
36
mucapy/styling/about.qss
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
QDialog {
|
||||||
|
background-color: #2D2D2D;
|
||||||
|
color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLabel {
|
||||||
|
color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
QGroupBox {
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 6px;
|
||||||
|
margin-top: 10px;
|
||||||
|
padding: 4px;
|
||||||
|
background-color: #252525;
|
||||||
|
}
|
||||||
|
|
||||||
|
QGroupBox::title {
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
left: 10px;
|
||||||
|
padding: 0 3px;
|
||||||
|
color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton {
|
||||||
|
background-color: #3A3A3A;
|
||||||
|
color: #DDD;
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 5px;
|
||||||
|
min-width: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:hover {
|
||||||
|
background-color: #4A4A4A;
|
||||||
|
}
|
||||||
11
mucapy/styling/bar/a85.qss
Normal file
11
mucapy/styling/bar/a85.qss
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
QProgressBar {
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 2px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #2A2A2A;
|
||||||
|
}
|
||||||
|
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: #E5A823;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
11
mucapy/styling/bar/else.qss
Normal file
11
mucapy/styling/bar/else.qss
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
QProgressBar {
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 2px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #2A2A2A;
|
||||||
|
}
|
||||||
|
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: #A23535;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
11
mucapy/styling/bar/u60.qss
Normal file
11
mucapy/styling/bar/u60.qss
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
QProgressBar {
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 2px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #2A2A2A;
|
||||||
|
}
|
||||||
|
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: #3A6EA5;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
12
mucapy/styling/core_bar.qss
Normal file
12
mucapy/styling/core_bar.qss
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
QProgressBar {
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 2px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #2A2A2A;
|
||||||
|
max-height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: #3A6EA5;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
11
mucapy/styling/cpu_progress.qss
Normal file
11
mucapy/styling/cpu_progress.qss
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
QProgressBar {
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 2px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #2A2A2A;
|
||||||
|
}
|
||||||
|
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: #3A6EA5;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
95
mucapy/styling/mainwindow.qss
Normal file
95
mucapy/styling/mainwindow.qss
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
QMainWindow, QWidget {
|
||||||
|
background-color: #2D2D2D;
|
||||||
|
color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLabel {
|
||||||
|
color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton {
|
||||||
|
background-color: #3A3A3A;
|
||||||
|
color: #DDD;
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:hover {
|
||||||
|
background-color: #4A4A4A;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:pressed {
|
||||||
|
background-color: #2A2A2A;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:disabled {
|
||||||
|
background-color: #2A2A2A;
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
|
||||||
|
QComboBox, QSpinBox {
|
||||||
|
background-color: #3A3A3A;
|
||||||
|
color: #DDD;
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QGroupBox {
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-top: 10px;
|
||||||
|
padding-top: 15px;
|
||||||
|
background-color: #252525;
|
||||||
|
}
|
||||||
|
|
||||||
|
QGroupBox::title {
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
left: 10px;
|
||||||
|
padding: 0 3px;
|
||||||
|
color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar {
|
||||||
|
background-color: #252525;
|
||||||
|
color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar::item {
|
||||||
|
background-color: transparent;
|
||||||
|
padding: 5px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar::item:selected {
|
||||||
|
background-color: #3A3A3A;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenu {
|
||||||
|
background-color: #252525;
|
||||||
|
border: 1px solid #444;
|
||||||
|
color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenu::item:selected {
|
||||||
|
background-color: #3A3A3A;
|
||||||
|
}
|
||||||
|
|
||||||
|
QScrollArea {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDockWidget {
|
||||||
|
titlebar-close-icon: url(none);
|
||||||
|
titlebar-normal-icon: url(none);
|
||||||
|
}
|
||||||
|
|
||||||
|
QDockWidget::title {
|
||||||
|
background: #252525;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolButton {
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
@@ -2,4 +2,4 @@ opencv-python==4.11.0.86
|
|||||||
numpy==2.2.6
|
numpy==2.2.6
|
||||||
PyQt5==5.15.11
|
PyQt5==5.15.11
|
||||||
requests==2.32.3
|
requests==2.32.3
|
||||||
psutil==5.9.8
|
psutil==7.0.0
|
||||||
Reference in New Issue
Block a user