Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
header_settings.hpp
Go to the documentation of this file.
1// HeaderSetting — the language and the theme in the main screen's header,
2// left of the notification bell: the language's code ("FR", "EN", the
3// console's own one for "system") in a rounded frame, and the theme as a
4// sun (light), a moon (dark) or a half-filled disc (the console's); the
5// text size after them, as "AA" (a small A and
6// a large one, the large one teal while the text is larger). A code
7// rather than a flag: a flag names a country, not a language, and fr-CA,
8// es-419 or zh-Hant have none that fits. A tap opens the same list as
9// Preferences (ui::pick_language / pick_theme / pick_text_size); not
10// focusable, like an app's bell: − opens them from any tab (ui::quick_settings),
11// as the footer says.
12// Copyright (C) 2026 JigSawFr. GPLv3-or-later (see LICENSE.GPL).
13#pragma once
14
15#include <aurore.hpp>
16
20{
21 public:
22 enum class Kind
23 {
25 THEME,
27 };
28
29 explicit HeaderSetting(Kind kind);
30
33 static void install();
34
35 void draw(NVGcontext* vg, float x, float y, float width, float height, aurore::Style style,
36 aurore::FrameContext* ctx) override;
39
40 protected:
43 std::string getDefaultAccessibilityLabel() override;
44
45 private:
46 Kind kind;
47
48 void draw_language(NVGcontext* vg, float x, float y, float width, float height);
49 void draw_theme(NVGcontext* vg, float x, float y, float width, float height);
50 void draw_text_size(NVGcontext* vg, float x, float y, float width, float height);
51};
Definition header_settings.hpp:20
Kind
Definition header_settings.hpp:23
std::string getDefaultAccessibilityLabel() override
void draw(NVGcontext *vg, float x, float y, float width, float height, aurore::Style style, aurore::FrameContext *ctx) override
HeaderSetting(Kind kind)
aurore::View * hitTest(aurore::Point point) override
Touched although it is not focusable.
aurore::AccessibilityRole getDefaultAccessibilityRole() override
A button: "Language, Français (France)", "Theme, Dark", "Text size, Larger".
Definition header_settings.hpp:42
static void install()
Definition frame_context.hpp:30
Simple wrapper around StyleValues for the array operator.
Definition style.hpp:115
Definition view.hpp:232
AccessibilityRole
Definition view_style.hpp:78
Definition geometry.hpp:26