优化额度条边框和重置时间显示
This commit is contained in:
parent
e528569644
commit
01df67dc65
@ -234,7 +234,8 @@ static lv_obj_t *make_quota_bar(lv_obj_t *parent, int w, int h)
|
||||
{
|
||||
lv_obj_t *bar = make_bar(parent, w, h);
|
||||
lv_obj_set_style_bg_color(bar, soft_fill(), 0);
|
||||
lv_obj_set_style_border_width(bar, 0, 0);
|
||||
lv_obj_set_style_border_color(bar, ink(), 0);
|
||||
lv_obj_set_style_border_width(bar, 1, 0);
|
||||
lv_obj_set_style_radius(bar, 1, 0);
|
||||
lv_obj_set_style_pad_all(bar, 0, 0);
|
||||
lv_obj_set_style_radius(bar, 1, LV_PART_INDICATOR);
|
||||
@ -299,13 +300,11 @@ static void format_reset_mins(int mins, char *out, size_t out_size)
|
||||
if (mins < 0) {
|
||||
snprintf(out, out_size, "--");
|
||||
} else if (mins >= 1440) {
|
||||
int days = mins / 1440;
|
||||
int hours = (mins % 1440) / 60;
|
||||
snprintf(out, out_size, "%dd%dh", days, hours);
|
||||
snprintf(out, out_size, "%dD", mins / 1440);
|
||||
} else if (mins >= 60) {
|
||||
snprintf(out, out_size, "%dh%02d", mins / 60, mins % 60);
|
||||
snprintf(out, out_size, "%dH", mins / 60);
|
||||
} else {
|
||||
snprintf(out, out_size, "%dm", mins);
|
||||
snprintf(out, out_size, "%dM", mins);
|
||||
}
|
||||
}
|
||||
|
||||
@ -732,10 +731,11 @@ void ui_screen_create(void)
|
||||
lv_obj_align(s_codex_today_label, LV_ALIGN_TOP_LEFT, 126, 184);
|
||||
|
||||
s_codex_5h_label = make_label(screen, "5H", &lv_font_montserrat_14);
|
||||
lv_obj_set_width(s_codex_5h_label, 24);
|
||||
lv_label_set_long_mode(s_codex_5h_label, LV_LABEL_LONG_CLIP);
|
||||
lv_obj_set_width(s_codex_5h_label, 30);
|
||||
lv_obj_align(s_codex_5h_label, LV_ALIGN_TOP_LEFT, 8, 204);
|
||||
s_codex_5h_bar = make_quota_bar(screen, 84, 7);
|
||||
lv_obj_align(s_codex_5h_bar, LV_ALIGN_TOP_LEFT, 34, 209);
|
||||
s_codex_5h_bar = make_quota_bar(screen, 80, 8);
|
||||
lv_obj_align(s_codex_5h_bar, LV_ALIGN_TOP_LEFT, 38, 208);
|
||||
s_codex_5h_value_label = make_label(screen, "--", &lv_font_montserrat_14);
|
||||
lv_obj_set_width(s_codex_5h_value_label, 34);
|
||||
lv_obj_set_style_text_align(s_codex_5h_value_label, LV_TEXT_ALIGN_RIGHT, 0);
|
||||
@ -746,10 +746,11 @@ void ui_screen_create(void)
|
||||
lv_obj_align(s_codex_5h_reset_label, LV_ALIGN_TOP_LEFT, 158, 204);
|
||||
|
||||
s_codex_week_label = make_label(screen, "WK", &lv_font_montserrat_14);
|
||||
lv_obj_set_width(s_codex_week_label, 24);
|
||||
lv_label_set_long_mode(s_codex_week_label, LV_LABEL_LONG_CLIP);
|
||||
lv_obj_set_width(s_codex_week_label, 30);
|
||||
lv_obj_align(s_codex_week_label, LV_ALIGN_TOP_LEFT, 8, 224);
|
||||
s_codex_week_bar = make_quota_bar(screen, 84, 7);
|
||||
lv_obj_align(s_codex_week_bar, LV_ALIGN_TOP_LEFT, 34, 229);
|
||||
s_codex_week_bar = make_quota_bar(screen, 80, 8);
|
||||
lv_obj_align(s_codex_week_bar, LV_ALIGN_TOP_LEFT, 38, 228);
|
||||
s_codex_week_value_label = make_label(screen, "--", &lv_font_montserrat_14);
|
||||
lv_obj_set_width(s_codex_week_value_label, 34);
|
||||
lv_obj_set_style_text_align(s_codex_week_value_label, LV_TEXT_ALIGN_RIGHT, 0);
|
||||
@ -784,10 +785,11 @@ void ui_screen_create(void)
|
||||
lv_obj_align(s_zhipu_today_label, LV_ALIGN_TOP_LEFT, 326, 184);
|
||||
|
||||
s_zhipu_5h_label = make_label(screen, "5H", &lv_font_montserrat_14);
|
||||
lv_obj_set_width(s_zhipu_5h_label, 24);
|
||||
lv_label_set_long_mode(s_zhipu_5h_label, LV_LABEL_LONG_CLIP);
|
||||
lv_obj_set_width(s_zhipu_5h_label, 30);
|
||||
lv_obj_align(s_zhipu_5h_label, LV_ALIGN_TOP_LEFT, 208, 204);
|
||||
s_zhipu_5h_bar = make_quota_bar(screen, 84, 7);
|
||||
lv_obj_align(s_zhipu_5h_bar, LV_ALIGN_TOP_LEFT, 234, 209);
|
||||
s_zhipu_5h_bar = make_quota_bar(screen, 80, 8);
|
||||
lv_obj_align(s_zhipu_5h_bar, LV_ALIGN_TOP_LEFT, 238, 208);
|
||||
s_zhipu_5h_value_label = make_label(screen, "--", &lv_font_montserrat_14);
|
||||
lv_obj_set_width(s_zhipu_5h_value_label, 34);
|
||||
lv_obj_set_style_text_align(s_zhipu_5h_value_label, LV_TEXT_ALIGN_RIGHT, 0);
|
||||
@ -798,10 +800,11 @@ void ui_screen_create(void)
|
||||
lv_obj_align(s_zhipu_5h_reset_label, LV_ALIGN_TOP_LEFT, 358, 204);
|
||||
|
||||
s_zhipu_week_label = make_label(screen, "WK", &lv_font_montserrat_14);
|
||||
lv_obj_set_width(s_zhipu_week_label, 24);
|
||||
lv_label_set_long_mode(s_zhipu_week_label, LV_LABEL_LONG_CLIP);
|
||||
lv_obj_set_width(s_zhipu_week_label, 30);
|
||||
lv_obj_align(s_zhipu_week_label, LV_ALIGN_TOP_LEFT, 208, 224);
|
||||
s_zhipu_week_bar = make_quota_bar(screen, 84, 7);
|
||||
lv_obj_align(s_zhipu_week_bar, LV_ALIGN_TOP_LEFT, 234, 229);
|
||||
s_zhipu_week_bar = make_quota_bar(screen, 80, 8);
|
||||
lv_obj_align(s_zhipu_week_bar, LV_ALIGN_TOP_LEFT, 238, 228);
|
||||
s_zhipu_week_value_label = make_label(screen, "--", &lv_font_montserrat_14);
|
||||
lv_obj_set_width(s_zhipu_week_value_label, 34);
|
||||
lv_obj_set_style_text_align(s_zhipu_week_value_label, LV_TEXT_ALIGN_RIGHT, 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user