Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
help_view.hpp
1// Copyright (c) 2026 ttldtor.
2// SPDX-License-Identifier: BSL-1.0
3#pragma once
4#include <portals/key_binding.hpp>
5#include <portals/primitives.hpp>
6
7namespace portals {
11 ~KeyFormatOptions() = default;
12 std::size_t maxBytesPerBinding{8192};
13 std::string strokeSeparator{" then "};
14 std::string alternativeSeparator{" / "};
15 std::string repeatMarker{" [repeat]"};
16 std::string releaseMarker{" [release]"};
17 std::string unknownMarker{" [?]"};
18};
19
23 ~HelpViewOptions() = default;
26 std::string emptyText{"No key bindings"};
27 std::string unavailableText{"Help unavailable"};
28};
29
31class HelpView : public Column {
32public:
34 explicit HelpView(SizePolicy policy = DEFAULT_VIEWPORT_POLICY) : Column({}, policy) {
35 }
36};
37
38namespace ui {
39template <class T> class Ref;
40template <class T> class Description;
43Description<HelpView> helpView(Ref<HelpView> reference, HelpViewOptions options = {}, ControlStyle style = {});
44
45namespace detail {
46struct RefTarget;
47struct KeyHelpAccess;
50std::expected<void, ManagedError> helpCommand(const std::shared_ptr<RefTarget> &target, bool opening,
51 std::source_location origin);
52} // namespace detail
53} // namespace ui
54} // namespace portals
Column(LinearOptions options={}, SizePolicy policy={})
Own settings and policies.
HelpView(SizePolicy policy=DEFAULT_VIEWPORT_POLICY)
Definition help_view.hpp:34
Single-use owning construction recipe; no mounted widget ownership.
Definition ui_description.hpp:48
Typed Widget observation; explicit composite specializations reuse their existing weak facades.
Definition ui_ref.hpp:761
Public Portals API.
Definition action.hpp:8
constexpr SizePolicy DEFAULT_VIEWPORT_POLICY
A bounded data viewport fills both axes without requesting the whole model extent.
Definition layout.hpp:53
Ordinary help pane options; open/close bindings belong to the application.
Definition help_view.hpp:21
~HelpViewOptions()=default
Release the owning presentation options.
KeyFormatOptions format
Owning bounded row formatter.
Definition help_view.hpp:25
std::string unavailableText
Failed fresh projection marker.
Definition help_view.hpp:27
std::string emptyText
Empty-list presentation.
Definition help_view.hpp:26
bool initiallyOpen
False by default; opening uses the existing focus-return stack.
Definition help_view.hpp:24
Owning ASCII-first formatter settings; glyph support is never inferred.
Definition help_view.hpp:9
std::string alternativeSeparator
Between alternatives.
Definition help_view.hpp:14
std::string repeatMarker
Actual native repeat phase.
Definition help_view.hpp:15
std::string releaseMarker
Actual native release phase.
Definition help_view.hpp:16
std::string unknownMarker
Terminal support is unknown.
Definition help_view.hpp:17
~KeyFormatOptions()=default
Release the owning formatter strings.
std::size_t maxBytesPerBinding
Positive whole formatted row cap.
Definition help_view.hpp:12
std::string strokeSeparator
Between sequence strokes.
Definition help_view.hpp:13
Owning independent policies for width and height.
Definition layout.hpp:35
Shared observation; publication and all mutable fields belong to the constructing UI thread.
Definition ui_ref.hpp:71