Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorTileEngine::AutotileConfig Struct Reference

Configuration for autotiling behavior. More...

#include <phosphor-tile-engine/include/PhosphorTileEngine/AutotileConfig.h>

Public Types

using InsertPosition = PhosphorTiles::AutotileInsertPosition
 

Public Member Functions

bool operator== (const AutotileConfig &other) const
 
bool operator!= (const AutotileConfig &other) const
 
QJsonObject toJson () const
 Serialize to JSON.
 

Static Public Member Functions

static QHash< QString, AlgorithmSettingsperAlgoFromVariantMap (const QVariantMap &map)
 Convert per-algorithm settings from QVariantMap (Settings layer) to internal hash.
 
static QVariantMap perAlgoToVariantMap (const QHash< QString, AlgorithmSettings > &hash)
 Convert internal hash to QVariantMap for the Settings layer.
 
static AutotileConfig fromJson (const QJsonObject &json)
 Deserialize from JSON.
 
static AutotileConfig defaults ()
 Get default configuration.
 

Public Attributes

QString algorithmId = PhosphorTiles::AutotileDefaults::DefaultAlgorithmId
 ID of the tiling algorithm to use.
 
qreal splitRatio = PhosphorTiles::AutotileDefaults::DefaultSplitRatio
 Ratio of screen width for master area.
 
qreal splitRatioStep = PhosphorTiles::AutotileDefaults::DefaultSplitRatioStep
 
int masterCount = PhosphorTiles::AutotileDefaults::DefaultMasterCount
 Number of windows in master area.
 
QHash< QString, AlgorithmSettingssavedAlgorithmSettings
 Per-algorithm saved settings (split ratio + master count).
 
int innerGap = PhosphorTiles::AutotileDefaults::DefaultInnerGap
 Gap between tiled windows in pixels.
 
int outerGap = PhosphorTiles::AutotileDefaults::DefaultOuterGap
 Gap from screen edges in pixels (uniform)
 
bool usePerSideOuterGap = false
 Whether to use per-side outer gaps instead of uniform.
 
int outerGapTop = PhosphorTiles::AutotileDefaults::DefaultOuterGap
 Per-side outer gap values (used when usePerSideOuterGap is true)
 
int outerGapBottom = PhosphorTiles::AutotileDefaults::DefaultOuterGap
 
int outerGapLeft = PhosphorTiles::AutotileDefaults::DefaultOuterGap
 
int outerGapRight = PhosphorTiles::AutotileDefaults::DefaultOuterGap
 
InsertPosition insertPosition = InsertPosition::End
 
bool focusFollowsMouse = false
 Focus follows mouse pointer.
 
bool focusNewWindows = true
 Automatically focus newly opened windows.
 
bool smartGaps = true
 Hide gaps when only one window is tiled.
 
bool respectMinimumSize = true
 Respect window minimum size constraints.
 
int maxWindows = PhosphorTiles::AutotileDefaults::DefaultMaxWindows
 Maximum number of windows to tile.
 
PhosphorTiles::AutotileOverflowBehavior overflowBehavior = PhosphorTiles::AutotileOverflowBehavior::Float
 Overflow behavior when window count exceeds maxWindows.
 

Detailed Description

Configuration for autotiling behavior.

AutotileConfig holds all user-configurable options for automatic window tiling. This includes algorithm selection, gaps, master settings, and focus behavior.

This is a value type (not QObject) for easy copying and comparison. It can be stored per-layout or as global defaults.

Note
Default values are sourced from PhosphorTiles::AutotileDefaults::* constants, which delegate to PhosphorTiles::AutotileDefaults for the algorithm constants. Do not hand-mirror values here — keep the delegation chain intact so library and config defaults stay in lock-step.

Member Typedef Documentation

◆ InsertPosition

Member Function Documentation

◆ defaults()

static AutotileConfig PhosphorTileEngine::AutotileConfig::defaults ( )
static

Get default configuration.

◆ fromJson()

static AutotileConfig PhosphorTileEngine::AutotileConfig::fromJson ( const QJsonObject &  json)
static

Deserialize from JSON.

◆ operator!=()

bool PhosphorTileEngine::AutotileConfig::operator!= ( const AutotileConfig other) const

◆ operator==()

bool PhosphorTileEngine::AutotileConfig::operator== ( const AutotileConfig other) const

◆ perAlgoFromVariantMap()

static QHash< QString, AlgorithmSettings > PhosphorTileEngine::AutotileConfig::perAlgoFromVariantMap ( const QVariantMap &  map)
static

Convert per-algorithm settings from QVariantMap (Settings layer) to internal hash.

◆ perAlgoToVariantMap()

static QVariantMap PhosphorTileEngine::AutotileConfig::perAlgoToVariantMap ( const QHash< QString, AlgorithmSettings > &  hash)
static

Convert internal hash to QVariantMap for the Settings layer.

◆ toJson()

QJsonObject PhosphorTileEngine::AutotileConfig::toJson ( ) const

Serialize to JSON.

Member Data Documentation

◆ algorithmId

QString PhosphorTileEngine::AutotileConfig::algorithmId = PhosphorTiles::AutotileDefaults::DefaultAlgorithmId

ID of the tiling algorithm to use.

Common values: "master-stack", "bsp", "columns", "dwindle", "spiral", "monocle" See PhosphorTiles::AlgorithmRegistry for available algorithms.

◆ focusFollowsMouse

bool PhosphorTileEngine::AutotileConfig::focusFollowsMouse = false

Focus follows mouse pointer.

When true, moving mouse over a window focuses it. Default: false (click to focus)

◆ focusNewWindows

bool PhosphorTileEngine::AutotileConfig::focusNewWindows = true

Automatically focus newly opened windows.

Default: true

◆ innerGap

int PhosphorTileEngine::AutotileConfig::innerGap = PhosphorTiles::AutotileDefaults::DefaultInnerGap

Gap between tiled windows in pixels.

Range: 0 to 50 Default: 8

◆ insertPosition

InsertPosition PhosphorTileEngine::AutotileConfig::insertPosition = InsertPosition::End

◆ masterCount

int PhosphorTileEngine::AutotileConfig::masterCount = PhosphorTiles::AutotileDefaults::DefaultMasterCount

Number of windows in master area.

Range: 1 to 5 Default: 1

◆ maxWindows

int PhosphorTileEngine::AutotileConfig::maxWindows = PhosphorTiles::AutotileDefaults::DefaultMaxWindows

Maximum number of windows to tile.

Windows beyond this limit are not repositioned by the tiling algorithm. Range: 1 to 12 Default: 6

◆ outerGap

int PhosphorTileEngine::AutotileConfig::outerGap = PhosphorTiles::AutotileDefaults::DefaultOuterGap

Gap from screen edges in pixels (uniform)

Range: 0 to 50 Default: 8

◆ outerGapBottom

int PhosphorTileEngine::AutotileConfig::outerGapBottom = PhosphorTiles::AutotileDefaults::DefaultOuterGap

◆ outerGapLeft

int PhosphorTileEngine::AutotileConfig::outerGapLeft = PhosphorTiles::AutotileDefaults::DefaultOuterGap

◆ outerGapRight

int PhosphorTileEngine::AutotileConfig::outerGapRight = PhosphorTiles::AutotileDefaults::DefaultOuterGap

◆ outerGapTop

int PhosphorTileEngine::AutotileConfig::outerGapTop = PhosphorTiles::AutotileDefaults::DefaultOuterGap

Per-side outer gap values (used when usePerSideOuterGap is true)

◆ overflowBehavior

PhosphorTiles::AutotileOverflowBehavior PhosphorTileEngine::AutotileConfig::overflowBehavior = PhosphorTiles::AutotileOverflowBehavior::Float

Overflow behavior when window count exceeds maxWindows.

Float (default): auto-float excess windows via OverflowManager. Unlimited: ignore the cap and tile every window — the effectiveMaxWindows path returns PhosphorTiles::AutotileDefaults::UnlimitedMaxWindowsSentinel so the std::min clamp in recalculateLayout becomes idempotent and onWindowAdded's gate is always open. A per-screen MaxWindows override (if present) still wins over Unlimited so users can clamp individual screens.

Serialization note: AutotileConfig (layout-attached) writes this field as a string token ("float" / "unlimited") in toJson/fromJson so the layout JSON survives schema rewrites. The user-facing Settings layer persists the same logical setting as an int under Tiling.Behavior/OverflowBehavior (see settings/loadsave.cpp). Both paths flow through the AutotileOverflowBehavior C++ enum, so the asymmetry is internal — but worth knowing before touching either side.

◆ respectMinimumSize

bool PhosphorTileEngine::AutotileConfig::respectMinimumSize = true

Respect window minimum size constraints.

When true, windows won't be resized smaller than their minimum. This may cause layout to not fill screen completely.

◆ savedAlgorithmSettings

QHash<QString, AlgorithmSettings> PhosphorTileEngine::AutotileConfig::savedAlgorithmSettings

Per-algorithm saved settings (split ratio + master count).

Saved when switching away from an algorithm, restored when switching back. Key: algorithm ID (e.g. "master-stack", "centered-master", "script:deck")

◆ smartGaps

bool PhosphorTileEngine::AutotileConfig::smartGaps = true

Hide gaps when only one window is tiled.

Single window uses full available screen space.

◆ splitRatio

qreal PhosphorTileEngine::AutotileConfig::splitRatio = PhosphorTiles::AutotileDefaults::DefaultSplitRatio

Ratio of screen width for master area.

Range: 0.1 to 0.9 Default: 0.6 (60% master, 40% stack)

◆ splitRatioStep

qreal PhosphorTileEngine::AutotileConfig::splitRatioStep = PhosphorTiles::AutotileDefaults::DefaultSplitRatioStep

◆ usePerSideOuterGap

bool PhosphorTileEngine::AutotileConfig::usePerSideOuterGap = false

Whether to use per-side outer gaps instead of uniform.


The documentation for this struct was generated from the following file: