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
19
class
HeaderSetting
:
public
aurore::View
20
{
21
public
:
22
enum class
Kind
23
{
24
LANGUAGE
,
25
THEME
,
26
TEXT_SIZE
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
;
38
aurore::View
*
hitTest
(
aurore::Point
point)
override
;
39
40
protected
:
42
aurore::AccessibilityRole
getDefaultAccessibilityRole
()
override
{
return
aurore::AccessibilityRole::BUTTON
; }
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
};
aurore.hpp
HeaderSetting
Definition
header_settings.hpp:20
HeaderSetting::Kind
Kind
Definition
header_settings.hpp:23
HeaderSetting::Kind::LANGUAGE
@ LANGUAGE
HeaderSetting::Kind::THEME
@ THEME
HeaderSetting::Kind::TEXT_SIZE
@ TEXT_SIZE
HeaderSetting::getDefaultAccessibilityLabel
std::string getDefaultAccessibilityLabel() override
HeaderSetting::draw
void draw(NVGcontext *vg, float x, float y, float width, float height, aurore::Style style, aurore::FrameContext *ctx) override
HeaderSetting::HeaderSetting
HeaderSetting(Kind kind)
HeaderSetting::hitTest
aurore::View * hitTest(aurore::Point point) override
Touched although it is not focusable.
HeaderSetting::getDefaultAccessibilityRole
aurore::AccessibilityRole getDefaultAccessibilityRole() override
A button: "Language, Français (France)", "Theme, Dark", "Text size, Larger".
Definition
header_settings.hpp:42
HeaderSetting::install
static void install()
aurore::FrameContext
Definition
frame_context.hpp:30
aurore::Style
Simple wrapper around StyleValues for the array operator.
Definition
style.hpp:115
aurore::View
Definition
view.hpp:232
aurore::AccessibilityRole
AccessibilityRole
Definition
view_style.hpp:78
aurore::AccessibilityRole::BUTTON
@ BUTTON
aurore::Point
Definition
geometry.hpp:26
aurore
cadran
view
header_settings.hpp
Generated by
1.9.8