pyside6-modern-widgets
Cross-platform desktop widgets for PySide6. The package provides frameless window chrome, navigation, and tabs while retaining familiar Qt widget APIs.
ModernWindow: a frameless replacement for top-levelQWidgetwindows with selectedQMainWindow-compatible methods.ModernDialog: a framelessQDialogthat preserves the standard dialog API.ModernMessageBox: a themed message box with familiarQMessageBoxbuttons and convenience methods.ModernMenu: a nativeQMenuwith Windows 11 system acrylic (and an opaque fallback elsewhere) plus rounded outer and selected-item backgrounds.ModernMenuBar: aQMenuBarthat createsModernMenudrop-down menus.NavigationSidebar: a collapsible navigation sidebar.NavigationView: a sidebar and synchronized page stack in one widget.TabView: a WinUI-inspired tab widget.
Supported environment
Supports Windows, macOS, and Linux with Python 3.10-3.12, PySide6 6.8.3, and the Fusion style. Window backgrounds, including the custom title bar, use the same Qt-painted, wallpaper-colored theme behavior on every platform.
On Windows, the custom chrome retains native activation, moving, resizing, minimize/maximize/restore transitions, Aero Snap, shadows, and the system menu. Windows 11 additionally provides DWM-rounded corners and Snap Layouts from the custom maximize button; Windows 10 uses an opaque square-corner surface. On platforms without equivalent frameless-window APIs, Qt supplies system moving, resizing, and a menu with the available window commands.
Installation
pip install pyside6-modern-widgets
Upgrading to 0.5.0
Version 0.5.0 adds modern dialogs, message boxes, menus, and menu bars, plus independent title-bar text/icon visibility and centered title text. It also improves Windows maximize/restore behavior and content-aware navigation layout. See the changelog for the full release notes.
When upgrading from 0.4.x, remove uses of WatercolorStyle,
theme_with_watercolor_style, ORIGINAL_LIGHT_THEME, and ORIGINAL_DARK_THEME.
These exports and the title-bar Theme Style submenu have been removed. Widgets
now follow desktop-wallpaper colors by default; LIGHT_THEME, DARK_THEME,
ModernTheme, and setTheme() remain available for explicit theme overrides.
Automatic navigation overlay thresholds now depend on the current page's
minimum width instead of fixed window widths. Use setAutoSidebarOverlay(False)
and setSidebarOverlay() if your application needs explicit control.
PyInstaller
The installed package automatically registers its PyInstaller hook. Applications
using these widgets can be frozen normally without package-specific
--hidden-import or --add-data options:
pyinstaller your_app.py
Example
from PySide6.QtGui import QAction
from PySide6.QtWidgets import QApplication, QLabel
from pyside6_modern_widgets import ModernWindow
app = QApplication([])
window = ModernWindow()
window.setWindowTitle("Modern window")
file_menu = window.menuBar().addMenu("&File")
exit_action = QAction("Exit", window)
exit_action.triggered.connect(window.close)
file_menu.addAction(exit_action)
window.setCentralWidget(QLabel("Hello"))
window.resize(800, 500)
window.show()
app.exec()
ModernWindow.menuBar() returns a ModernMenuBar, so menus created from a
title or icon automatically use ModernMenu, including nested submenus.
ModernMenuBar itself provides a transparent background and rounded selection
highlight, including when constructed manually. It follows its containing
modern window's theme, or the global theme when used on its own.
When space is limited, its overflow button also opens a ModernMenu with the
same rounded surface and selection styling as the regular drop-down menus.
To place a manually created menu bar in the title bar's left control area:
from pyside6_modern_widgets import ModernMenuBar
menu_bar = ModernMenuBar(window)
menu_bar.setNativeMenuBar(False)
menu_bar.addMenu("&File").addAction("Open")
window.titleBar.addCustomWidget(menu_bar, align="left")
window.setTitleVisible(False)
setTitleVisible() controls only title text. setIconVisible() independently
controls the title bar icon. Both default to True and preserve the actual
window title and icon used by the operating system. Updating either while it is
hidden does not show it again. isTitleVisible() and isIconVisible() return
the configured visibility, even when the window itself is hidden. An empty
window icon is not drawn, regardless of the icon visibility setting.
The icon stays at the far left whenever it is visible. Title text is left-aligned
by default, between the icon and left custom widgets such as menus. Use
setTitleAlignment("center") to center only the text on the window, with menus
following the icon, or setTitleAlignment("left") to restore the default order.
titleAlignment() returns the selected mode. In narrow windows, the centered
text stays within the space between the left controls and the window buttons.
Blank space remains available for dragging. Right custom widgets appear before
the window buttons. All six methods are also available on window.titleBar.
An existing top-level QWidget subclass can keep its direct layout when its
base class changes to ModernWindow. The standard QWidget(parent, f)
constructor shape and window flags are preserved:
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QLabel, QVBoxLayout
from pyside6_modern_widgets import ModernWindow
class ToolWindow(ModernWindow):
def __init__(self, parent=None):
super().__init__(parent, Qt.WindowType.Tool)
layout = QVBoxLayout(self)
layout.addWidget(QLabel("Tool content"))
Use either a layout installed directly on ModernWindow or its optional
menuBar(), addToolBar(), statusBar(), and setCentralWidget() compatibility
APIs. The two layout models intentionally cannot be mixed in one window.
ModernDialog accepts ordinary Qt layouts directly and retains exec(),
accept(), reject(), and the standard dialog result codes:
from PySide6.QtWidgets import QDialogButtonBox, QLabel, QVBoxLayout
from pyside6_modern_widgets import ModernDialog
dialog = ModernDialog(window)
dialog.setWindowTitle("Settings")
layout = QVBoxLayout(dialog)
layout.addWidget(QLabel("Dialog content"))
buttons = QDialogButtonBox(
QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel
)
buttons.accepted.connect(dialog.accept)
buttons.rejected.connect(dialog.reject)
layout.addWidget(buttons)
dialog.exec()
ModernMessageBox provides the common information, question, warning, and
critical flows while returning QMessageBox-compatible standard buttons:
from pyside6_modern_widgets import ModernMessageBox
answer = ModernMessageBox.question(
window,
"Confirm",
"Continue with this operation?",
ModernMessageBox.StandardButton.Yes | ModernMessageBox.StandardButton.No,
ModernMessageBox.StandardButton.No,
)
ModernMenu accepts the same common constructor forms as QMenu and works
with ordinary QAction instances, separators, checkable actions, and submenus:
from PySide6.QtGui import QAction
from pyside6_modern_widgets import ModernMenu
menu = ModernMenu("Actions", window)
menu.addAction(QAction("Open", menu))
menu.addSeparator()
menu.addMenu("Recent")
Themes
Widgets use a modern theme colored from the current desktop wallpaper through the process-wide theme manager. Widgets following the global theme update automatically after a wallpaper change. The watcher responds directly to changes in the current image file and performs a lightweight path and metadata check every second for wallpaper switches; image sampling only runs after a change is detected.
from pyside6_modern_widgets import theme_manager
theme_manager().setFollowsSystemTheme(True)
Following the system theme switches the readable semantic colors between light
and dark while retaining colors extracted from the wallpaper. If the wallpaper
cannot be read, the surface falls back to its built-in modern colors. Layout
metrics can be customized with ModernMetrics without modifying component
internals. theme_manager().refreshWallpaperTheme() remains available for an
immediate manual refresh when needed.
TabView uses the standard Qt argument order: addTab(widget, text) or
addTab(widget, icon, text). The former reverse (widget, text, icon) order is
not supported.
The runnable navigation example includes interactive window, dialog, and message
box pages. A separate multi-tab example is also available in the
examples directory.
NavigationView automatically uses an overlay sidebar when expanding it beside
the current page would compress the page below its minimum width. A small
hysteresis margin prevents repeated mode changes near that width. On return to
the side-by-side layout, it restores the expand/collapse intent last selected
with the sidebar toggle. Overlay mode starts with its sidebar collapsed.
Applications with a custom responsive policy can call
setAutoSidebarOverlay(False) and control the mode with setSidebarOverlay().
ModernWindow intentionally remains based on QWidget, so it is suitable for
top-level primary and auxiliary windows. Its compatibility surface is limited to the common
menuBar(), addToolBar(), statusBar(), and setCentralWidget() methods; it does
not implement QMainWindow docking or state-management features.
The bundled window and navigation icons are provided by Icons8 and remain subject to the Icons8 license.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyside6_modern_widgets-0.5.0.tar.gz.
File metadata
- Download URL: pyside6_modern_widgets-0.5.0.tar.gz
- Upload date:
- Size: 75.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b700ec33f017af31f3d1641659e31096780705492bb7805b2c5248198a836312
|
|
| MD5 |
fa7ff436255660a3af1157b7b168d266
|
|
| BLAKE2b-256 |
c78aafc34eb1dac50be2abce2da45d50db64b86bd4c642c477bdffa56829be24
|
Provenance
The following attestation bundles were made for pyside6_modern_widgets-0.5.0.tar.gz:
Publisher:
publish.yml on zero-ljz/pyside6-modern-widgets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyside6_modern_widgets-0.5.0.tar.gz -
Subject digest:
b700ec33f017af31f3d1641659e31096780705492bb7805b2c5248198a836312 - Sigstore transparency entry: 2790571609
- Sigstore integration time:
-
Permalink:
zero-ljz/pyside6-modern-widgets@b08584000caee8540ba9f9c3b5b23812e06afd1c -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/zero-ljz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b08584000caee8540ba9f9c3b5b23812e06afd1c -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyside6_modern_widgets-0.5.0-py3-none-any.whl.
File metadata
- Download URL: pyside6_modern_widgets-0.5.0-py3-none-any.whl
- Upload date:
- Size: 72.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd82cbdabf4bdcf9586814f8b1fdd76a2d2553bd94970814610b246e5a502350
|
|
| MD5 |
4de3036e6d8b3581e1d1d96473110d9f
|
|
| BLAKE2b-256 |
43abb21d596d9033cf8ee46a5cca1ce2b9552e1fc4748a63f8d44ab98674997a
|
Provenance
The following attestation bundles were made for pyside6_modern_widgets-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on zero-ljz/pyside6-modern-widgets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyside6_modern_widgets-0.5.0-py3-none-any.whl -
Subject digest:
cd82cbdabf4bdcf9586814f8b1fdd76a2d2553bd94970814610b246e5a502350 - Sigstore transparency entry: 2790571637
- Sigstore integration time:
-
Permalink:
zero-ljz/pyside6-modern-widgets@b08584000caee8540ba9f9c3b5b23812e06afd1c -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/zero-ljz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b08584000caee8540ba9f9c3b5b23812e06afd1c -
Trigger Event:
release
-
Statement type: