Advanced PySide6 docking system
Project description
Lace
Advanced docking system for PySide6 โ a feature-rich, themeable widget layout framework for building professional Qt desktop applications in Python.
Version: 0.2.5
Table of Contents
Features
๐ช Docking & Layout
- Multi-area docking โ Dock widgets to left, right, top, bottom, or center regions within a window
- Tabbed dock areas โ Multiple widgets share a single dock area as tabs, with full tab management (reorder, close, float)
- Floating windows โ Detach any dock widget into its own top-level window; drag it back to dock
- Drag-and-drop layout โ Intuitive resize, re-order, and re-dock via visual drop indicators
- Nested splitters โ Arbitrary nesting of horizontal and vertical split panes
- Maximize/restore โ Expand any dock area to fill its container
๐ Sidebars
- Auto-hide panels โ VS Code-style slide-out sidebars that appear on hover
- Pinned widgets โ Pin dock widgets to sidebars with visual tab buttons
- Notification badges โ Numerical or symbolic badges on sidebar tabs
- Configurable focus behavior โ Choose whether sidebars steal keyboard focus
- Drag to detach โ Tear pinned widgets out of sidebars back into the main layout
๐จ Theming
- 14 built-in themes โ Dark, light, midnight, warm, nordic, monokai, neutral, tokyo_night, catppuccin, dracula, solarized_dark/light, and cyberpunk_neon
- Declarative
ThemeSpecโ Define custom themes with color palettes and geometrical tokens (corner radius, border width, title height, tab radius, content margin, etc.) - Reactive borders โ Active dock area shows a vibrant focus border; inactive areas show a subtle neutral border
- OS auto-sync โ Automatically switch between light/dark themes when the OS changes
- Custom QSS/stylesheet support โ Point themes to external
.qssor.cssfiles
โ๏ธ Configuration
- 16 global flags โ Control tab visibility, button visibility, drag behavior, floating window chrome, icon styling, and more
- Per-widget feature flags โ Granular control over what each dock widget can do: closable, movable, floatable, pinnable
- Insertion order โ Sort "Show View" menu items alphabetically or chronologically
- Toggle view actions โ Integrate dock widget show/hide into menu bars or toolbars as checkable toggles or one-way show buttons
๐พ Persistence
- JSON layout serialization โ Save and restore complete window layouts to/from JSON files
- Perspectives โ Save named layout presets (e.g., "Coding Mode", "Presentation Mode") and switch between them instantly
- Atomic file I/O โ Layouts are written atomically (temp file + rename) to prevent corruption
๐ฏ Icons & Chrome
- SVG-based icon system โ Theme-aware SVG icons with automatic color tinting
- Custom icon provider โ Register a directory of SVG icons for use across tabs and menus
- Painted chrome โ Custom-drawn title bars, tab buttons, splitter handles, and drop indicators with rounded corners and hover states
- Chromeless floating windows โ Optional frameless floating windows that rely entirely on Lace's custom title bar
Quick Start
Installation
pip install pyside6
# Clone Lace
git clone https://github.com/yourusername/lace.git
cd lace
Minimal Example
import sys
from PySide6.QtWidgets import QApplication, QMainWindow, QTextEdit
from lace import DockManager, DockWidget, DockWidgetArea, apply_dock_theme
app = QApplication(sys.argv)
app.setStyle("Fusion")
window = QMainWindow()
window.setWindowTitle("My App")
window.resize(1200, 800)
# Create the dock manager
dock_manager = DockManager(window)
window.setCentralWidget(dock_manager._root)
# Apply a theme
apply_dock_theme("cyberpunk_neon")
# Add a dock widget
editor = DockWidget("Editor", window)
editor.set_widget(QTextEdit())
editor.set_features(DockWidgetFeature.all_features)
dock_manager.add_dock_widget(DockWidgetArea.center, editor)
window.show()
app.exec()
Full Example
Run the demo application to explore all features:
python demo_app.py
The demo includes:
- Multiple dock widgets with different feature flags (closable, movable, floatable, pinnable)
- Sidebar setup with notification badges
- Theme switching menu with 14 built-in themes
- Global flags menu for live configuration toggling
- Insertion order control
- Sidebar focus mode and badge position controls
- Preset configurations (Default, Minimal, Full)
Screenshots
Screenshots coming soon โ add images of your application running with different themes.
Architecture Overview
Lace is built around a clean, modular architecture:
DockManager (facade)
โโโ DockContainerWidget (root + floating windows)
โ โโโ DockSplitter (nested, orientation-aware)
โ โโโ DockAreaWidget (tabbed regions)
โ โโโ DockAreaTitleBar
โ โ โโโ DockAreaTabBar โ DockWidgetTab (รN)
โ โโโ DockWidget โ user content (QTextEdit, QWidget, etc.)
โโโ SidebarManager (auto-hide panels)
โ โโโ SideTabBar โ VerticalTabButton (รN)
โ โโโ SideBarContainer (overlay panel)
โโโ LayoutSerializer (JSON persistence)
โโโ DockStyleManager (theme engine)
โโโ DockThemeBridge (QPalette โ Qt children)
โโโ ThemeManager (OS-aware auto light/dark)
See the Architecture Documentation for a complete module-by-module reference with class hierarchies, signals, and method tables.
Documentation
| Document | Description |
|---|---|
| Quick Reference | 5-minute guide โ installation, common patterns, API lookup |
| Architecture | Complete system architecture โ all modules, classes, signals, and data flow |
| Theming & Geometry | ThemeSpec tokens, titlebar flushness, reactive borders, content margin |
| Enum Mapping | Comprehensive mapping of all enumerations and flags with wiring status |
Project Structure
lace/
โโโ lace/ # Main package
โ โโโ dock_manager.py # Central orchestrator (facade)
โ โโโ dock_widget.py # User-facing dock widget wrapper
โ โโโ dock_widget_tab.py # Painted-chrome tab button
โ โโโ dock_container_widget.py # Root + floating container
โ โโโ dock_area_widget.py # Single tabbed region
โ โโโ dock_splitter.py # Nested splitters + resize handles
โ โโโ floating_dock_container.py # Top-level floating window
โ โโโ dock_overlay.py # Drop-target visual overlays
โ โโโ dock_chrome.py # Drag detector, chrome buttons, frames
โ โโโ dock_paint.py # Painting primitives
โ โโโ dock_theme.py # Theme schemas, ThemeSpec, color math
โ โโโ dock_custom_theme.py # 14 built-in theme presets
โ โโโ dock_style_manager.py # Singleton style manager (subscriber model)
โ โโโ dock_theme_bridge.py # QPalette push to Qt children
โ โโโ theme_manager.py # OS-aware auto dark/light switching
โ โโโ layout_serializer.py # JSON save/restore, perspectives
โ โโโ dock_container_state.py # Low-level tree state save/restore
โ โโโ dock_signals.py # Internal event bus
โ โโโ dock_menu.py # Unified context menu system
โ โโโ dock_styled.py # DockStyled mixin (auto-style registration)
โ โโโ dock_icon_provider.py # SVG icon provider with tinting
โ โโโ sidebar_manager.py # Auto-hide sidebar controller
โ โโโ sidebar_tab.py # Vertical tab button
โ โโโ sidebar_tab_bar.py # Vertical tab strip
โ โโโ sidebar_container.py # Animated overlay panel
โ โโโ sidebar_title_bar.py # Title bar inside overlay panel
โ โโโ sidebar_state.py # Sidebar state compatibility shim
โ โโโ eliding_label.py # QLabel with text elision
โ โโโ enums.py # All enumerations and flags
โ โโโ util.py # Utility functions
โ โโโ _trace.py # Optional debug tracing
โโโ demo_app.py # Full-featured demo application
โโโ dev_smoke/ # Smoke tests for individual features
โโโ docs/ # Documentation
โโโ lace/resources/lace_icons/ # SVG icons (close, dock, float, pin, etc.)
โโโ LICENSE # Apache-2.0
โโโ README.md # This file
Contributing
Contributions are welcome! Please:
- Open an issue to discuss significant changes before starting work
- Follow the existing code style and naming conventions
- Add smoke tests in
dev_smoke/for new features - Update documentation (
docs/) for user-facing changes
License
Lace is licensed under the Apache License 2.0. See LICENSE for details.
This project incorporates components from qtpydocking under the BSD 3-Clause License. See LICENSE for full attribution.
Author: opticsWolf
Contact: opticswolf@protonmail.com
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
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 lace_dock-0.2.5.tar.gz.
File metadata
- Download URL: lace_dock-0.2.5.tar.gz
- Upload date:
- Size: 133.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff9842c8c70640d85e161c9539aa9daa4900f7d5bcb137fab596bf0a35f5d11e
|
|
| MD5 |
8260baaecd6f10b6d6395a4d025878b8
|
|
| BLAKE2b-256 |
b1be134489cd1d14afbd2d81f5bf7c8623d292dca5c273bfbee7aedf16db51cc
|
Provenance
The following attestation bundles were made for lace_dock-0.2.5.tar.gz:
Publisher:
publish.yml on opticsWolf/Lace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lace_dock-0.2.5.tar.gz -
Subject digest:
ff9842c8c70640d85e161c9539aa9daa4900f7d5bcb137fab596bf0a35f5d11e - Sigstore transparency entry: 2299649833
- Sigstore integration time:
-
Permalink:
opticsWolf/Lace@5ad6fe27b3928cba76c2b1b9e2e61aa865f24c1e -
Branch / Tag:
refs/tags/v0.2.5 - Owner: https://github.com/opticsWolf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5ad6fe27b3928cba76c2b1b9e2e61aa865f24c1e -
Trigger Event:
push
-
Statement type:
File details
Details for the file lace_dock-0.2.5-py3-none-any.whl.
File metadata
- Download URL: lace_dock-0.2.5-py3-none-any.whl
- Upload date:
- Size: 156.6 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 |
38cef93064a2731eef077033304328ef4d103b41c79f0022890a322a3430e778
|
|
| MD5 |
f0e201240ebb699b25bbdee9e6be30f6
|
|
| BLAKE2b-256 |
d16a16768f14dcdd638ec5085487032c085415e5e5222888b7d5d0a3eb51a4cc
|
Provenance
The following attestation bundles were made for lace_dock-0.2.5-py3-none-any.whl:
Publisher:
publish.yml on opticsWolf/Lace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lace_dock-0.2.5-py3-none-any.whl -
Subject digest:
38cef93064a2731eef077033304328ef4d103b41c79f0022890a322a3430e778 - Sigstore transparency entry: 2299649853
- Sigstore integration time:
-
Permalink:
opticsWolf/Lace@5ad6fe27b3928cba76c2b1b9e2e61aa865f24c1e -
Branch / Tag:
refs/tags/v0.2.5 - Owner: https://github.com/opticsWolf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5ad6fe27b3928cba76c2b1b9e2e61aa865f24c1e -
Trigger Event:
push
-
Statement type: