Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,14 @@ void InkHUD::MenuApplet::onButtonShortPress()
if (!settings->joystick.enabled) {
if (!cursorShown) {
cursorShown = true;
// Select the first item that isn't a header
cursor = 0;
while (cursor < items.size() && items.at(cursor).isHeader)
Comment thread
zeropt marked this conversation as resolved.
Outdated
cursor++;
if (cursor >= items.size()) {
cursorShown = false;
cursor = 0;
}
Comment thread
HarukiToreda marked this conversation as resolved.
} else {
do {
cursor = (cursor + 1) % items.size();
Expand Down Expand Up @@ -1576,7 +1583,15 @@ void InkHUD::MenuApplet::onNavUp()

if (!cursorShown) {
cursorShown = true;
cursor = 0;
// Select the last item that isn't a header
cursor = items.size() - 1;
while (items.at(cursor).isHeader) {
if (cursor == 0) {
cursorShown = false;
break;
Comment thread
HarukiToreda marked this conversation as resolved.
}
cursor--;
}
} else {
do {
if (cursor == 0)
Expand All @@ -1597,7 +1612,14 @@ void InkHUD::MenuApplet::onNavDown()

if (!cursorShown) {
cursorShown = true;
// Select the first item that isn't a header
cursor = 0;
while (cursor < items.size() && items.at(cursor).isHeader)
Comment thread
zeropt marked this conversation as resolved.
Outdated
cursor++;
if (cursor >= items.size()) {
cursorShown = false;
cursor = 0;
}
} else {
do {
cursor = (cursor + 1) % items.size();
Expand Down
Loading