Skip to content

opticsWolf/Lace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

90 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

License 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

About

Advanced PySide6 docking system

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors