Mercurial > molko
comparison libmlk-ui/mlk/ui/style.h @ 605:a8094fad01a1
ui: rework styles
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 11 Aug 2023 19:22:00 +0200 |
parents | ed1d3244ed57 |
children |
comparison
equal
deleted
inserted
replaced
604:dd80b59fffaf | 605:a8094fad01a1 |
---|---|
1 #ifndef MLK_UI_STYLE_H | 1 #ifndef MLK_UI_STYLE_H |
2 #define MLK_UI_STYLE_H | 2 #define MLK_UI_STYLE_H |
3 | 3 |
4 /* https://lospec.com/palette-list/duel */ | |
5 | |
6 #define MLK_STYLE_PADDING (10) | |
7 #define MLK_STYLE_BG_COLOR (0xf5f7faff) | |
8 #define MLK_STYLE_FG_COLOR (0x000000ff) | |
9 #define MLK_STYLE_BORDER_COLOR (0xcdd2daff) | |
10 #define MLK_STYLE_BORDER_SIZE (2) | |
11 #define MLK_STYLE_TEXT_COLOR (0x222323ff) | |
12 #define MLK_STYLE_SELECTED_COLOR (0x55b67dff) | |
13 #define MLK_STYLE_ANIMATION (500) | |
14 | |
15 struct mlk_font; | 4 struct mlk_font; |
16 | 5 |
6 struct mlk_style_color { | |
7 unsigned long bg; | |
8 unsigned long fg; | |
9 unsigned long border; | |
10 unsigned long text; | |
11 }; | |
12 | |
13 struct mlk_style_geo { | |
14 unsigned short border; | |
15 unsigned short padding; | |
16 }; | |
17 | |
18 struct mlk_style_attr { | |
19 struct mlk_style_color color; | |
20 struct mlk_style_geo geo; | |
21 struct mlk_font *font; | |
22 }; | |
23 | |
17 struct mlk_style { | 24 struct mlk_style { |
18 unsigned int padding; | 25 struct mlk_style_attr normal; |
19 unsigned long bg_color; | 26 struct mlk_style_attr selected; |
20 unsigned long fg_color; | |
21 unsigned long border_color; | |
22 unsigned int border_size; | |
23 unsigned long text_color; | |
24 unsigned long selected_color; | |
25 unsigned int animation; | |
26 struct mlk_font *text_font; | |
27 }; | 27 }; |
28 | 28 |
29 extern struct mlk_style mlk_style; | 29 extern struct mlk_style mlk_style; |
30 | 30 |
31 void | |
32 mlk_style_init(struct mlk_style *style); | |
33 | |
34 #endif /* MLK_UI_STYLE_H */ | 31 #endif /* MLK_UI_STYLE_H */ |