Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
ScrollTypes.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
7
8#include <QList>
9#include <QRect>
10#include <QSize>
11#include <QString>
12#include <QVector>
13
14#include <functional>
15#include <optional>
16
17namespace PhosphorScrollEngine {
18
24inline QString centerFocusedColumn()
25{
26 return QStringLiteral("CenterFocusedColumn");
27}
28
40inline QString stripAxis()
41{
42 return QStringLiteral("StripAxis");
43}
44
47inline QString defaultColumnWidth()
48{
49 return QStringLiteral("DefaultColumnWidth");
50}
51inline QString defaultColumnDisplay()
52{
53 return QStringLiteral("DefaultColumnDisplay");
54}
55
58inline QString defaultColumnWidthKind()
59{
60 return QStringLiteral("DefaultColumnWidthKind");
61}
63{
64 return QStringLiteral("DefaultColumnWidthValue");
65}
67{
68 return QStringLiteral("DefaultColumnWidthPresetIndex");
69}
70
72inline QString defaultWindowHeight()
73{
74 return QStringLiteral("DefaultWindowHeight");
75}
76
78{
79 return QStringLiteral("DefaultWindowHeightKind");
80}
82{
83 return QStringLiteral("DefaultWindowHeightValue");
84}
86{
87 return QStringLiteral("DefaultWindowHeightPresetIndex");
88}
89
92inline QString insertPosition()
93{
94 return QStringLiteral("InsertPosition");
95}
96
103{
104 return QStringLiteral("AlwaysCenterSingleColumn");
105}
106inline QString centerShortColumns()
107{
108 return QStringLiteral("CenterShortColumns");
109}
110inline QString respectMinimumSize()
111{
112 return QStringLiteral("RespectMinimumSize");
113}
114inline QString cropStraddlers()
115{
116 return QStringLiteral("CropStraddlers");
117}
118inline QString focusNewWindows()
119{
120 return QStringLiteral("FocusNewWindows");
121}
122inline QString smartGaps()
123{
124 return QStringLiteral("SmartGaps");
125}
126
127inline QString stickyWindowHandling()
128{
129 return QStringLiteral("StickyWindowHandling");
130}
131
136inline QString tabIndicatorEnabled()
137{
138 return QStringLiteral("TabIndicatorEnabled");
139}
141{
142 return QStringLiteral("TabIndicatorHideWhenSingleTab");
143}
145{
146 return QStringLiteral("TabIndicatorPlaceWithinColumn");
147}
148inline QString tabIndicatorGap()
149{
150 return QStringLiteral("TabIndicatorGap");
151}
152inline QString tabIndicatorWidth()
153{
154 return QStringLiteral("TabIndicatorWidth");
155}
157{
158 return QStringLiteral("TabIndicatorLengthProportion");
159}
160inline QString tabIndicatorPosition()
161{
162 return QStringLiteral("TabIndicatorPosition");
163}
164
170inline QString presetColumnWidths()
171{
172 return QStringLiteral("PresetColumnWidths");
173}
174inline QString presetWindowHeights()
175{
176 return QStringLiteral("PresetWindowHeights");
177}
178
196inline QString templateColumns()
197{
198 return QStringLiteral("TemplateColumns");
199}
200inline QString templateColumnWidth()
201{
202 return QStringLiteral("width");
203}
204inline QString templateColumnDisplay()
205{
206 return QStringLiteral("display");
207}
208} // namespace ScrollPerScreenKeys
209
220inline constexpr qreal MinColumnWidthFraction = 0.05;
221
230inline constexpr qreal MinWindowHeightFraction = 0.05;
231
234enum class CenterFocusedColumn : int {
237 Never = 0,
243};
244
246enum class ColumnDisplay : int {
259};
260
274{
275 int total = 0;
276 int used = 0;
277
278 bool operator==(const ScrollBlueprintProgress&) const = default;
279};
280
287enum class TabIndicatorPosition : int {
288 Left = 0,
289 Right = 1,
290 Top = 2,
292};
293
298{
299 return position == TabIndicatorPosition::Left || position == TabIndicatorPosition::Right;
300}
301
310{
314 bool enabled = true;
318 bool hideWhenSingleTab = false;
322 bool placeWithinColumn = false;
335 int gap = 5;
343 int width = 4;
346 qreal lengthProportion = 0.5;
348
364 int reservedThickness(int tileCount) const
365 {
366 if (!placeWithinColumn || !resolvesFor(tileCount)) {
367 return 0;
368 }
369 // qMax(1, width), matching indicatorRectFor's thickness exactly. Using
370 // the raw width here would let an embedder-supplied width below 1
371 // reserve one number and draw another, so the visual gap would not be
372 // the configured one.
373 return qMax(0, qMax(1, width) + gap);
374 }
375
377 bool resolvesFor(int tileCount) const
378 {
379 return enabled && tileCount > 0 && !(hideWhenSingleTab && tileCount <= 1);
380 }
381
385 QRect contentRectFor(const QRect& columnRect, int tileCount) const
386 {
387 const int reserved = reservedThickness(tileCount);
388 if (reserved <= 0) {
389 return columnRect;
390 }
391 QRect content = columnRect;
392 switch (position) {
394 content.setX(columnRect.x() + reserved);
395 break;
397 content.setWidth(columnRect.width() - reserved);
398 break;
400 content.setY(columnRect.y() + reserved);
401 break;
403 content.setHeight(columnRect.height() - reserved);
404 break;
405 }
406 // A column narrower/shorter than its own reservation would invert.
407 // Hand back the untouched column instead: an indicator is worth less
408 // than a renderable window, and the drawn rect below stays put so the
409 // two simply overlap, which is the same thing a negative gap does.
410 return content.isValid() ? content : columnRect;
411 }
412
421 QRect indicatorRectFor(const QRect& columnRect, int tileCount) const
422 {
423 if (!resolvesFor(tileCount)) {
424 return QRect();
425 }
426 const int thickness = qMax(1, width);
427 const bool vertical = isVerticalTabIndicator(position);
428 const int axisExtent = vertical ? columnRect.height() : columnRect.width();
429 // Empty-first, the same guard contentRectFor and the preset resolvers
430 // take: qBound asserts on an inverted range, and a zero-extent column
431 // gives min 1 against max 0. There is nothing to draw an indicator on
432 // in that case anyway.
433 if (axisExtent <= 0) {
434 return QRect();
435 }
436 // Floor at 1: a proportion small enough to round to nothing would make
437 // the indicator vanish while every setting still says it is on.
438 const int length = qBound(1, qRound(axisExtent * lengthProportion), axisExtent);
439 const int longOffset = (axisExtent - length) / 2;
440
441 // Offset of the indicator's near edge from the column's matching edge,
442 // measured OUTWARD; negative means inward, over the window.
443 //
444 // Outside the column the gap is pure placement, so it moves the
445 // indicator one-for-one and a negative gap slides it onto the window.
446 //
447 // WITHIN the column the gap is spent on the reservation instead, and
448 // the indicator sits flush with the column edge. That works until the
449 // reservation bottoms out at zero (gap == -thickness, the window now
450 // filling the whole column), after which the gap had nowhere left to
451 // go and the indicator simply FROZE — every further press of the
452 // control did nothing, with no way to tell that from a broken setting.
453 // Past that point the leftover is spent the only way still available,
454 // by sliding the indicator inward over the window. The control stays
455 // continuous across its whole range in both modes, and "a negative gap
456 // puts the indicator on top of the window" holds either way.
457 const int outward = placeWithinColumn ? -qMax(0, -(thickness + gap)) : (gap + thickness);
458 switch (position) {
460 return QRect(columnRect.x() - outward, columnRect.y() + longOffset, thickness, length);
462 return QRect(columnRect.x() + columnRect.width() - thickness + outward, columnRect.y() + longOffset,
463 thickness, length);
465 return QRect(columnRect.x() + longOffset, columnRect.y() - outward, length, thickness);
467 // Falls out to the shared return below. No default label, so a
468 // new enumerator is a compiler warning here rather than silently
469 // inheriting Bottom's geometry.
470 break;
471 }
472 return QRect(columnRect.x() + longOffset, columnRect.y() + columnRect.height() - thickness + outward, length,
473 thickness);
474 }
475};
476
482enum class DefaultWidthKind : int {
484 Fixed = 1,
492};
493
499enum class DefaultHeightKind : int {
500 Auto = 0,
501 Fixed = 1,
507};
508
523
528{
529 enum Kind : int {
535 Fixed = 1,
544 };
545
547 qreal proportion = 0.5;
548 int fixedPx = 0;
549 qreal presetFraction = 0.5;
550
551 static constexpr ColumnWidth makeProportion(qreal p)
552 {
553 ColumnWidth w;
554 w.kind = Proportion;
555 w.proportion = p;
556 return w;
557 }
558 static constexpr ColumnWidth makeFixed(int px)
559 {
560 ColumnWidth w;
561 w.kind = Fixed;
562 w.fixedPx = px;
563 return w;
564 }
565 static constexpr ColumnWidth makePreset(qreal fraction)
566 {
567 ColumnWidth w;
568 w.kind = Preset;
569 w.presetFraction = fraction;
570 return w;
571 }
572
573 bool operator==(const ColumnWidth& other) const
574 {
575 if (kind != other.kind) {
576 return false;
577 }
578 switch (kind) {
579 case Proportion:
580 return qFuzzyCompare(proportion, other.proportion);
581 case Fixed:
582 return fixedPx == other.fixedPx;
583 case Preset:
584 // Anchors are always copied FROM vocabulary values, so the cycle
585 // no-op gate compares identical doubles in practice; fuzzy keeps
586 // JSON round-trips honest.
587 return qFuzzyCompare(presetFraction, other.presetFraction);
588 }
589 return false;
590 }
591};
592
596{
597 enum Kind : int {
600 Auto = 0,
602 Fixed = 1,
607 };
608
610 qreal weight = 1.0;
611 int fixedPx = 0;
612 qreal presetFraction = 0.5;
613
614 static constexpr WindowHeight makeAuto(qreal w = 1.0)
615 {
616 WindowHeight h;
617 h.kind = Auto;
618 h.weight = w;
619 return h;
620 }
621 static constexpr WindowHeight makeFixed(int px)
622 {
623 WindowHeight h;
624 h.kind = Fixed;
625 h.fixedPx = px;
626 return h;
627 }
628 static constexpr WindowHeight makePreset(qreal fraction)
629 {
630 WindowHeight h;
631 h.kind = Preset;
632 h.presetFraction = fraction;
633 return h;
634 }
635
636 bool operator==(const WindowHeight& other) const
637 {
638 if (kind != other.kind) {
639 return false;
640 }
641 switch (kind) {
642 case Auto:
643 return qFuzzyCompare(weight, other.weight);
644 case Fixed:
645 return fixedPx == other.fixedPx;
646 case Preset:
647 return qFuzzyCompare(presetFraction, other.presetFraction);
648 }
649 return false;
650 }
651};
652
662inline int nearestPresetIndex(const QList<qreal>& presets, qreal fraction)
663{
664 if (presets.isEmpty()) {
665 return -1;
666 }
667 int best = 0;
668 for (int i = 1; i < presets.size(); ++i) {
669 if (qAbs(presets.at(i) - fraction) < qAbs(presets.at(best) - fraction)) {
670 best = i;
671 }
672 }
673 return best;
674}
675
678inline qreal nearestPresetValue(const QList<qreal>& presets, qreal fraction, qreal fallback = 0.5)
679{
680 return presets.isEmpty() ? fallback : presets.at(nearestPresetIndex(presets, fraction));
681}
682
691inline int proportionalPx(qreal proportion, int workExtent, int gap)
692{
693 return qMax(1, qRound(proportion * (workExtent + gap)) - gap);
694}
695
728template<typename Resolver>
729int cyclePresetIndexByExtent(int count, int currentPx, int delta, Resolver resolve)
730{
731 if (count <= 0) {
732 return -1;
733 }
734 const bool forward = delta >= 0;
735 int best = -1; // nearest entry strictly on the pressed side
736 int bestPx = 0; // its extent
737 int wrap = -1; // the extreme entry the press wraps to
738 int wrapPx = 0; // its extent
739 for (int i = 0; i < count; ++i) {
740 const int px = resolve(i);
741 if (forward) {
742 if (currentPx + 1 < px && (best < 0 || px < bestPx)) {
743 best = i;
744 bestPx = px;
745 }
746 if (wrap < 0 || px < wrapPx) {
747 wrap = i;
748 wrapPx = px;
749 }
750 } else {
751 if (px + 1 < currentPx && (best < 0 || px > bestPx)) {
752 best = i;
753 bestPx = px;
754 }
755 if (wrap < 0 || px > wrapPx) {
756 wrap = i;
757 wrapPx = px;
758 }
759 }
760 }
761 return best >= 0 ? best : wrap;
762}
763
765struct Tile
766{
767 QString windowId;
810 std::optional<WindowHeight> preMaximizeHeight;
813 bool minimized = false;
818 bool windowedFullscreen = false;
832 int minWidth = 0;
833 int minHeight = 0;
834
836 int minMain(StripAxis axis) const
837 {
838 return axis.isHorizontal() ? minWidth : minHeight;
839 }
840
841 int minCross(StripAxis axis) const
842 {
843 return axis.isHorizontal() ? minHeight : minWidth;
844 }
845};
846
849struct Column
850{
851 QVector<Tile> tiles;
896 bool maximizedToEdges = false;
897
898 bool isEmpty() const
899 {
900 return tiles.isEmpty();
901 }
902
906 const Tile* heightOwner() const
907 {
908 if (heightOwnerId.isEmpty()) {
909 return nullptr;
910 }
911 for (const Tile& tile : tiles) {
912 if (tile.windowId == heightOwnerId) {
913 return tile.minimized ? nullptr : &tile;
914 }
915 }
916 return nullptr;
917 }
918
927 {
928 int visible = 0;
929 for (const Tile& t : tiles) {
930 if (!t.minimized) {
931 ++visible;
932 }
933 }
934 return visible;
935 }
936
938 bool isFullyMinimized() const
939 {
940 for (const Tile& t : tiles) {
941 if (!t.minimized) {
942 return false;
943 }
944 }
945 return !tiles.isEmpty();
946 }
947 int indexOfWindow(const QString& windowId) const
948 {
949 for (int i = 0; i < tiles.size(); ++i) {
950 if (tiles.at(i).windowId == windowId) {
951 return i;
952 }
953 }
954 return -1;
955 }
956
960 QString anchorSiblingFor(int tileIdx) const
961 {
962 QString anchor;
963 for (int i = tileIdx - 1; i >= 0 && anchor.isEmpty(); --i) {
964 anchor = tiles.at(i).windowId;
965 }
966 for (int i = tileIdx + 1; i < tiles.size() && anchor.isEmpty(); ++i) {
967 anchor = tiles.at(i).windowId;
968 }
969 return anchor;
970 }
971};
972
977{
978 QRect workArea;
985 int gap = 0;
1025 QList<qreal> presetColumnWidths{1.0 / 3.0, 0.5, 2.0 / 3.0, 0.75, 1.0};
1026 QList<qreal> presetWindowHeights{1.0 / 3.0, 0.5, 2.0 / 3.0, 0.75, 1.0};
1052 bool cropStraddlers = false;
1076 std::function<QSize(const QString& windowId)> committedFloor;
1084 std::function<int(const QString& windowId)> committedCrossFloor;
1085};
1086
1089{
1090 QString windowId;
1095 QRect rect;
1098 bool hidden = false;
1102};
1103
1148
1151{
1152 QVector<ResolvedColumn> columns;
1155 int viewOffset = 0;
1158};
1159
1168inline QVector<const ResolvedColumn*> visibleColumnsOf(const ResolvedStrip& resolved, const QRect& workArea)
1169{
1170 QVector<const ResolvedColumn*> visible;
1171 for (const ResolvedColumn& column : resolved.columns) {
1172 if (column.rect.intersects(workArea)) {
1173 visible.append(&column);
1174 }
1175 }
1176 return visible;
1177}
1178
1179} // namespace PhosphorScrollEngine
Coordinate mapping for one strip orientation: a pure value type, trivially copyable,...
Definition StripAxis.h:35
static constexpr StripAxis horizontal()
Definition StripAxis.h:43
constexpr bool isHorizontal() const
Definition StripAxis.h:56
Per-screen override-map keys for ScrollEngine::applyPerScreenConfig.
Definition ScrollTypes.h:23
QString smartGaps()
Definition ScrollTypes.h:122
QString defaultColumnWidthKind()
SETTINGS channel: the per-screen override map mirrors the config's kind-aware width trio so a monitor...
Definition ScrollTypes.h:58
QString defaultWindowHeightPresetIndex()
Definition ScrollTypes.h:85
QString focusNewWindows()
Definition ScrollTypes.h:118
QString alwaysCenterSingleColumn()
RULE channel for the scrolling BEHAVIOUR toggles (SetScrollAlwaysCenter- SingleColumn / …CenterShortC...
Definition ScrollTypes.h:102
QString tabIndicatorEnabled()
RULE channel for the tab indicator's GEOMETRY half, one key per property so independent rules cascade...
Definition ScrollTypes.h:136
QString templateColumns()
TEMPLATE channel: the template's seed BLUEPRINT as a QVariantList of {width (double fraction),...
Definition ScrollTypes.h:196
QString tabIndicatorGap()
Definition ScrollTypes.h:148
QString templateColumnWidth()
Definition ScrollTypes.h:200
QString defaultColumnDisplay()
Definition ScrollTypes.h:51
QString centerShortColumns()
Definition ScrollTypes.h:106
QString cropStraddlers()
Definition ScrollTypes.h:114
QString templateColumnDisplay()
Definition ScrollTypes.h:204
QString defaultColumnWidthPresetIndex()
Definition ScrollTypes.h:66
QString stickyWindowHandling()
StickyWindowHandling ints (treatAsNormal 0 / restoreOnly 1 / ignoreAll 2).
Definition ScrollTypes.h:127
QString tabIndicatorWidth()
Definition ScrollTypes.h:152
QString respectMinimumSize()
Definition ScrollTypes.h:110
QString defaultWindowHeightKind()
SETTINGS channel height trio (kind / fixed px / preset index).
Definition ScrollTypes.h:77
QString presetColumnWidths()
TEMPLATE channel: preset lists from the screen's assigned scrolling template, as a QVariantList of do...
Definition ScrollTypes.h:170
QString defaultColumnWidthValue()
Definition ScrollTypes.h:62
QString presetWindowHeights()
Definition ScrollTypes.h:174
QString tabIndicatorLengthProportion()
Definition ScrollTypes.h:156
QString tabIndicatorPosition()
Definition ScrollTypes.h:160
QString centerFocusedColumn()
Definition ScrollTypes.h:24
QString tabIndicatorHideWhenSingleTab()
Definition ScrollTypes.h:140
QString defaultColumnWidth()
RULE channel: a bare work-area fraction (SetScrollDefaultColumnWidth).
Definition ScrollTypes.h:47
QString tabIndicatorPlaceWithinColumn()
Definition ScrollTypes.h:144
QString defaultWindowHeightValue()
Definition ScrollTypes.h:81
QString insertPosition()
RULE channel (SetScrollInsertPosition); the settings store deliberately does not write it — insert po...
Definition ScrollTypes.h:92
QString stripAxis()
SHARED key: which way this screen's strip runs, as the TRI-STATE intent (0 auto, 1 horizontal,...
Definition ScrollTypes.h:40
QString defaultWindowHeight()
RULE channel for the default window height: a bare work-area fraction (resolved against the live work...
Definition ScrollTypes.h:72
Definition ScrollEngine.h:46
int nearestPresetIndex(const QList< qreal > &presets, qreal fraction)
Shared nearest-entry resolution for the fraction anchors above — the ONE implementation behind preset...
Definition ScrollTypes.h:662
CenterFocusedColumn
Persistent view-centering policy for the focused column (niri's center-focused-column).
Definition ScrollTypes.h:234
@ Always
The focused column is always centered in the view.
Definition ScrollTypes.h:239
@ Never
Focusing an off-screen column scrolls the minimum amount to pin it to the edge it entered from; never...
Definition ScrollTypes.h:237
@ OnOverflow
Center only when the focused column plus the previously focused one cannot both fit on screen at once...
Definition ScrollTypes.h:242
constexpr qreal MinColumnWidthFraction
The narrowest column width this engine will accept as a proportion of the work area.
Definition ScrollTypes.h:220
int proportionalPx(qreal proportion, int workExtent, int gap)
A proportion resolves against the work extent PLUS one gap so that proportions summing to 1 tile edge...
Definition ScrollTypes.h:691
QVector< const ResolvedColumn * > visibleColumnsOf(const ResolvedStrip &resolved, const QRect &workArea)
The columns of resolved that intersect workArea, in strip order.
Definition ScrollTypes.h:1168
ScrollInsertPosition
Where a fresh-opened window's new column enters the strip (config default; the openColumnPlacement wi...
Definition ScrollTypes.h:513
@ LeftOfActive
Definition ScrollTypes.h:515
@ First
The strip's FIRST column.
Definition ScrollTypes.h:517
@ RightOfActive
Definition ScrollTypes.h:514
@ IntoActiveColumn
Stack into the focused column instead of opening a new one.
Definition ScrollTypes.h:521
@ Last
The strip's LAST column (niri's append).
Definition ScrollTypes.h:519
ColumnDisplay
How a column presents its tiles (niri's column display).
Definition ScrollTypes.h:246
@ Tabbed
Only the active tile is laid out, at the column's content rect (its CROSS extent less whatever an in-...
Definition ScrollTypes.h:258
@ Normal
Tiles split the column's CROSS extent between them; all are visible.
Definition ScrollTypes.h:248
DefaultHeightKind
Wire vocabulary of the DEFAULT-window-height KIND setting.
Definition ScrollTypes.h:499
@ Auto
Definition ScrollTypes.h:500
int cyclePresetIndexByExtent(int count, int currentPx, int delta, Resolver resolve)
The vocabulary index a preset CYCLE press lands on, given what the target currently measures on scree...
Definition ScrollTypes.h:729
TabIndicatorPosition
Which side of the column the tab indicator runs along (niri's TabIndicatorPosition,...
Definition ScrollTypes.h:287
@ Bottom
Definition ScrollTypes.h:291
@ Right
Definition ScrollTypes.h:289
@ Left
Definition ScrollTypes.h:288
@ Top
Definition ScrollTypes.h:290
constexpr qreal MinWindowHeightFraction
The shortest tile height this engine will accept as a proportion of the work area.
Definition ScrollTypes.h:230
qreal nearestPresetValue(const QList< qreal > &presets, qreal fraction, qreal fallback=0.5)
The nearest entry's VALUE.
Definition ScrollTypes.h:678
bool isVerticalTabIndicator(TabIndicatorPosition position)
True when position puts the indicator on a vertical edge, so its long axis is the column's HEIGHT and...
Definition ScrollTypes.h:297
DefaultWidthKind
Wire vocabulary of the DEFAULT-column-width KIND setting (IScrollSettings::scrollingDefaultColumnWidt...
Definition ScrollTypes.h:482
@ Proportion
Definition ScrollTypes.h:483
@ ClientDecides
Definition ScrollTypes.h:485
@ Fixed
Definition ScrollTypes.h:484
@ Preset
New columns open on a preset VALUE anchor (ColumnWidth::makePreset takes a fraction),...
Definition ScrollTypes.h:491
Column width INTENT — the source of truth the strip stores.
Definition ScrollTypes.h:528
qreal proportion
Kind::Proportion.
Definition ScrollTypes.h:547
Kind kind
Definition ScrollTypes.h:546
int fixedPx
Kind::Fixed.
Definition ScrollTypes.h:548
static constexpr ColumnWidth makeFixed(int px)
Definition ScrollTypes.h:558
static constexpr ColumnWidth makeProportion(qreal p)
Definition ScrollTypes.h:551
bool operator==(const ColumnWidth &other) const
Definition ScrollTypes.h:573
static constexpr ColumnWidth makePreset(qreal fraction)
Definition ScrollTypes.h:565
Kind
Definition ScrollTypes.h:529
@ Proportion
Fraction of the work area's MAIN extent.
Definition ScrollTypes.h:533
@ Preset
Fraction ANCHOR snapped to the nearest entry of the screen's effective preset list at relayout.
Definition ScrollTypes.h:543
@ Fixed
Absolute pixel MAIN extent.
Definition ScrollTypes.h:535
qreal presetFraction
Kind::Preset.
Definition ScrollTypes.h:549
One column: a stack of tiles ACROSS the strip (vertical on a horizontal strip, horizontal on a vertic...
Definition ScrollTypes.h:850
const Tile * heightOwner() const
The tile whose height decides this column's cross extent while tabbed, or nullptr when no live non-mi...
Definition ScrollTypes.h:906
bool maximizedToEdges
Maximize-to-edges (niri parity): the column takes the RAW work area (ScrollLayoutParams::rawWorkArea)...
Definition ScrollTypes.h:896
bool isEmpty() const
Definition ScrollTypes.h:898
ColumnDisplay display
Definition ScrollTypes.h:854
int activeTileIdx
Definition ScrollTypes.h:852
ColumnWidth width
Definition ScrollTypes.h:853
int visibleTileCount() const
How many tiles are laid out, i.e.
Definition ScrollTypes.h:926
QVector< Tile > tiles
Definition ScrollTypes.h:851
int indexOfWindow(const QString &windowId) const
Definition ScrollTypes.h:947
bool isFullyMinimized() const
True when every tile is minimized — the column occupies no strip MAIN extent.
Definition ScrollTypes.h:938
QString anchorSiblingFor(int tileIdx) const
Surviving sibling to anchor a stack re-insert on: the nearest tile above tileIdx with a non-empty id,...
Definition ScrollTypes.h:960
QString heightOwnerId
Which tab's height intent decides a TABBED column's cross extent, by window id.
Definition ScrollTypes.h:880
One column's resolved output.
Definition ScrollTypes.h:1106
TabIndicatorPosition tabIndicatorPosition
Which edge tabIndicatorRect runs along, so a consumer can tell the indicator's long axis without re-d...
Definition ScrollTypes.h:1130
QVector< ResolvedTile > tiles
Definition ScrollTypes.h:1146
QRect rect
The column's bounding rect.
Definition ScrollTypes.h:1118
QRect tabIndicatorRect
Where the tab indicator is drawn, in the same absolute screen coordinates as rect.
Definition ScrollTypes.h:1126
bool tabbed
Definition ScrollTypes.h:1119
bool extentPinnedByMinimum
True when the column's main extent came from its FLOOR rather than from its stored width intent — its...
Definition ScrollTypes.h:1140
bool maximizedToEdges
The column's declared maximize-to-edges state, copied through from Column::maximizedToEdges so the ap...
Definition ScrollTypes.h:1145
int columnIndex
Definition ScrollTypes.h:1107
A full relayout pass over one strip.
Definition ScrollTypes.h:1151
int stripExtent
Total strip MAIN extent in pixels (all non-minimized columns + gaps).
Definition ScrollTypes.h:1157
int viewOffset
The viewport's LEADING edge in strip coordinates — what the engine uses to decide which columns are v...
Definition ScrollTypes.h:1155
QVector< ResolvedColumn > columns
Definition ScrollTypes.h:1152
One tile's resolved output for a relayout pass.
Definition ScrollTypes.h:1089
bool windowedFullscreen
Copied from Tile::windowedFullscreen so the apply payload can carry it; never influences the resolved...
Definition ScrollTypes.h:1101
QRect rect
Absolute pixel rect in screen coordinates.
Definition ScrollTypes.h:1095
bool hidden
True for the non-active tiles of a tabbed column — visually suppressed, not clickable,...
Definition ScrollTypes.h:1098
QString windowId
Definition ScrollTypes.h:1090
How far a screen has worked through its context template's seed blueprint.
Definition ScrollTypes.h:274
int total
Definition ScrollTypes.h:275
int used
Definition ScrollTypes.h:276
bool operator==(const ScrollBlueprintProgress &) const =default
Inputs a relayout resolves pixel rects against.
Definition ScrollTypes.h:977
QList< qreal > presetWindowHeights
Definition ScrollTypes.h:1026
CenterFocusedColumn centerFocusedColumn
Definition ScrollTypes.h:1027
bool cropStraddlers
Whether main-axis straddlers keep their TRUE rect for the effect to crop (true) instead of being clam...
Definition ScrollTypes.h:1052
TabIndicatorParams tabIndicator
Geometry inputs for the tab indicator drawn beside a tabbed column.
Definition ScrollTypes.h:1064
std::function< QSize(const QString &windowId)> committedFloor
Per window: the extent along the strip a client's own commits hold its column to (ScrollEngine::repor...
Definition ScrollTypes.h:1076
ColumnWidth defaultColumnWidth
The context's default column width — the un-maximize fallback for a full-MAIN-extent column with no s...
Definition ScrollTypes.h:1060
QRect workArea
Definition ScrollTypes.h:978
bool alwaysCenterSingleColumn
Definition ScrollTypes.h:1028
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 (ScrollE...
Definition ScrollTypes.h:1084
StripAxis axis
Which way this screen's strip runs.
Definition ScrollTypes.h:1002
QRect rawWorkArea
The screen's available geometry BEFORE the outer-gap shrink and the smart-gaps zeroing — still strut-...
Definition ScrollTypes.h:984
QList< qreal > presetColumnWidths
Preset proportion lists (the niri 1/3, 1/2, 2/3 plus 3/4 and full).
Definition ScrollTypes.h:1025
int gap
Definition ScrollTypes.h:985
bool centerShortColumns
Whether a column whose visible tiles resolve to less than the column's own CROSS extent is centred on...
Definition ScrollTypes.h:1046
bool respectMinimumSize
Whether the strip's layout math honours windows' minimum frame sizes (the column MAIN floor,...
Definition ScrollTypes.h:1039
WindowHeight defaultWindowHeight
The context's default window height intent, seeded onto every fresh-created tile (restore paths overw...
Definition ScrollTypes.h:1057
The tab indicator's GEOMETRY inputs — the subset of the Scrolling.TabIndicator family that changes re...
Definition ScrollTypes.h:310
QRect indicatorRectFor(const QRect &columnRect, int tileCount) const
Where the indicator is drawn for a column occupying columnRect, in the same coordinates.
Definition ScrollTypes.h:421
int gap
Gap between the indicator and the window.
Definition ScrollTypes.h:335
bool enabled
Off, no indicator rect is resolved and placeWithinColumn reserves nothing — a tabbed column lays out ...
Definition ScrollTypes.h:314
bool resolvesFor(int tileCount) const
Whether a tabbed column with tileCount tiles draws an indicator.
Definition ScrollTypes.h:377
bool placeWithinColumn
Reserve the indicator's thickness plus its gap out of the column, shrinking the tile rects,...
Definition ScrollTypes.h:322
bool hideWhenSingleTab
Skip the indicator for a tabbed column holding a single tile.
Definition ScrollTypes.h:318
qreal lengthProportion
Indicator length along its long axis, as a proportion of the column extent it runs beside.
Definition ScrollTypes.h:346
int width
Indicator thickness (its short axis) in pixels, EXACT for every style.
Definition ScrollTypes.h:343
QRect contentRectFor(const QRect &columnRect, int tileCount) const
The rect the column's TILES get, i.e.
Definition ScrollTypes.h:385
TabIndicatorPosition position
Definition ScrollTypes.h:347
int reservedThickness(int tileCount) const
Pixels this indicator takes out of the column along the indicator's THICKNESS axis (the column's widt...
Definition ScrollTypes.h:364
One window in a column.
Definition ScrollTypes.h:766
QString windowId
Definition ScrollTypes.h:767
int minCross(StripAxis axis) const
The frame minimum across the strip (a stacked-tile floor).
Definition ScrollTypes.h:841
int minMain(StripAxis axis) const
The frame minimum along the strip (a column-width floor).
Definition ScrollTypes.h:836
int minWidth
The window's minimum FRAME size (0 = unconstrained): the minimum its client declares,...
Definition ScrollTypes.h:832
bool minimized
Minimized tiles keep their slot/order but are excluded from layout; unminimize restores the window in...
Definition ScrollTypes.h:813
WindowHeight height
Definition ScrollTypes.h:768
int minHeight
Definition ScrollTypes.h:833
std::optional< WindowHeight > preMaximizeHeight
The height this tile carried when toggleMaximizeActiveWindowHeight last maximized it,...
Definition ScrollTypes.h:810
bool windowedFullscreen
Windowed fullscreen (niri toggle-windowed-fullscreen): the client is told it is fullscreen while the ...
Definition ScrollTypes.h:818
Tile height INTENT within a column (its extent ACROSS the strip).
Definition ScrollTypes.h:596
qreal weight
Kind::Auto.
Definition ScrollTypes.h:610
static constexpr WindowHeight makePreset(qreal fraction)
Definition ScrollTypes.h:628
static constexpr WindowHeight makeFixed(int px)
Definition ScrollTypes.h:621
int fixedPx
Kind::Fixed.
Definition ScrollTypes.h:611
Kind
Definition ScrollTypes.h:597
@ Auto
Share the column's CROSS extent left over after Fixed/Preset tiles, proportionally to weight (the def...
Definition ScrollTypes.h:600
@ Fixed
Absolute pixel CROSS extent.
Definition ScrollTypes.h:602
@ Preset
Fraction anchor snapped to the nearest entry of the effective preset list at relayout — same value-an...
Definition ScrollTypes.h:606
static constexpr WindowHeight makeAuto(qreal w=1.0)
Definition ScrollTypes.h:614
bool operator==(const WindowHeight &other) const
Definition ScrollTypes.h:636
Kind kind
Definition ScrollTypes.h:609
qreal presetFraction
Kind::Preset.
Definition ScrollTypes.h:612