feat: Add touch coordinate mapping and RTOS task yielding (#2481)
Co-authored-by: Julia Nguyen <julia@uxj.io>
This commit is contained in:
co-authored by
Julia Nguyen
parent
c9188a7347
commit
f42fab1c66
@@ -127,6 +127,21 @@ void StatusBarSettingsActivity::onExit() { Activity::onExit(); }
|
||||
void StatusBarSettingsActivity::loop() {
|
||||
if (optionPopup.handleInput(mappedInput, [this] { requestUpdate(); })) return;
|
||||
|
||||
const auto& metrics = UITheme::getInstance().getMetrics();
|
||||
const int contentTop = metrics.topPadding + metrics.headerHeight + metrics.verticalSpacing;
|
||||
const int contentHeight =
|
||||
renderer.getScreenHeight() - contentTop - metrics.buttonHintsHeight - metrics.verticalSpacing * 2;
|
||||
switch (handleListTouch(selectedIndex, visibleItemCount, contentTop, contentHeight, false)) {
|
||||
case ListTouchResult::Activated:
|
||||
handleSelection();
|
||||
requestUpdate();
|
||||
return;
|
||||
case ListTouchResult::Consumed:
|
||||
return;
|
||||
case ListTouchResult::None:
|
||||
break;
|
||||
}
|
||||
|
||||
if (mappedInput.wasPressed(MappedInputManager::Button::Back)) {
|
||||
finish();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user