Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
prefs.hpp
Go to the documentation of this file.
1
// ui::prefs — what the user chose for Cadran's look: the language, the
2
// theme, the text size, the effects and the sidebar. The app keeps them in its own
3
// settings and hands them over with use_prefs() at start-up, before the
4
// first screen; the pickers (ui::pick_language…) change them there, then
5
// save them through ui::hooks::get().save_prefs.
6
// Copyright (C) 2026 JigSawFr. GPLv3-or-later (see LICENSE.GPL).
7
#pragma once
8
9
#include <string>
10
11
namespace
ui
12
{
13
16
struct
Prefs
17
{
18
std::string
language
=
"system"
;
19
std::string
theme
=
"dark"
;
24
std::string
theme_file
;
25
std::string
text_size
=
"auto"
;
26
std::string
effects
=
"auto"
;
27
bool
glow
=
true
;
31
std::string
rail
=
"auto"
;
32
};
33
34
constexpr
const
char
*
LANGUAGES
[] = {
"system"
,
"en-US"
,
"fr"
,
"fr-CA"
,
"de"
,
"es"
,
"es-419"
,
"it"
,
"nl"
,
35
"pt"
,
"pt-BR"
,
"ru"
,
"ja"
,
"ko"
,
"zh-Hans"
,
"zh-Hant"
};
36
constexpr
const
char
*
THEMES
[] = {
"system"
,
"light"
,
"dark"
};
37
constexpr
const
char
*
TEXT_SIZES
[] = {
"auto"
,
"normal"
,
"large"
,
"largest"
};
38
constexpr
const
char
*
EFFECTS
[] = {
"auto"
,
"full"
,
"reduced"
};
39
constexpr
const
char
*
RAILS
[] = {
"auto"
,
"open"
,
"icons"
};
40
42
Prefs
&
prefs
();
44
void
use_prefs
(
Prefs
& p);
45
48
bool
env_flag
(
const
char
* name);
49
50
}
// namespace ui
effects
Definition
effects.hpp:14
text_size
Definition
text_size.hpp:14
ui
Definition
action_sheet.hpp:11
ui::TEXT_SIZES
constexpr const char * TEXT_SIZES[]
Definition
prefs.hpp:37
ui::RAILS
constexpr const char * RAILS[]
Definition
prefs.hpp:39
ui::use_prefs
void use_prefs(Prefs &p)
From now on, prefs() is p, which must outlive every screen.
ui::EFFECTS
constexpr const char * EFFECTS[]
Definition
prefs.hpp:38
ui::prefs
Prefs & prefs()
The ones in use: the app's (use_prefs), else defaults of their own.
ui::env_flag
bool env_flag(const char *name)
ui::THEMES
constexpr const char * THEMES[]
Definition
prefs.hpp:36
ui::LANGUAGES
constexpr const char * LANGUAGES[]
Definition
prefs.hpp:34
ui::Prefs
Definition
prefs.hpp:17
ui::Prefs::theme_file
std::string theme_file
Definition
prefs.hpp:24
ui::Prefs::glow
bool glow
Definition
prefs.hpp:27
ui::Prefs::language
std::string language
"system" or one of LANGUAGES
Definition
prefs.hpp:18
ui::Prefs::rail
std::string rail
Definition
prefs.hpp:31
ui::Prefs::theme
std::string theme
Definition
prefs.hpp:19
aurore
cadran
ui
prefs.hpp
Generated by
1.9.8