-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
77 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "Styles.h" | ||
|
||
|
||
namespace gfx | ||
{ | ||
Styles::Styles() | ||
{ | ||
lv_style_init(&mainStyle); | ||
lv_style_set_border_width(&mainStyle, LV_STATE_DEFAULT, 0); | ||
lv_style_set_pad_inner(&mainStyle, LV_STATE_DEFAULT, 0); | ||
lv_style_set_pad_left(&mainStyle, LV_STATE_DEFAULT, 0); | ||
lv_style_set_pad_right(&mainStyle, LV_STATE_DEFAULT, 0); | ||
lv_style_set_bg_color(&mainStyle, LV_STATE_DEFAULT, LV_COLOR_BLACK); | ||
lv_style_set_text_color(&mainStyle, LV_STATE_DEFAULT, LV_COLOR_WHITE); | ||
lv_obj_report_style_mod(&mainStyle); | ||
|
||
lv_style_copy(&switchBtnContStyle, &mainStyle); | ||
lv_style_set_bg_color(&switchBtnContStyle, LV_STATE_DEFAULT, LV_COLOR_BLACK); | ||
lv_style_set_bg_color(&switchBtnContStyle, LV_STATE_PRESSED, LV_COLOR_GRAY); | ||
lv_style_set_bg_color(&switchBtnContStyle, LV_STATE_FOCUSED, LV_COLOR_RED); | ||
lv_style_set_bg_color(&switchBtnContStyle, LV_STATE_FOCUSED | LV_STATE_PRESSED, lv_color_hex(0xf88)); | ||
lv_style_set_border_width(&switchBtnContStyle, LV_STATE_DEFAULT, 0); | ||
lv_style_set_text_font(&switchBtnContStyle, LV_STATE_DEFAULT, &lv_font_montserrat_8); | ||
lv_style_set_pad_inner(&switchBtnContStyle, LV_STATE_DEFAULT, 2); | ||
lv_style_set_pad_top(&switchBtnContStyle, LV_STATE_DEFAULT, 20); | ||
lv_style_set_pad_bottom(&switchBtnContStyle, LV_STATE_DEFAULT, 5); | ||
|
||
lv_style_copy(&sensorBtnContStyle, &mainStyle); | ||
lv_style_set_bg_color(&sensorBtnContStyle, LV_STATE_DEFAULT, LV_COLOR_BLACK); | ||
lv_style_set_bg_color(&sensorBtnContStyle, LV_STATE_PRESSED, LV_COLOR_GRAY); | ||
lv_style_set_bg_color(&sensorBtnContStyle, LV_STATE_FOCUSED, LV_COLOR_RED); | ||
lv_style_set_bg_color(&sensorBtnContStyle, LV_STATE_FOCUSED | LV_STATE_PRESSED, lv_color_hex(0xf88)); | ||
lv_style_set_border_width(&sensorBtnContStyle, LV_STATE_DEFAULT, 0); | ||
lv_style_set_text_font(&sensorBtnContStyle, LV_STATE_DEFAULT, &lv_font_montserrat_12); | ||
lv_style_set_pad_inner(&sensorBtnContStyle, LV_STATE_DEFAULT, 2); | ||
lv_style_set_pad_top(&sensorBtnContStyle, LV_STATE_DEFAULT, 18); | ||
lv_style_set_pad_bottom(&sensorBtnContStyle, LV_STATE_DEFAULT, 5); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
#include "lvgl.h" | ||
|
||
namespace gfx | ||
{ | ||
class Styles | ||
{ | ||
public: | ||
static Styles &getInstance() | ||
{ | ||
static Styles instance; | ||
return instance; | ||
}; | ||
static void init(); | ||
Styles(); | ||
lv_style_t mainStyle; | ||
lv_style_t switchBtnContStyle; | ||
lv_style_t sensorBtnContStyle; | ||
|
||
private: | ||
}; | ||
} // namespace gfx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters