Change Labels for Webui
This commit is contained in:
@@ -177,7 +177,9 @@ void ActivityManager::loop() {
|
||||
}
|
||||
|
||||
if (requestedUpdate) {
|
||||
taskENTER_CRITICAL(nullptr);
|
||||
requestedUpdate = false;
|
||||
taskEXIT_CRITICAL(nullptr);
|
||||
// Using direct notification to signal the render task to update
|
||||
// Increment counter so multiple rapid calls won't be lost
|
||||
if (renderTaskHandle) {
|
||||
@@ -299,7 +301,9 @@ void ActivityManager::requestUpdate(bool immediate) {
|
||||
} else {
|
||||
// Deferring the update until current loop is finished
|
||||
// This is to avoid multiple updates being requested in the same loop
|
||||
taskENTER_CRITICAL(nullptr);
|
||||
requestedUpdate = true;
|
||||
taskEXIT_CRITICAL(nullptr);
|
||||
}
|
||||
}
|
||||
void ActivityManager::requestUpdateAndWait() {
|
||||
|
||||
@@ -60,7 +60,7 @@ class ActivityManager {
|
||||
|
||||
// Whether to trigger a render after the current loop()
|
||||
// This variable must only be set by the main loop, to avoid race conditions
|
||||
bool requestedUpdate = false;
|
||||
volatile bool requestedUpdate = false;
|
||||
|
||||
// When true, input events are consumed (discarded) until all buttons are released
|
||||
// and no press/release events remain. Armed automatically on activity transitions
|
||||
|
||||
@@ -345,13 +345,17 @@ void HomeActivity::render(RenderLock&&) {
|
||||
}
|
||||
|
||||
if (hasOpdsUrl) {
|
||||
// Insert OPDS Browser after Recents (and Global Bookmarks if present)
|
||||
menuItems.insert(menuItems.begin() + insertAfterRecents, tr(STR_OPDS_BROWSER));
|
||||
menuIcons.insert(menuIcons.begin() + insertAfterRecents, Library);
|
||||
}
|
||||
|
||||
const HomeScreenLayout layout =
|
||||
computeHomeScreenLayout(metrics, contentRect.height, static_cast<int>(menuItems.size()));
|
||||
const int totalItems = static_cast<int>(recentBooks.size() + menuItems.size());
|
||||
if (selectorIndex >= totalItems) {
|
||||
selectorIndex = std::max(0, totalItems - 1);
|
||||
}
|
||||
|
||||
const int menuCount = static_cast<int>(menuItems.size());
|
||||
const HomeScreenLayout layout = computeHomeScreenLayout(metrics, contentRect.height, menuCount);
|
||||
|
||||
GUI.drawRecentBookCover(renderer,
|
||||
Rect{contentRect.x, metrics.homeTopPadding, contentRect.width, layout.recentTileHeight},
|
||||
@@ -362,7 +366,7 @@ void HomeActivity::render(RenderLock&&) {
|
||||
renderer,
|
||||
Rect{contentRect.x, metrics.homeTopPadding + layout.recentTileHeight + layout.recentToMenuGap, contentRect.width,
|
||||
layout.menuHeight},
|
||||
static_cast<int>(menuItems.size()), selectorIndex - recentBooks.size(),
|
||||
menuCount, selectorIndex - static_cast<int>(recentBooks.size()),
|
||||
[&menuItems](int index) { return std::string(menuItems[index]); },
|
||||
[&menuIcons](int index) { return menuIcons[index]; });
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ void CrossPointWebServerActivity::onExit() {
|
||||
}
|
||||
|
||||
LOG_DBG("WEBACT", "Free heap at onExit end: %d bytes", ESP.getFreeHeap());
|
||||
requestUpdate();
|
||||
}
|
||||
|
||||
void CrossPointWebServerActivity::onNetworkModeSelected(const NetworkMode mode) {
|
||||
|
||||
Reference in New Issue
Block a user