-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.h
87 lines (73 loc) · 3.74 KB
/
styles.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#pragma once
#include <lvgl.h>
// Should we use themes?
class Styles {
private:
Styles(){
lv_style_init(&RoomWidgetBaseStyle);
lv_style_set_shadow_width(&RoomWidgetBaseStyle, 5);
lv_style_set_shadow_spread(&RoomWidgetBaseStyle, 5);
lv_style_set_shadow_color(&RoomWidgetBaseStyle, lv_palette_darken(LV_PALETTE_GREY, 4));
lv_style_set_text_font(&RoomWidgetBaseStyle, &lv_font_montserrat_28);
lv_style_set_bg_color(&RoomWidgetBaseStyle, lv_palette_lighten(LV_PALETTE_GREY, 1));
lv_style_set_bg_grad_color(&RoomWidgetBaseStyle, lv_palette_darken(LV_PALETTE_GREY, 2));
lv_style_set_bg_grad_dir(&RoomWidgetBaseStyle, LV_GRAD_DIR_VER);
lv_style_set_text_color(&RoomWidgetBaseStyle, lv_color_white());
lv_style_init(&RoomWidgetNameStyle);
lv_style_set_text_font(&RoomWidgetNameStyle, &lv_font_montserrat_24);
lv_style_init(&RoomWidgetTempStyle);
lv_style_set_text_font(&RoomWidgetTempStyle, &lv_font_montserrat_16);
lv_style_init(&RoomWidgetSetPointStyle);
lv_style_set_text_font(&RoomWidgetSetPointStyle, &lv_font_montserrat_16);
lv_style_init(&RoomNameStyle);
lv_style_set_text_font(&RoomNameStyle, &lv_font_montserrat_44);
lv_style_init(&DialogStyle);
lv_style_set_bg_color(&DialogStyle, lv_palette_lighten(LV_PALETTE_GREY, 1));
lv_style_init(&DialogButtonStyle);
lv_style_set_bg_color(&DialogButtonStyle, lv_palette_darken(LV_PALETTE_GREY, 2));
lv_style_set_border_color(&DialogButtonStyle, lv_palette_darken(LV_PALETTE_GREY, 4));
lv_style_set_border_width(&DialogButtonStyle, 3);
lv_style_init(&DialogSliderStyle);
lv_style_set_bg_color(&DialogSliderStyle, lv_palette_darken(LV_PALETTE_GREY, 2));
lv_style_set_border_color(&DialogSliderStyle, lv_palette_darken(LV_PALETTE_GREY, 4));
lv_style_set_border_width(&DialogSliderStyle, 3);
lv_style_set_bg_grad_color(&DialogSliderStyle,lv_palette_main(LV_PALETTE_GREY));
lv_style_set_bg_grad_dir(&DialogSliderStyle,LV_GRAD_DIR_HOR);
lv_style_set_shadow_color(&DialogSliderStyle,lv_palette_main(LV_PALETTE_GREY));
lv_style_set_shadow_width(&DialogSliderStyle, 10);
lv_style_set_shadow_spread(&DialogSliderStyle, 1);
lv_style_set_text_font(&DialogSliderStyle, &lv_font_montserrat_30);
lv_style_init(&DialogSliderActiveStyle);
lv_style_set_bg_color(&DialogSliderActiveStyle, lv_palette_darken(LV_PALETTE_GREY, 2));
lv_style_set_border_color(&DialogSliderActiveStyle, lv_palette_darken(LV_PALETTE_GREY, 4));
lv_style_set_border_width(&DialogSliderActiveStyle, 3);
lv_style_set_bg_color(&DialogSliderActiveStyle, lv_palette_darken(LV_PALETTE_GREY, 3));
lv_style_set_text_font(&DialogSliderActiveStyle, &lv_font_montserrat_44);
lv_style_init(&MainButtonStyle);
lv_style_set_bg_color(&MainButtonStyle, lv_palette_darken(LV_PALETTE_GREY, 2));
lv_style_set_border_color(&MainButtonStyle, lv_palette_darken(LV_PALETTE_GREY, 1));
lv_style_set_border_width(&MainButtonStyle, 3);
lv_style_set_bg_color(&MainButtonStyle, lv_palette_lighten(LV_PALETTE_GREY, 3));
lv_style_set_bg_grad_color(&MainButtonStyle, lv_palette_darken(LV_PALETTE_GREY, 4));
lv_style_set_bg_grad_dir(&MainButtonStyle, LV_GRAD_DIR_VER);
lv_style_set_text_font(&MainButtonStyle, &lv_font_montserrat_20);
};
public:
static Styles &getInstance() {
static Styles instance;
return instance;
};
Styles(Styles const &) = delete;
void operator=(Styles const &) = delete;
lv_style_t RoomWidgetBaseStyle;
lv_style_t RoomWidgetNameStyle;
lv_style_t RoomWidgetTempStyle;
lv_style_t RoomWidgetSetPointStyle;
lv_style_t RoomNameStyle;
lv_style_t DialogStyle;
lv_style_t DialogButtonStyle;
lv_style_t MainButtonStyle;
lv_style_t DialogSliderStyle;
lv_style_t DialogSliderActiveStyle;
lv_style_t LedStyle;
};