Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit 6e418dd

Browse files
committed
Update LingmoWindow
1 parent 17ae44a commit 6e418dd

File tree

6 files changed

+184
-48
lines changed

6 files changed

+184
-48
lines changed

LingmoPyUI/LingmoApp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
windowIcon='./LingmoPyUI/Image/icon.png'
1010
locale=QLocale()
1111
launcher=QObject()
12-
userSystemAppBar=False
12+
useSystemAppBar=False
1313
_app=QApplication([])
1414
_translator=QTranslator(QApplication.instance())
1515
QApplication.installTranslator(_translator)

LingmoPyUI/LingmoFrameless.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
from PySide6.QtGui import *
44

55
from . import LingmoTools
6+
from . import LingmoTheme
67

78
class LingmoFrameless(QObject):
89
def __init__(self,parent:QWidget,appbar,maximizeButton,minimizeButton,closeButton,
9-
topmost=False,disabled=False,fixsize=False,effect='normal',effective=False,
10+
topmost=False,disabled=False,fixSize=False,effect='normal',effective=False,
1011
availableEffects=[],isDarkMode=False,useSystemEffect=False,show=True):
1112
super().__init__(parent)
1213
self.appbar=appbar
@@ -17,7 +18,7 @@ def __init__(self,parent:QWidget,appbar,maximizeButton,minimizeButton,closeButto
1718
if self.topmost:
1819
self.setWindowTopMost(self.topmost)
1920
self.disabled=disabled
20-
self.fixSize=fixsize
21+
self.fixSize=fixSize
2122
self.effect=effect
2223
self.effective=effective
2324
self.availableEffects=availableEffects
@@ -96,10 +97,7 @@ def onMousePress(self):
9697
offset=clickTimer-self.clickTimer
9798
self.clickTimer=clickTimer
9899
if offset<300:
99-
if self.parent().isMaximized():
100-
self.parent().showNormal()
101-
else:
102-
self.parent().showMaximized()
100+
self.appbar.maxClickListener()
103101
else:
104102
self.parent().windowHandle().startSystemMove()
105103
def onMouseRelease(self):
@@ -131,4 +129,8 @@ def onMouseMove(self):
131129
elif p.y()>self.parent().height()-self.margins:
132130
self.edges = Qt.Edge.BottomEdge
133131
self.updateCursor(self.edges)
132+
def setEffective(self,val):
133+
self.effective=val
134+
if val:
135+
LingmoTheme.instance.blurBehindWindowEnabled=False
134136

LingmoPyUI/LingmoTheme.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def refreshColors(self):
7272
self.backgroundColor= QColor(0, 0, 0, 255) if isDark else QColor(255, 255, 255, 255)
7373
self.dividerColor= QColor(80, 80, 80, 255) if isDark else QColor(210, 210, 210, 255)
7474
self.windowBackgroundColor= QColor(32, 32, 32, 255) if isDark else QColor(237, 237, 237, 255)
75-
self.windowActiveBackgroundColo= QColor(26, 26, 26, 255) if isDark else QColor(243, 243, 243, 255)
75+
self.windowActiveBackgroundColor= QColor(26, 26, 26, 255) if isDark else QColor(243, 243, 243, 255)
7676
self.fontPrimaryColor= QColor(248, 248, 248, 255) if isDark else QColor(7, 7, 7, 255)
7777
self.fontSecondaryColor= QColor(222, 222, 222, 255) if isDark else QColor(102, 102, 102, 255)
7878
self.fontTertiaryColor= QColor(200, 200, 200, 255) if isDark else QColor(153, 153, 153, 255)
@@ -96,7 +96,7 @@ def dark(self):
9696
return False
9797
def funcToRun(self):
9898
self._mutex.lock()
99-
path=LingmoTools.getWallPaperFilePath()
99+
path=LingmoTools.getWallpaperFilePath()
100100
if self._desktopImagePath != path:
101101
if self._desktopImagePath=='':
102102
self._watcher.removePath(self._desktopImagePath)

LingmoPyUI/LingmoTools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ def isWindows10OrGreater():
176176
else:
177177
return False
178178

179-
def desktopAvailableGeometry(window):
180-
return QRect()
179+
def desktopAvailableGeometry(window:QWidget):
180+
return window.screen().availableGeometry()
181181

182182
def getWallpaperFilePath():
183183
if isWin():

0 commit comments

Comments
 (0)