Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
home_tab_button_color.h
Go to the documentation of this file.
1#ifndef COCKATRICE_HOME_TAB_BUTTON_COLOR_H
2#define COCKATRICE_HOME_TAB_BUTTON_COLOR_H
3
4#include <QList>
5
7{
8
17
18struct Entry
19{
21 const char *trKey;
22};
23
24inline QList<Entry> all()
25{
26 static QList<Entry> entries = {{Automatic, QT_TR_NOOP("Automatic")},
27 {FromBackground, QT_TR_NOOP("Extract from background")}};
28
29 return entries;
30}
31
38inline Source intToSource(int value)
39{
40 if (value > FromBackground) {
41 return Automatic; // default
42 }
43
44 return static_cast<Source>(value);
45}
46
47} // namespace HomeTabButtonColor
48
49#endif // COCKATRICE_HOME_TAB_BUTTON_COLOR_H
Definition home_tab_button_color.h:7
QList< Entry > all()
Definition home_tab_button_color.h:24
Source intToSource(int value)
Definition home_tab_button_color.h:38
Source
Where to get the colors for the home tab buttons from.
Definition home_tab_button_color.h:13
@ FromBackground
Always extract color from background.
Definition home_tab_button_color.h:15
@ Automatic
Extract color from background, or use theme color if no background.
Definition home_tab_button_color.h:14
Definition home_tab_button_color.h:19
const char * trKey
key for translation
Definition home_tab_button_color.h:21
Source source
Definition home_tab_button_color.h:20