From 63be93be646f72726b75427057e784b6a36b7295 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Thu, 30 Apr 2020 01:35:18 +0300 Subject: [PATCH] nyx: Use a static color for verifying bar indicator --- nyx/nyx_gui/frontend/fe_emmc_tools.c | 2 +- nyx/nyx_gui/frontend/gui.h | 1 + nyx/nyx_gui/frontend/gui_emmc_tools.c | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nyx/nyx_gui/frontend/fe_emmc_tools.c b/nyx/nyx_gui/frontend/fe_emmc_tools.c index 3ea9e5c..7cdbd09 100644 --- a/nyx/nyx_gui/frontend/fe_emmc_tools.c +++ b/nyx/nyx_gui/frontend/fe_emmc_tools.c @@ -186,7 +186,7 @@ static int _dump_emmc_verify(emmc_tool_gui_t *gui, sdmmc_storage_t *storage, u32 u32 pct = (u64)((u64)(lba_curr - part->lba_start) * 100u) / (u64)(part->lba_end - part->lba_start); lv_bar_set_value(gui->bar, pct); lv_bar_set_style(gui->bar, LV_BAR_STYLE_BG, gui->bar_teal_bg); - lv_bar_set_style(gui->bar, LV_BAR_STYLE_INDIC, lv_theme_get_current()->bar.indic); + lv_bar_set_style(gui->bar, LV_BAR_STYLE_INDIC, gui->bar_teal_ind); s_printf(gui->txt_buf, " "SYMBOL_DOT" %d%%", pct); lv_label_set_text(gui->label_pct, gui->txt_buf); manual_system_maintenance(true); diff --git a/nyx/nyx_gui/frontend/gui.h b/nyx/nyx_gui/frontend/gui.h index f867df9..37d238f 100644 --- a/nyx/nyx_gui/frontend/gui.h +++ b/nyx/nyx_gui/frontend/gui.h @@ -27,6 +27,7 @@ typedef struct _emmc_tool_gui_t lv_obj_t *label_finish; lv_obj_t *bar; lv_style_t *bar_teal_bg; + lv_style_t *bar_teal_ind; lv_style_t *bar_white_ind; char *txt_buf; char *base_path; diff --git a/nyx/nyx_gui/frontend/gui_emmc_tools.c b/nyx/nyx_gui/frontend/gui_emmc_tools.c index 959e035..31aee7a 100644 --- a/nyx/nyx_gui/frontend/gui_emmc_tools.c +++ b/nyx/nyx_gui/frontend/gui_emmc_tools.c @@ -108,17 +108,22 @@ static void _create_window_backup_restore(emmcPartType_t type, const char* win_l lv_obj_align(label_info, label_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 4, LV_DPI / 10); emmc_tool_gui_ctxt.label_info = label_info; - static lv_style_t bar_teal_bg, bar_white_ind; + static lv_style_t bar_teal_bg, bar_teal_ind, bar_white_ind; lv_style_copy(&bar_teal_bg, lv_theme_get_current()->bar.bg); bar_teal_bg.body.main_color = LV_COLOR_HEX(0x005a47); bar_teal_bg.body.grad_color = bar_teal_bg.body.main_color; + lv_style_copy(&bar_teal_ind, lv_theme_get_current()->bar.indic); + bar_teal_ind.body.main_color = LV_COLOR_HEX(0x00FFC9); + bar_teal_ind.body.grad_color = bar_teal_ind.body.main_color; + lv_style_copy(&bar_white_ind, lv_theme_get_current()->bar.indic); bar_white_ind.body.main_color = LV_COLOR_HEX(0xF0F0F0); bar_white_ind.body.grad_color = bar_white_ind.body.main_color; emmc_tool_gui_ctxt.bar_teal_bg = &bar_teal_bg; + emmc_tool_gui_ctxt.bar_teal_ind = &bar_teal_ind; emmc_tool_gui_ctxt.bar_white_ind = &bar_white_ind; lv_obj_t *bar = lv_bar_create(h1, NULL);