mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-31 17:53:34 -07:00
Rename setting and use setting_enum()
This commit is contained in:
@@ -65,11 +65,11 @@ static void archive_update_formatted_path(ArchiveBrowserViewModel* model) {
|
||||
}
|
||||
|
||||
ArchiveTabEnum tab = archive_get_tab(browser);
|
||||
if(!momentum_settings.show_browser_path || archive_is_home(browser)) {
|
||||
if(!momentum_settings.browser_path_mode || archive_is_home(browser)) {
|
||||
furi_string_set(browser->formatted_path, ArchiveTabNames[tab]);
|
||||
} else {
|
||||
const char* path = furi_string_get_cstr(browser->path);
|
||||
switch(momentum_settings.show_browser_path) {
|
||||
switch(momentum_settings.browser_path_mode) {
|
||||
case BrowserPathFull:
|
||||
furi_string_set(browser->formatted_path, browser->path);
|
||||
break;
|
||||
|
||||
@@ -46,11 +46,11 @@ static void
|
||||
}
|
||||
|
||||
static void
|
||||
momentum_app_scene_interface_filebrowser_show_browser_path_changed(VariableItem* item) {
|
||||
momentum_app_scene_interface_filebrowser_browser_path_mode_changed(VariableItem* item) {
|
||||
MomentumApp* app = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
variable_item_set_current_value_text(item, browser_path_names[index]);
|
||||
momentum_settings.show_browser_path = index;
|
||||
momentum_settings.browser_path_mode = index;
|
||||
app->save_settings = true;
|
||||
}
|
||||
|
||||
@@ -100,11 +100,11 @@ void momentum_app_scene_interface_filebrowser_on_enter(void* context) {
|
||||
var_item_list,
|
||||
"Show Browser Path",
|
||||
BrowserPathModeCount,
|
||||
momentum_app_scene_interface_filebrowser_show_browser_path_changed,
|
||||
momentum_app_scene_interface_filebrowser_browser_path_mode_changed,
|
||||
app);
|
||||
variable_item_set_current_value_index(item, momentum_settings.show_browser_path);
|
||||
variable_item_set_current_value_index(item, momentum_settings.browser_path_mode);
|
||||
variable_item_set_current_value_text(
|
||||
item, browser_path_names[momentum_settings.show_browser_path]);
|
||||
item, browser_path_names[momentum_settings.browser_path_mode]);
|
||||
|
||||
item = variable_item_list_add(
|
||||
var_item_list,
|
||||
|
||||
@@ -30,7 +30,7 @@ MomentumSettings momentum_settings = {
|
||||
.sort_dirs_first = true, // ON
|
||||
.show_hidden_files = false, // OFF
|
||||
.show_internal_tab = false, // OFF
|
||||
.show_browser_path = BrowserPathOff, // OFF
|
||||
.browser_path_mode = BrowserPathOff, // OFF
|
||||
.favorite_timeout = 0, // OFF
|
||||
.dark_mode = false, // OFF
|
||||
.rgb_backlight = false, // OFF
|
||||
@@ -101,7 +101,7 @@ static const struct {
|
||||
{setting_bool(sort_dirs_first)},
|
||||
{setting_bool(show_hidden_files)},
|
||||
{setting_bool(show_internal_tab)},
|
||||
{setting_bool(show_browser_path)},
|
||||
{setting_enum(browser_path_mode, BrowserPathModeCount)},
|
||||
{setting_uint(favorite_timeout, 0, 60)},
|
||||
{setting_bool(dark_mode)},
|
||||
{setting_bool(rgb_backlight)},
|
||||
|
||||
@@ -87,7 +87,7 @@ typedef struct {
|
||||
bool sort_dirs_first;
|
||||
bool show_hidden_files;
|
||||
bool show_internal_tab;
|
||||
BrowserPathMode show_browser_path;
|
||||
BrowserPathMode browser_path_mode;
|
||||
uint32_t favorite_timeout;
|
||||
bool dark_mode;
|
||||
bool rgb_backlight;
|
||||
|
||||
Reference in New Issue
Block a user