Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
frame.hpp
1// Copyright (c) 2026 ttldtor.
2// SPDX-License-Identifier: BSL-1.0
3#pragma once
4
5#include <portals/layout.hpp>
6
7namespace portals {
9enum class FramePattern {
10 SINGLE,
11 PLAIN = SINGLE,
13 DOUBLE,
16};
17
19struct FrameSides {
20 bool top{true};
21 bool right{true};
22 bool bottom{true};
23 bool left{true};
24
26 constexpr LayoutPadding insets() const noexcept {
27 return {left ? 1 : 0, top ? 1 : 0, right ? 1 : 0, bottom ? 1 : 0};
28 }
29};
30
37
47
48} // namespace portals
Public Portals API.
Definition action.hpp:8
FramePattern
Built-in frame line patterns, independent of terminal width policy.
Definition frame.hpp:9
@ HEAVY
Heavy lines and square corners.
Definition frame.hpp:14
@ ROUNDED
Single lines and rounded corners.
Definition frame.hpp:12
@ PLAIN
Source bytes have the normal role.
Definition document_highlight_types.hpp:12
TitleDecoration
Optional top-title break decoration; NONE preserves literal legacy titles.
Definition frame.hpp:39
@ SQUARE
Square brackets and inner spaces.
Definition frame.hpp:42
@ ROUND
Parentheses and inner spaces.
Definition frame.hpp:44
@ PROFILE
Explicit selected profile caps; customTitleDecoration still wins.
Definition frame.hpp:45
@ SPACED
One space on either side.
Definition frame.hpp:41
@ ANGLE
Angle brackets and inner spaces.
Definition frame.hpp:43
@ ASCII
Portable vertical bar and hash brushes.
Definition chart.hpp:56
FrameTitleAlignment
Alignment of the maximal whole-grapheme title prefix fitting the top edge.
Definition frame.hpp:32
@ CENTER
Center in the usable viewport, rounding down.
Definition dialog.hpp:22
@ NONE
Caption only, including a single-glyph action button.
Definition controls.hpp:157
@ START
Immediately after the leading corner.
Definition dialog.hpp:35
Present frame sides, also defining one-cell content insets.
Definition frame.hpp:19
bool right
Reserve and paint the right column.
Definition frame.hpp:21
bool top
Reserve and paint the top row.
Definition frame.hpp:20
bool bottom
Reserve and paint the bottom row.
Definition frame.hpp:22
constexpr LayoutPadding insets() const noexcept
Definition frame.hpp:26
bool left
Reserve and paint the left column.
Definition frame.hpp:23
Owning nonnegative padding in terminal cells.
Definition layout.hpp:185