diff --git a/main.py b/main.py index c422d73..4509a94 100644 --- a/main.py +++ b/main.py @@ -84,6 +84,12 @@ def stop_typing(self): self.thread.wait() self.thread = None self.typing_finished() + + def toggleTheme(self): + if self.lightModeCheckBox.isChecked(): + self.setStyleSheet(open("style.css").read()) + else: + self.setStyleSheet(open("darkmode.css").read()) if __name__ == "__main__": app = QApplication(sys.argv) diff --git a/ui.py b/ui.py index 70ea574..8302fc8 100644 --- a/ui.py +++ b/ui.py @@ -92,6 +92,8 @@ def setupUi(self, MainWindow): self.lightModeCheckBox = QtWidgets.QCheckBox(self.horizontalLayoutWidget) self.lightModeCheckBox.setObjectName("lightModeCheckBox") + self.lightModeCheckBox.clicked.connect(self.toggleTheme) + self.lightModeCheckBox.setChecked(True) self.settingsLayout.addWidget(self.lightModeCheckBox) self.horizontalLayout.addLayout(self.settingsLayout)