mirror of
https://git.wetfence.xyz/RandyTheSilly/jellyPod.git
synced 2026-10-26 23:39:56 -04:00
Require a scroll up to access scoped shuffle buttons (play sequentially by default)
This commit is contained in:
1 parent
cd4f5eebb1
commit
ee33a57962
2 files changed
+19
-5
No files matched your search
+17
-5
@@ -68,6 +68,17 @@ static const char *get_current_scope_subscope() {
|
||||
}
|
||||
}
|
||||
|
||||
static uint16_t get_scope_shuffle_row_count(NavScope scope) {
|
||||
switch (scope) {
|
||||
case NAV_SCOPE_ALBUMS:
|
||||
return 2;
|
||||
case NAV_SCOPE_ALBUM_TRACKS:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////// PKJS //////////////////////
|
||||
|
||||
static void outbox_failed_handler(DictionaryIterator *iter, AppMessageResult reason, void *context) {
|
||||
@@ -118,6 +129,11 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
||||
snprintf(s_nav_history.last_subscope[s_current_menu_scope], sizeof(s_nav_history.last_subscope[s_current_menu_scope]), "%s", subscope);
|
||||
}
|
||||
}
|
||||
// require the user to scroll up to reach shuffle rows
|
||||
uint16_t shuffle_rows = get_scope_shuffle_row_count(s_current_menu_scope);
|
||||
if (scroll_row < shuffle_rows) {
|
||||
scroll_row = shuffle_rows;
|
||||
}
|
||||
s_nav_history.scroll_row[s_current_menu_scope] = scroll_row;
|
||||
menu_layer_reload_data(s_menu_layer);
|
||||
menu_layer_set_selected_index(s_menu_layer, MenuIndex(0, scroll_row), MenuRowAlignTop, false);
|
||||
@@ -238,12 +254,8 @@ static uint16_t menu_get_num_rows(MenuLayer *menu_layer, uint16_t section_index,
|
||||
switch (s_current_menu_scope) {
|
||||
case NAV_SCOPE_MAIN:
|
||||
return 4;
|
||||
case NAV_SCOPE_ALBUMS:
|
||||
return s_menu_items_count + 2; // account for shuffle buttons insertion
|
||||
case NAV_SCOPE_ALBUM_TRACKS:
|
||||
return s_menu_items_count + 1; // account for shuffle button insertion
|
||||
default:
|
||||
return s_menu_items_count;
|
||||
return s_menu_items_count + get_scope_shuffle_row_count(s_current_menu_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user