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

Inputs a relayout resolves pixel rects against. More...

#include <PhosphorScrollEngine/ScrollTypes.h>

Public Attributes

QRect workArea
QRect rawWorkArea
 The screen's available geometry BEFORE the outer-gap shrink and the smart-gaps zeroing — still strut-adjusted, so panels stay respected.
int gap = 0
StripAxis axis = StripAxis::horizontal()
 Which way this screen's strip runs.
QList< qreal > presetColumnWidths {1.0 / 3.0, 0.5, 2.0 / 3.0, 0.75, 1.0}
 Preset proportion lists (the niri 1/3, 1/2, 2/3 plus 3/4 and full).
QList< qreal > presetWindowHeights {1.0 / 3.0, 0.5, 2.0 / 3.0, 0.75, 1.0}
CenterFocusedColumn centerFocusedColumn = CenterFocusedColumn::Never
bool alwaysCenterSingleColumn = false
bool respectMinimumSize = true
 Whether the strip's layout math honours windows' minimum frame sizes (the column MAIN floor, the tile CROSS floor and its rebalance, and the interactive-resize floor), and with them the extents a client's own commits hold its column and its tile to (committedFloor and committedCrossFloor below) and the peek floor that memory raises.
bool centerShortColumns = false
 Whether a column whose visible tiles resolve to less than the column's own CROSS extent is centred on that axis instead of hugging the start edge.
bool cropStraddlers = false
 Whether main-axis straddlers keep their TRUE rect for the effect to crop (true) instead of being clamped at the screen edge.
WindowHeight defaultWindowHeight {}
 The context's default window height intent, seeded onto every fresh-created tile (restore paths overwrite it via setWindowHeightIntent).
ColumnWidth defaultColumnWidth = ColumnWidth::makeProportion(0.5)
 The context's default column width — the un-maximize fallback for a full-MAIN-extent column with no stored pre-maximize intent.
TabIndicatorParams tabIndicator {}
 Geometry inputs for the tab indicator drawn beside a tabbed column.
std::function< QSize(const QString &windowId)> committedFloor
 Per window: the extent along the strip a client's own commits hold its column to (ScrollEngine::reportCommittedSize), read by the strip exactly like the tile's declared minimum along the strip and under the same respectMinimumSize gate.
std::function< int(const QString &windowId)> committedCrossFloor
 Per window: the share of its column ACROSS the strip a client's own commits hold its tile to (ScrollEngine::reportCommittedSize), read by the strip exactly like the tile's declared minimum across the strip, and only under respectMinimumSize.

Detailed Description

Inputs a relayout resolves pixel rects against.

The work area is the screen's available geometry already shrunk by the outer gaps; gap is the inner gap between columns and between tiles in a column.

Member Data Documentation

◆ alwaysCenterSingleColumn

bool PhosphorScrollEngine::ScrollLayoutParams::alwaysCenterSingleColumn = false

◆ axis

StripAxis PhosphorScrollEngine::ScrollLayoutParams::axis = StripAxis::horizontal()

Which way this screen's strip runs.

Resolved per screen in layoutParamsForScreen, so a portrait and a landscape monitor in one session hold different axes at the same time. A resolved axis is never an INPUT to a new layout: resolve it per screen, per pass, from the tri-state setting and the live work area, so a rotation or a monitor swap cannot hand one screen the other's verdict.

RECORDING the axis a past pass resolved is a different thing, and deliberate. ScrollState stamps both lastAppliedAxis (part of the view-delta baseline, which is meaningless without knowing which axis the offset was measured along) and resolvedAxis (what the flip sweep compares against). Those are history, not inputs, and must not be deleted in the name of the rule above.

Defaulted to Horizontal so every existing construction, the test fixtures included, keeps the historical layout with no edit.

◆ centerFocusedColumn

CenterFocusedColumn PhosphorScrollEngine::ScrollLayoutParams::centerFocusedColumn = CenterFocusedColumn::Never

◆ centerShortColumns

bool PhosphorScrollEngine::ScrollLayoutParams::centerShortColumns = false

Whether a column whose visible tiles resolve to less than the column's own CROSS extent is centred on that axis instead of hugging the start edge.

Off (the niri behaviour) a solo window with an explicit Fixed/Preset height sits at the top of its column and the slack is left below it. A column that already fills the cross axis, the all-Auto case included, resolves identically either way.

◆ committedCrossFloor

std::function<int(const QString& windowId)> PhosphorScrollEngine::ScrollLayoutParams::committedCrossFloor

Per window: the share of its column ACROSS the strip a client's own commits hold its tile to (ScrollEngine::reportCommittedSize), read by the strip exactly like the tile's declared minimum across the strip, and only under respectMinimumSize.

Already resolved for this params' axis, so a floor learned across a strip running the other way never reads here. 0 is no floor, and empty (the default) is no floor for any window, like committedFloor.

◆ committedFloor

std::function<QSize(const QString& windowId)> PhosphorScrollEngine::ScrollLayoutParams::committedFloor

Per window: the extent along the strip a client's own commits hold its column to (ScrollEngine::reportCommittedSize), read by the strip exactly like the tile's declared minimum along the strip and under the same respectMinimumSize gate.

Answered as a size whose WIDTH is the floor along a horizontal strip and whose HEIGHT is the floor along a vertical one, so the strip takes axis.mainSize() of it and a floor learned on a strip running the other way never reads as its own. 0 on either axis is no floor. Empty (the default) is no floor for any window, which is what a strip laid out outside an engine gets; the engine sets it on every params it resolves, so the drag-insert probe and every verb read the same floors the apply does.

◆ cropStraddlers

bool PhosphorScrollEngine::ScrollLayoutParams::cropStraddlers = false

Whether main-axis straddlers keep their TRUE rect for the effect to crop (true) instead of being clamped at the screen edge.

Resolved once in layoutParamsForScreen like every other per-screen bool, so the apply path does not fetch the override map a second time per batch for this one value.

◆ defaultColumnWidth

ColumnWidth PhosphorScrollEngine::ScrollLayoutParams::defaultColumnWidth = ColumnWidth::makeProportion(0.5)

The context's default column width — the un-maximize fallback for a full-MAIN-extent column with no stored pre-maximize intent.

◆ defaultWindowHeight

WindowHeight PhosphorScrollEngine::ScrollLayoutParams::defaultWindowHeight {}

The context's default window height intent, seeded onto every fresh-created tile (restore paths overwrite it via setWindowHeightIntent).

Default-constructed = Auto weight 1, the historical even split.

◆ gap

int PhosphorScrollEngine::ScrollLayoutParams::gap = 0

◆ presetColumnWidths

QList<qreal> PhosphorScrollEngine::ScrollLayoutParams::presetColumnWidths {1.0 / 3.0, 0.5, 2.0 / 3.0, 0.75, 1.0}

Preset proportion lists (the niri 1/3, 1/2, 2/3 plus 3/4 and full).

Never empty — resolvers snap a Preset fraction anchor to the nearest entry. KEEP IN SYNC with FOUR other copies, not one:

  1. ScrollEngine::m_presetColumnWidths / m_presetWindowHeights, the member seeds these mirror (ScrollEngine.h);
  2. ScrollEngine::refreshConfigFromSettings' fallback list (engine_core.cpp), the empty-config fallback;
  3. ConfigDefaults' "0.333,0.5,0.667,0.75,1" strings (configdefaults_scrolling.h) — the one a CONFIGURED user actually gets, and the only one expressed in decimal rather than as thirds, so it is already very slightly different by construction;
  4. EditorController::createNewScrollingTemplate's seed for a brand-new template (src/editor/controller/scrollingtemplate.cpp). A template's list REPLACES this one wholesale on the screens it covers, so a stale seed there narrows the cycle rather than diverging quietly. The ops-suite assertion that pins THIS copy is the 800 one in reconcileLoneTileRecordsHeightIntent (test_scrollstrip_ops.cpp): a forward press from 720px only reaches the full-height entry if this list carries it. The neighbouring literal-260 assertion is the wrap-to- shortest answer and stays green under any vocabulary that starts at 1/3, so it pins nothing here. A change to any of the other four copies still leaves the suite green while the running engine shifts.

◆ presetWindowHeights

QList<qreal> PhosphorScrollEngine::ScrollLayoutParams::presetWindowHeights {1.0 / 3.0, 0.5, 2.0 / 3.0, 0.75, 1.0}

◆ rawWorkArea

QRect PhosphorScrollEngine::ScrollLayoutParams::rawWorkArea

The screen's available geometry BEFORE the outer-gap shrink and the smart-gaps zeroing — still strut-adjusted, so panels stay respected.

Only a maximized-to-edges column resolves against it; everything else reads workArea. Clamped to null exactly like workArea when the screen is unknown or removed, so the degenerate-area bails cover both.

◆ respectMinimumSize

bool PhosphorScrollEngine::ScrollLayoutParams::respectMinimumSize = true

Whether the strip's layout math honours windows' minimum frame sizes (the column MAIN floor, the tile CROSS floor and its rebalance, and the interactive-resize floor), and with them the extents a client's own commits hold its column and its tile to (committedFloor and committedCrossFloor below) and the peek floor that memory raises.

Off, the resolved rects obey the user's intents and the compositor's own min-size enforcement decides what overhangs, and no committed extent is learned or read. The work-area-oversized float escape for a DECLARED minimum ignores this flag; the one for a committed extent cannot fire without it, since nothing is learned.

◆ tabIndicator

TabIndicatorParams PhosphorScrollEngine::ScrollLayoutParams::tabIndicator {}

Geometry inputs for the tab indicator drawn beside a tabbed column.

Default-constructed = the family's own defaults, so a caller that never sets it gets an indicator that reserves nothing.

◆ workArea

QRect PhosphorScrollEngine::ScrollLayoutParams::workArea

The documentation for this struct was generated from the following file:
  • phosphor-scroll-engine/include/PhosphorScrollEngine/ScrollTypes.h