-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from littlewhitecloud/main
Add mica alt effect and some small tweaks
- Loading branch information
Showing
7 changed files
with
219 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,68 @@ | ||
import ctypes | ||
|
||
try: | ||
import win32mica as mc | ||
from PySide6 import QtWidgets, QtCore | ||
except ImportError: | ||
import os | ||
os.system("pip install win32mica PySide2") | ||
from win32mica import ApplyMica, MicaTheme, MicaStyle | ||
from PySide6 import QtWidgets, QtCore | ||
|
||
root = QtWidgets.QApplication() | ||
app = QtWidgets.QMainWindow() | ||
app.setAttribute(QtCore.Qt.WA_TranslucentBackground) | ||
app.setWindowTitle("Qt Dark") | ||
app.setGeometry(100, 100, 300, 200) | ||
mc.ApplyMica(app.winId(), mc.MICAMODE.DARK) | ||
ApplyMica(app.winId(), MicaTheme.DARK, MicaStyle.DEFAULT) | ||
app.show() | ||
|
||
app2 = QtWidgets.QMainWindow() | ||
app2.setAttribute(QtCore.Qt.WA_TranslucentBackground) | ||
app2.setWindowTitle("Qt Light") | ||
app2.setGeometry(400, 100, 300, 200) | ||
mc.ApplyMica(app2.winId(), mc.MICAMODE.LIGHT) | ||
ApplyMica(app2.winId(), MicaTheme.LIGHT, MicaStyle.DEFAULT) | ||
app2.show() | ||
|
||
app3 = QtWidgets.QMainWindow() | ||
app3.setAttribute(QtCore.Qt.WA_TranslucentBackground) | ||
app3.setWindowTitle("Qt Dark Alt") | ||
app3.setGeometry(100, 330, 300, 200) | ||
ApplyMica(app3.winId(), MicaTheme.DARK, MicaStyle.ALT) | ||
app3.show() | ||
|
||
app4 = QtWidgets.QMainWindow() | ||
app4.setAttribute(QtCore.Qt.WA_TranslucentBackground) | ||
app4.setWindowTitle("Qt Light Alt") | ||
app4.setGeometry(400, 330, 300, 200) | ||
ApplyMica(app4.winId(), MicaTheme.LIGHT, MicaStyle.ALT) | ||
app4.show() | ||
|
||
app5 = QtWidgets.QMainWindow() | ||
app5.setAttribute(QtCore.Qt.WA_TranslucentBackground) | ||
app5.setWindowTitle("Qt Auto") | ||
app5.setGeometry(700, 100, 300, 200) | ||
|
||
label = QtWidgets.QLabel("Change the system theme\nfrom the settings!") | ||
def ApplyStyleSheet(theme): | ||
if theme == MicaTheme.DARK: | ||
label.setStyleSheet("color: white") | ||
else: | ||
label.setStyleSheet("color: black") | ||
|
||
ApplyMica(app5.winId(), MicaTheme.AUTO, MicaStyle.DEFAULT, OnThemeChange=ApplyStyleSheet) | ||
app5.show() | ||
app5.setCentralWidget(label) | ||
|
||
app6 = QtWidgets.QMainWindow() | ||
app6.setAttribute(QtCore.Qt.WA_TranslucentBackground) | ||
app6.setWindowTitle("Qt Auto Alt") | ||
app6.setGeometry(700, 330, 300, 200) | ||
|
||
label2 = QtWidgets.QLabel("Change the system theme\nfrom the settings!") | ||
def ApplyStyleSheet(theme): | ||
if theme == MicaTheme.DARK: | ||
label2.setStyleSheet("color: white") | ||
else: | ||
label2.setStyleSheet("color: black") | ||
|
||
ApplyMica(app6.winId(), MicaTheme.AUTO, MicaStyle.ALT, OnThemeChange=ApplyStyleSheet) | ||
app6.show() | ||
app6.setCentralWidget(label2) | ||
|
||
|
||
root.exec_() |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.