Skip to main content

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

PyPI License Publish to PyPI Python Framework


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 .qss or .css files

โš™๏ธ 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:

  1. Open an issue to discuss significant changes before starting work
  2. Follow the existing code style and naming conventions
  3. Add smoke tests in dev_smoke/ for new features
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lace_dock-0.2.5.tar.gz (133.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lace_dock-0.2.5-py3-none-any.whl (156.6 kB view details)

Uploaded Python 3

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

Hashes for lace_dock-0.2.5.tar.gz
Algorithm Hash digest
SHA256 ff9842c8c70640d85e161c9539aa9daa4900f7d5bcb137fab596bf0a35f5d11e
MD5 8260baaecd6f10b6d6395a4d025878b8
BLAKE2b-256 b1be134489cd1d14afbd2d81f5bf7c8623d292dca5c273bfbee7aedf16db51cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for lace_dock-0.2.5.tar.gz:

Publisher: publish.yml on opticsWolf/Lace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for lace_dock-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 38cef93064a2731eef077033304328ef4d103b41c79f0022890a322a3430e778
MD5 f0e201240ebb699b25bbdee9e6be30f6
BLAKE2b-256 d16a16768f14dcdd638ec5085487032c085415e5e5222888b7d5d0a3eb51a4cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for lace_dock-0.2.5-py3-none-any.whl:

Publisher: publish.yml on opticsWolf/Lace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page