@@ -1735,34 +1735,39 @@ def __init__(self,parent=None,show=True,title='Lingmo Window',windowIcon=LingmoA
17351735 stayTop = False ,showDark = False ,showClose = True ,showMinimize = True ,showMaximize = True ,showStayTop = False ,
17361736 autoMaximize = True ,autoCenter = True ,autoDestroy = True ,useSystemAppBar = LingmoApp .userSystemAppBar ,__margins = 0 ):
17371737 super ().__init__ (parent ,show = False )
1738+ self .setAttribute (Qt .WidgetAttribute .WA_TranslucentBackground )
17381739 self .launchMode = launchMode
17391740 self .argument = argument
17401741 self .fixSize = fixSize
17411742 self .fitsAppBarWindows = fitsAppBarWindows
17421743 self .tintOpacity = tintOpacity
17431744 self .blurRadius = blurRadius
1745+ self .windowIconPath = windowIcon
17441746 self .setWindowTitle (title )
17451747 self .setMouseTracking (True )
1746- self .setWindowIcon (QIcon (windowIcon ))
1747- if self .windowHandle ():
1748- self .windowHandle ().setFlags (Qt .WindowType .WindowOverridesSystemGestures )
17491748 self .stayTop = stayTop
1750- self .appbar = LingmoAppBar (self ,title = self .windowTitle (),icon = self .windowIcon ())
1751- self .contentItem = LingmoFrame (self )
1749+ self .background = LingmoFrame (self )
1750+ self .appbar = LingmoAppBar (self .background ,title = self .windowTitle (),icon = self .windowIcon ())
1751+ self .contentItem = LingmoFrame (self .background )
17521752 self .frameless = LingmoFrameless (self ,self .appbar ,self .appbar .btnMaximize ,self .appbar .btnMinimize ,self .appbar .btnClose ,show )
17531753 self .moved .connect (self .frameless .onMouseMove )
17541754 self .pressed .connect (self .frameless .onMousePress )
17551755 self .released .connect (self .frameless .onMouseRelease )
1756- self .setStayTop (stayTop )
1756+ # self.setStayTop(stayTop)
17571757 self .show ()
1758- self .appbar .addStyleSheet ('background-color' ,'transparent' )
17591758 self .contentItem .addStyleSheet ('border-radius' ,'4px 4px 4px 4px' )
1760- self .addStyleSheet ('border-radius' ,LingmoTheme .instance ._roundWindowRadius )
1759+ self .background .addStyleSheet ('background-color' ,self .palette ().color (QPalette .ColorRole .Window ))
1760+ self .background .addStyleSheet ('border-radius' ,LingmoTheme .instance ._roundWindowRadius )
1761+ self .setWindowIcon (QPixmap (self .windowIconPath ))
17611762 def updateEvent (self ):
17621763 try :
1764+ self .background .resize (self .size ())
17631765 self .contentItem .setGeometry (0 ,self .appbar .height (),self .width (),self .height ()- self .appbar .height ())
17641766 except :
17651767 pass
17661768 def setStayTop (self ,val ):
17671769 self .stayTop = val
17681770 self .frameless .setWindowTopMost (val )
1771+ def setWindowIconPath (self ,val ):
1772+ self .windowIconPath = val
1773+ self .setWindowIcon (QIcon (val ))
0 commit comments