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

Column width INTENT — the source of truth the strip stores. More...

#include <PhosphorScrollEngine/ScrollTypes.h>

Public Types

enum  Kind : int { Proportion = 0 , Fixed = 1 , Preset = 2 }

Public Member Functions

bool operator== (const ColumnWidth &other) const

Static Public Member Functions

static constexpr ColumnWidth makeProportion (qreal p)
static constexpr ColumnWidth makeFixed (int px)
static constexpr ColumnWidth makePreset (qreal fraction)

Public Attributes

Kind kind = Proportion
qreal proportion = 0.5
 Kind::Proportion.
int fixedPx = 0
 Kind::Fixed.
qreal presetFraction = 0.5
 Kind::Preset.

Detailed Description

Column width INTENT — the source of truth the strip stores.

Pixel rects are recomputed from this on every relayout against the current work area; pixels are never authoritative.

Member Enumeration Documentation

◆ Kind

Enumerator
Proportion 

Fraction of the work area's MAIN extent.

Proportions account for the inter-column gap: 0.5 + 0.5 tile edge-to-edge with one gap between.

Fixed 

Absolute pixel MAIN extent.

Preset 

Fraction ANCHOR snapped to the nearest entry of the screen's effective preset list at relayout.

Value-anchored (not an index) so the intent survives vocabulary changes: a template swap reflows the column onto the nearest new entry, clearing the template restores the original width, and a cross-screen move needs no remap. Cycling steps between vocabulary entries and writes the NEW entry's value as the anchor.

Member Function Documentation

◆ makeFixed()

constexpr ColumnWidth PhosphorScrollEngine::ColumnWidth::makeFixed ( int px)
inlinestaticconstexpr

◆ makePreset()

constexpr ColumnWidth PhosphorScrollEngine::ColumnWidth::makePreset ( qreal fraction)
inlinestaticconstexpr

◆ makeProportion()

constexpr ColumnWidth PhosphorScrollEngine::ColumnWidth::makeProportion ( qreal p)
inlinestaticconstexpr

◆ operator==()

bool PhosphorScrollEngine::ColumnWidth::operator== ( const ColumnWidth & other) const
inline

Member Data Documentation

◆ fixedPx

int PhosphorScrollEngine::ColumnWidth::fixedPx = 0

◆ kind

Kind PhosphorScrollEngine::ColumnWidth::kind = Proportion

◆ presetFraction

qreal PhosphorScrollEngine::ColumnWidth::presetFraction = 0.5

◆ proportion

qreal PhosphorScrollEngine::ColumnWidth::proportion = 0.5

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