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 Distributions
Close
Hashes for PySide2_Customized_Window-1.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31210dcdb30086914cc1a731d68e2eddd454c948fb401fea925c06d5a563bf86 |
|
MD5 | 44ab5730e7b7aaf5d90374c977525dc6 |
|
BLAKE2b-256 | 686a456838bf6f2b21394f9c0edfac9f7cd1f4b41c4b74ff8cba4025fbd0239a |
Close
Hashes for PySide2_Customized_Window-1.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e8a217f211c267b5898cb5baecb244a5870bd5f01e1a3e8a4404b3db3bdeb44 |
|
MD5 | ade67a4bc3cad215652b2df82063bfc3 |
|
BLAKE2b-256 | c4b3984ab113c9f327030bbc4f145ba98e3c6e3b41ced10b3aa297793574b83f |
Close
Hashes for PySide2_Customized_Window-1.12-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25bab6bddea2ead21a764c29be398b0ac7d85257fde01a8b470f0cd83d8cd134 |
|
MD5 | c9204a88f656dde5d4541bd464dabdc4 |
|
BLAKE2b-256 | ce31e04312d37bb3b691cc3afc8e1a0225999a9edbe6e5f0284f9a0a91c1f610 |