A customized window based on PySide2.
Project description
PySide2-Customized-Window
简介 Introduction
本Python模块是PySideX-Customized-Window的PySide2分支,允许用户创建自定义非客户区窗口,非客户区使用PySide2绘制,支持移动、最小化、最大化、贴边自动布局、背景模糊等功能。只支持Windows、ReactOS、Wine平台。
This Python module is the PySide2 branch of PySideX-Customized-Window, allows users to create windows with customized non-client area which are drawn with PySide2, support moving, minimizing, maximizing, auto-layout of borders, background blurring, etc. It only supports Windows, ReactOS and Wine.
安装命令 Installation command
python -m pip install PySide2-Customized-Window
示例代码 Example code
# -*- coding: utf-8 -*-
import sys
from PySide2.QtWidgets import *
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2_Customized_Window import *
#class MyWindow(BlurWindow):
class MyWindow(CustomizedWindow):
def __init__(self):
super(MyWindow, self).__init__()
def MessageHandler(self, hwnd, message, wParam, lParam):
print(hwnd, message, wParam, lParam)
QApplication.setHighDpiScaleFactorRoundingPolicy(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
app = QApplication(sys.argv)
window = MyWindow()
list(map(window.setTitleTextColour, [QColor(0, 0, 139), QColor(119, 235, 255)], [1, 2], [1] * 2))
list(map(window.setMenuButtonColour, [QColor(0, 0, 139), QColor(119, 235, 255)], [1, 2], [1] * 2))
window.setWindowTitle('Window')
window.setDarkTheme(2)
window.setWindowIcon(QIcon('Icon.ico'))
splashscreen = window.splashScreen()
splashscreen.show()
window.resize(*window.getWindowSizeByClientSize([int(400 * window.dpi() / 96.0), int(175 * window.dpi() / 96.0)]))
button = QPushButton('Button', window.clientArea)
window.show()
splashscreen.finish(window)
app.exec_()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file PySide2_Customized_Window-1.16.tar.gz
.
File metadata
- Download URL: PySide2_Customized_Window-1.16.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fe310385ee16ed006ddec07fde949d03f582251cef258cd686ec27f1328eb63 |
|
MD5 | b476396efe12cabe3b5b4c5ae32bafac |
|
BLAKE2b-256 | 72e5385ad8ef1fa95909615593e64647e81b99029c33098635bd7ca5aed4b9ff |
File details
Details for the file PySide2_Customized_Window-1.16-py2.py3-none-any.whl
.
File metadata
- Download URL: PySide2_Customized_Window-1.16-py2.py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc62082b7c091c91669ffb446fddf8c0aceb6166aad18cfe5990f8b40c2e71c0 |
|
MD5 | 93a8e22c4335bee6f9455a1de7dbd927 |
|
BLAKE2b-256 | 134f2d8dd0e311006113d68e88d2241f949975b5f98f55c92284284b5cfe46fb |