27template<
typename Normalize>
28std::optional<int>
gapFromOverrideMap(
const QVariantMap& map, QLatin1String key, Normalize normalize)
30 const auto it = map.constFind(key);
31 if (it == map.constEnd()) {
34 return normalize(it->toInt());
48template<
typename Normalize>
62 if (topIt != map.constEnd() || bottomIt != map.constEnd() || leftIt != map.constEnd()
63 || rightIt != map.constEnd()) {
64 const int base = (uniformIt != map.constEnd()) ? normalize(uniformIt->toInt()) : normalize(missingSideBase);
65 return ::PhosphorLayout::EdgeGaps{(topIt != map.constEnd()) ? normalize(topIt->toInt()) : base,
66 (bottomIt != map.constEnd()) ? normalize(bottomIt->toInt()) : base,
67 (leftIt != map.constEnd()) ? normalize(leftIt->toInt()) : base,
68 (rightIt != map.constEnd()) ? normalize(rightIt->toInt()) : base};
71 if (uniformIt != map.constEnd()) {
72 return ::PhosphorLayout::EdgeGaps::uniform(normalize(uniformIt->toInt()));
Shared resolution of gap-override layers expressed as PerScreenKeys-shaped QVariantMaps (context-rule...
Definition GapResolution.h:23
std::optional<::PhosphorLayout::EdgeGaps > outerGapsFromOverrideMap(const QVariantMap &map, int missingSideBase, Normalize normalize)
Resolve the outer-gap portion of an override map as ONE atomic layer.
Definition GapResolution.h:49
std::optional< int > gapFromOverrideMap(const QVariantMap &map, QLatin1String key, Normalize normalize)
Single gap value from an override map, or nullopt when map lacks key.
Definition GapResolution.h:28
constexpr QLatin1String OuterGapBottom
Definition PerScreenKeys.h:20
constexpr QLatin1String OuterGapLeft
Definition PerScreenKeys.h:21
constexpr QLatin1String OuterGapRight
Definition PerScreenKeys.h:22
constexpr QLatin1String OuterGapTop
Definition PerScreenKeys.h:19
constexpr QLatin1String OuterGap
Definition PerScreenKeys.h:17
constexpr QLatin1String UsePerSideOuterGap
Definition PerScreenKeys.h:18
Definition DesktopRemap.h:12