nyx: config: rename entries column var

This commit is contained in:
CTCaer
2022-10-11 06:24:52 +03:00
parent 7cac7fe095
commit f5fb0a1ee9
5 changed files with 58 additions and 54 deletions

View File

@@ -1568,8 +1568,8 @@ static const launch_button_pos_t launch_button_pos10[10] = {
static lv_res_t _create_window_home_launch(lv_obj_t *btn)
{
const u32 max_entries = n_cfg.entries_5_columns ? 10 : 8;
const launch_button_pos_t *launch_button_pos = n_cfg.entries_5_columns ? launch_button_pos10 : launch_button_pos8;
const u32 max_entries = n_cfg.entries_5_col ? 10 : 8;
const launch_button_pos_t *launch_button_pos = n_cfg.entries_5_col ? launch_button_pos10 : launch_button_pos8;
char *icon_path;
@@ -1660,7 +1660,7 @@ static lv_res_t _create_window_home_launch(lv_obj_t *btn)
lv_obj_set_style(boot_entry_lbl_cont, &btn_label_home_transp);
// Create the rest of the buttons.
for (u32 btn_idx = 1; btn_idx < (n_cfg.entries_5_columns ? 10 : 8); btn_idx++)
for (u32 btn_idx = 1; btn_idx < (n_cfg.entries_5_col ? 10 : 8); btn_idx++)
{
btn_boot_entry = lv_btn_create(win, btn_boot_entry);
launch_ctxt.btn[btn_idx] = btn_boot_entry;
@@ -1672,7 +1672,7 @@ static lv_res_t _create_window_home_launch(lv_obj_t *btn)
launch_ctxt.label[btn_idx] = boot_entry_label;
}
// Create colorized icon style based on its parrent style.
// Create colorized icon style based on its parent style.
static lv_style_t img_style;
lv_style_copy(&img_style, &lv_style_plain);
img_style.image.color = lv_color_hsv_to_rgb(n_cfg.theme_color, 100, 100);
@@ -1850,7 +1850,7 @@ ini_parsing:
ini_parse_failed:
// Reiterate the loop with more cfgs if combined.
if (combined_cfg && (curr_btn_idx < (n_cfg.entries_5_columns ? 10 : 8)) && !more_cfg)
if (combined_cfg && (curr_btn_idx < (n_cfg.entries_5_col ? 10 : 8)) && !more_cfg)
goto ini_parsing;
failed_sd_mount:

View File

@@ -23,7 +23,7 @@
#include <libs/lvgl/lvgl.h>
#define CLOCK_MIN_YEAR 2022
#define CLOCK_MAX_YEAR 2032
#define CLOCK_MAX_YEAR (CLOCK_MIN_YEAR + 10)
extern hekate_config h_cfg;
extern nyx_config n_cfg;
@@ -339,10 +339,10 @@ static lv_res_t _data_verification_action(lv_obj_t *ddlist)
static lv_res_t _entries_columns_action(lv_obj_t *btn)
{
n_cfg.entries_5_columns = !n_cfg.entries_5_columns;
n_cfg.entries_5_col = !n_cfg.entries_5_col;
nyx_changes_made = true;
if (!n_cfg.entries_5_columns)
if (!n_cfg.entries_5_col)
lv_btn_set_state(btn, LV_BTN_STATE_REL);
else
lv_btn_set_state(btn, LV_BTN_STATE_TGL_REL);
@@ -1083,7 +1083,7 @@ lv_res_t create_win_nyx_options(lv_obj_t *parrent_btn)
lv_obj_t *btn2 = lv_btn_create(sw_h2, NULL);
nyx_create_onoff_button(th, sw_h2, btn2, SYMBOL_GPS" Extended Boot Entries", _entries_columns_action, true);
lv_obj_align(btn2, line_sep, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 10);
if (n_cfg.entries_5_columns)
if (n_cfg.entries_5_col)
lv_btn_set_state(btn2, LV_BTN_STATE_TGL_REL);
nyx_generic_onoff_toggle(btn2);