Bind the tablet to real mailbox states and engine press events (by Codex)

This commit is contained in:
Codex committed 2026-10-29 11:20:49 +01:00
1 parent 0fc26624d9
commit 256d6d5211
15 files changed
+633 -44

No files matched your search

+3 -6
View File
@@ -51,11 +51,7 @@ void App::news_after_render() {
}
}
void App::news_update_feed() {
const auto s = snap();
const auto data = demo_news_view(
*s.world, s.state, news_view_.value("folder", "inbox"),
news_view_.value("query", ""),
ui_preferences_.at("display").value("language", std::string("de")));
const auto data=news_data(news_view_.value("folder","inbox"),news_view_.value("query",""));
if (!data.value("ok", false))
return;
if (auto *feed = element("news-feed")) {
@@ -110,6 +106,7 @@ bool App::news_commit(const Json &action, const std::string &feedback,
return true;
}
bool App::dispatch_news(const std::string &action, Rml::Element *target) {
if(engine_mode_)return engine_news_action(action,target);
if (!action.starts_with("news-"))
return false;
if (menu_ != "news" || !popup_.empty() || amount_)
@@ -238,7 +235,7 @@ bool App::news_event(Rml::Event &event) {
target->GetId() == "news-search" && news_dialog_.empty()) {
if (auto *input = dynamic_cast<Rml::ElementFormControl *>(target)) {
auto query = input->GetValue();
if (query.size() > 120)
if (!engine_mode_ && query.size() > 120)
query.resize(120);
news_view_["query"] = query;
news_view_["feedback"] = "";