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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c25d4cfa1d276cc23817c423aab756b5e6dd1f3fb33bc5f207bf9dd0dd6e0021 |
|
MD5 | d5b37d1ef0caa620250806300514f5bd |
|
BLAKE2b-256 | b0fb79e6544119591d246abca1b0db143bb5fa0c07508a2ac3685ed73dbab54c |
Close
Hashes for PySide2_Customized_Window-1.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2ed24f67206208f22a4bae60569d8cd9970d24c0dd75321189443bb22fae1c0 |
|
MD5 | 2a4d29596e1362f74bdbe22bf963252a |
|
BLAKE2b-256 | 50dfc44944daf6e44715ebb029e9f7b01e57646b8ce39c9a1eb300403cf4ce5c |
Close
Hashes for PySide2_Customized_Window-1.11-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7da74842b52940d553a73f41ab7482b635c0a3b201956322c2aba520c8acbfa9 |
|
MD5 | f210ae3c922f27473088103d2a3d8a7e |
|
BLAKE2b-256 | c163429f3aedc19c06a1397feb70cbf3809d8c5de0dee28e365e8d155d639760 |