边框阴影

This commit is contained in:
Irony 2018-08-16 21:09:00 +08:00
parent 019a69d260
commit 180d11a7d1

View file

@ -5,6 +5,7 @@ import ctypes.wintypes
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget
from PyQt5.QtWinExtras import QtWin
import win32api
import win32con
import win32gui
@ -53,6 +54,12 @@ class Window(QWidget):
win32gui.SetWindowLong(
int(self.winId()), win32con.GWL_STYLE, style | win32con.WS_THICKFRAME)
if QtWin.isCompositionEnabled():
# 加上 Aero 边框阴影
QtWin.extendFrameIntoClientArea(self, -1, -1, -1, -1)
else:
QtWin.resetExtendedFrame(self)
def nativeEvent(self, eventType, message):
retval, result = super(Window, self).nativeEvent(eventType, message)
if eventType == "windows_generic_MSG":