From 8ca048e94d7d842d282bf5392f79452288695485 Mon Sep 17 00:00:00 2001 From: Pakobbix Date: Mon, 15 May 2023 16:52:16 +0200 Subject: [PATCH] Added Dark OS detection + Dark Theme --- StartUI.py | 4 +++- requirements.txt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/StartUI.py b/StartUI.py index 0866dfd..7e2cb5c 100644 --- a/StartUI.py +++ b/StartUI.py @@ -1,4 +1,4 @@ -import sys, gpustat, os, json, subprocess, platform, psutil, urllib.request, re, requests +import sys, gpustat, os, json, subprocess, platform, psutil, urllib.request, re, requests, darkdetect, qdarktheme from PyQt5.QtWidgets import QApplication, QToolBar, QMessageBox, QAction, QProgressBar, QMainWindow, QLabel, QVBoxLayout, QComboBox, QSlider, QCheckBox, QLineEdit, QFileDialog, QPushButton, QWidget, QListWidget, QListWidgetItem, QToolTip, QGridLayout, QRadioButton, QFrame, QDialog from PyQt5.QtCore import Qt @@ -973,5 +973,7 @@ class MainWindow(QMainWindow): if __name__ == "__main__": app = QApplication(sys.argv) main_window = MainWindow() + if darkdetect.isDark(): + app.setStyleSheet(qdarktheme.load_stylesheet()) main_window.show() sys.exit(app.exec_()) diff --git a/requirements.txt b/requirements.txt index 5eaf283..22a7f6e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ PyQt5 gpustat -psutil \ No newline at end of file +psutil +pyqtdarktheme +darkdetect \ No newline at end of file