Skip to content
Phosphor
/
API Reference
Search
PlasmaZones
Libraries
Guides
Brand
Palette
About
GitHub
Discord
Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
IScrollSettings.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
6
#include <QObject>
7
#include <QStringList>
8
9
namespace
PhosphorEngine
{
10
17
class
IScrollSettings
18
{
19
public
:
20
virtual
~IScrollSettings
() =
default
;
21
22
virtual
int
scrollingInnerGap
()
const
= 0;
23
virtual
bool
scrollingUsePerSideOuterGap
()
const
= 0;
24
virtual
int
scrollingOuterGap
()
const
= 0;
25
virtual
int
scrollingOuterGapTop
()
const
= 0;
26
virtual
int
scrollingOuterGapBottom
()
const
= 0;
27
virtual
int
scrollingOuterGapLeft
()
const
= 0;
28
virtual
int
scrollingOuterGapRight
()
const
= 0;
30
virtual
bool
scrollingFocusNewWindows
()
const
= 0;
42
virtual
bool
scrollingGroupSameAppAsTabs
()
const
43
{
44
return
false
;
45
}
46
51
virtual
int
scrollingStickyWindowHandling
()
const
= 0;
59
virtual
bool
scrollingRespectMinimumSize
()
const
= 0;
65
virtual
bool
scrollingCenterShortColumns
()
const
66
{
67
return
false
;
68
}
69
78
virtual
bool
scrollingSmartGaps
()
const
= 0;
79
81
virtual
int
scrollingCenterFocusedColumn
()
const
= 0;
82
virtual
bool
scrollingAlwaysCenterSingleColumn
()
const
= 0;
86
virtual
bool
scrollingCropStraddlers
()
const
87
{
88
return
false
;
89
}
90
99
virtual
int
scrollingStripAxis
()
const
100
{
101
return
0;
102
}
103
111
virtual
int
scrollingDefaultColumnWidthKind
()
const
= 0;
112
virtual
qreal
scrollingDefaultColumnWidthValue
()
const
= 0;
113
virtual
int
scrollingDefaultColumnWidthPresetIndex
()
const
= 0;
118
virtual
int
scrollingDefaultWindowHeightKind
()
const
= 0;
119
virtual
qreal
scrollingDefaultWindowHeightValue
()
const
= 0;
120
virtual
int
scrollingDefaultWindowHeightPresetIndex
()
const
= 0;
123
virtual
int
scrollingInsertPosition
()
const
= 0;
125
virtual
int
scrollingDefaultColumnDisplay
()
const
= 0;
126
127
// ── Drag-insert edge auto-scroll (Scrolling.Behavior.DragScroll) ─────
128
//
129
// niri's dnd-edge-view-scroll: holding a dragged window near either
130
// screen edge scrolls the strip so an off-screen column can be reached.
131
// DEFAULTED, not pure, like scrollingCropStraddlers — niri's own
132
// defaults are the right answer for every implementor that has not
133
// heard of the option, the test stubs included.
134
135
// niri's four figures, named so the defaulted bodies below and
136
// ScrollEngine's pre-refresh member cache read the SAME constants rather
137
// than three hand-copied sets. src/config/settings/scrolling.cpp
138
// static_asserts ConfigDefaults against these, which is what keeps the
139
// config layer and the engine layer agreeing.
140
static
constexpr
bool
kDragScrollEnabledDefault
=
true
;
141
static
constexpr
int
kDragScrollTriggerWidthDefault
= 30;
142
static
constexpr
int
kDragScrollDelayMsDefault
= 100;
143
static
constexpr
int
kDragScrollMaxSpeedDefault
= 1500;
147
static
constexpr
int
kDragScrollMaxSpeedCeiling
= 10000;
148
151
virtual
bool
scrollingDragScrollEnabled
()
const
152
{
153
return
kDragScrollEnabledDefault
;
154
}
155
161
virtual
int
scrollingDragScrollTriggerWidth
()
const
162
{
163
return
kDragScrollTriggerWidthDefault
;
164
}
165
167
virtual
int
scrollingDragScrollDelayMs
()
const
168
{
169
return
kDragScrollDelayMsDefault
;
170
}
171
173
virtual
int
scrollingDragScrollMaxSpeed
()
const
174
{
175
return
kDragScrollMaxSpeedDefault
;
176
}
177
182
virtual
QStringList
scrollingPresetColumnWidths
()
const
= 0;
183
virtual
QStringList
scrollingPresetWindowHeights
()
const
= 0;
184
185
// ── Tab indicator geometry (Scrolling.TabIndicator) ──────────────────
186
//
187
// Only the subset that changes resolved rects lives here; it lands in
188
// ScrollLayoutParams::tabIndicator (TabIndicatorParams, ScrollTypes.h,
189
// where each field is documented in full). The indicator's PAINT settings
190
// — style, gaps between tabs, corner radius, the three colours and the
191
// five label-font keys (family, weight, italic, underline, strikeout) —
192
// are deliberately absent: they never affect layout, so they go to the
193
// KWin effect, which draws the indicator itself. The global keys travel
194
// over the settings channel the effect pulls; per-screen rule overrides
195
// are pushed by the daemon through
196
// TilingAdaptor::setScrollTabPaintOverrides. Keep that split when adding a
197
// knob, or this library grows a dependency on how the indicator happens to
198
// be drawn.
199
201
virtual
bool
scrollingTabIndicatorEnabled
()
const
= 0;
203
virtual
bool
scrollingTabIndicatorHideWhenSingleTab
()
const
= 0;
205
virtual
bool
scrollingTabIndicatorPlaceWithinColumn
()
const
= 0;
207
virtual
int
scrollingTabIndicatorGap
()
const
= 0;
211
virtual
int
scrollingTabIndicatorWidth
()
const
= 0;
213
virtual
qreal
scrollingTabIndicatorLengthProportion
()
const
= 0;
215
virtual
int
scrollingTabIndicatorPosition
()
const
= 0;
216
};
217
218
}
// namespace PhosphorEngine
219
220
Q_DECLARE_INTERFACE(
PhosphorEngine::IScrollSettings
,
"org.phosphor_works.Placement.IScrollSettings"
)
PhosphorEngine::IScrollSettings
Settings surface the scrolling engine reads, injected by the daemon via PlacementEngineBase::setEngin...
Definition
IScrollSettings.h:18
PhosphorEngine::IScrollSettings::~IScrollSettings
virtual ~IScrollSettings()=default
PhosphorEngine::IScrollSettings::scrollingOuterGap
virtual int scrollingOuterGap() const =0
PhosphorEngine::IScrollSettings::scrollingDefaultColumnWidthKind
virtual int scrollingDefaultColumnWidthKind() const =0
Default width for new columns: kind (0 = proportion, 1 = fixed px, 2 = client decides,...
PhosphorEngine::IScrollSettings::scrollingDragScrollEnabled
virtual bool scrollingDragScrollEnabled() const
Master switch.
Definition
IScrollSettings.h:151
PhosphorEngine::IScrollSettings::scrollingDefaultColumnDisplay
virtual int scrollingDefaultColumnDisplay() const =0
ColumnDisplay new columns open in (0 = normal, 1 = tabbed).
PhosphorEngine::IScrollSettings::scrollingDragScrollTriggerWidth
virtual int scrollingDragScrollTriggerWidth() const
Width of the band inside each work-area edge that arms the scroll, in logical pixels.
Definition
IScrollSettings.h:161
PhosphorEngine::IScrollSettings::scrollingStripAxis
virtual int scrollingStripAxis() const
Which way the strip runs: 0 auto (from the work area), 1 horizontal, 2 vertical.
Definition
IScrollSettings.h:99
PhosphorEngine::IScrollSettings::scrollingDefaultWindowHeightPresetIndex
virtual int scrollingDefaultWindowHeightPresetIndex() const =0
PhosphorEngine::IScrollSettings::scrollingDefaultColumnWidthPresetIndex
virtual int scrollingDefaultColumnWidthPresetIndex() const =0
PhosphorEngine::IScrollSettings::kDragScrollTriggerWidthDefault
static constexpr int kDragScrollTriggerWidthDefault
Definition
IScrollSettings.h:141
PhosphorEngine::IScrollSettings::kDragScrollDelayMsDefault
static constexpr int kDragScrollDelayMsDefault
Definition
IScrollSettings.h:142
PhosphorEngine::IScrollSettings::scrollingOuterGapRight
virtual int scrollingOuterGapRight() const =0
PhosphorEngine::IScrollSettings::scrollingOuterGapTop
virtual int scrollingOuterGapTop() const =0
PhosphorEngine::IScrollSettings::scrollingStickyWindowHandling
virtual int scrollingStickyWindowHandling() const =0
StickyWindowHandling as int (0 = treat as normal, 1 = restore only, 2 = ignore all) — the shared Phos...
PhosphorEngine::IScrollSettings::scrollingPresetColumnWidths
virtual QStringList scrollingPresetColumnWidths() const =0
Preset proportion lists, serialized as decimal strings.
PhosphorEngine::IScrollSettings::scrollingDefaultWindowHeightValue
virtual qreal scrollingDefaultWindowHeightValue() const =0
PhosphorEngine::IScrollSettings::scrollingTabIndicatorHideWhenSingleTab
virtual bool scrollingTabIndicatorHideWhenSingleTab() const =0
Skip the indicator for a tabbed column holding a single tile.
PhosphorEngine::IScrollSettings::scrollingTabIndicatorEnabled
virtual bool scrollingTabIndicatorEnabled() const =0
Master switch. Off, no indicator rect resolves and nothing is reserved.
PhosphorEngine::IScrollSettings::scrollingOuterGapBottom
virtual int scrollingOuterGapBottom() const =0
PhosphorEngine::IScrollSettings::scrollingFocusNewWindows
virtual bool scrollingFocusNewWindows() const =0
Whether newly opened windows take focus (Scrolling.Behavior).
PhosphorEngine::IScrollSettings::scrollingTabIndicatorGap
virtual int scrollingTabIndicatorGap() const =0
Gap between indicator and window; NEGATIVE puts it over the window.
PhosphorEngine::IScrollSettings::scrollingRespectMinimumSize
virtual bool scrollingRespectMinimumSize() const =0
Whether the strip's layout math honours windows' minimum sizes (column width floor,...
PhosphorEngine::IScrollSettings::scrollingInnerGap
virtual int scrollingInnerGap() const =0
PhosphorEngine::IScrollSettings::scrollingCropStraddlers
virtual bool scrollingCropStraddlers() const
Crop mode for partial edge columns (see ConfigDefaults).
Definition
IScrollSettings.h:86
PhosphorEngine::IScrollSettings::scrollingTabIndicatorLengthProportion
virtual qreal scrollingTabIndicatorLengthProportion() const =0
Indicator length as a proportion of the column extent beside it.
PhosphorEngine::IScrollSettings::scrollingDefaultColumnWidthValue
virtual qreal scrollingDefaultColumnWidthValue() const =0
PhosphorEngine::IScrollSettings::scrollingTabIndicatorPosition
virtual int scrollingTabIndicatorPosition() const =0
Which column edge the indicator runs along (TabIndicatorPosition).
PhosphorEngine::IScrollSettings::scrollingSmartGaps
virtual bool scrollingSmartGaps() const =0
Zero the outer gaps when the strip holds a single column.
PhosphorEngine::IScrollSettings::scrollingAlwaysCenterSingleColumn
virtual bool scrollingAlwaysCenterSingleColumn() const =0
PhosphorEngine::IScrollSettings::scrollingCenterShortColumns
virtual bool scrollingCenterShortColumns() const
Whether a column whose windows do not fill the cross axis is centred on it instead of hugging the sta...
Definition
IScrollSettings.h:65
PhosphorEngine::IScrollSettings::scrollingDragScrollMaxSpeed
virtual int scrollingDragScrollMaxSpeed() const
Scroll speed at the very edge of the work area, in logical pixels per second.
Definition
IScrollSettings.h:173
PhosphorEngine::IScrollSettings::scrollingDragScrollDelayMs
virtual int scrollingDragScrollDelayMs() const
How long the cursor must sit inside the band before the strip starts moving.
Definition
IScrollSettings.h:167
PhosphorEngine::IScrollSettings::kDragScrollMaxSpeedCeiling
static constexpr int kDragScrollMaxSpeedCeiling
Upper bound the engine enforces on the speed.
Definition
IScrollSettings.h:147
PhosphorEngine::IScrollSettings::scrollingTabIndicatorWidth
virtual int scrollingTabIndicatorWidth() const =0
Indicator thickness.
PhosphorEngine::IScrollSettings::kDragScrollMaxSpeedDefault
static constexpr int kDragScrollMaxSpeedDefault
Definition
IScrollSettings.h:143
PhosphorEngine::IScrollSettings::scrollingPresetWindowHeights
virtual QStringList scrollingPresetWindowHeights() const =0
PhosphorEngine::IScrollSettings::scrollingUsePerSideOuterGap
virtual bool scrollingUsePerSideOuterGap() const =0
PhosphorEngine::IScrollSettings::scrollingInsertPosition
virtual int scrollingInsertPosition() const =0
ScrollInsertPosition as int (0 = right of active, 1 = left of active, 2 = first, 3 = last,...
PhosphorEngine::IScrollSettings::scrollingOuterGapLeft
virtual int scrollingOuterGapLeft() const =0
PhosphorEngine::IScrollSettings::scrollingDefaultWindowHeightKind
virtual int scrollingDefaultWindowHeightKind() const =0
Default height intent for fresh tiles: kind (0 = auto, 1 = fixed px, 2 = preset index,...
PhosphorEngine::IScrollSettings::scrollingGroupSameAppAsTabs
virtual bool scrollingGroupSameAppAsTabs() const
Whether a fresh open joins, as a tab, a column that already holds a window of the same application (S...
Definition
IScrollSettings.h:42
PhosphorEngine::IScrollSettings::scrollingCenterFocusedColumn
virtual int scrollingCenterFocusedColumn() const =0
CenterFocusedColumn as int (0 = never, 1 = always, 2 = on-overflow).
PhosphorEngine::IScrollSettings::kDragScrollEnabledDefault
static constexpr bool kDragScrollEnabledDefault
Definition
IScrollSettings.h:140
PhosphorEngine::IScrollSettings::scrollingTabIndicatorPlaceWithinColumn
virtual bool scrollingTabIndicatorPlaceWithinColumn() const =0
Reserve the indicator out of the column instead of drawing beside it.
PhosphorEngine
Definition
DesktopRemap.h:12
phosphor-scroll-engine
include
PhosphorScrollEngine
IScrollSettings.h
Generated by
1.15.0