Port environment, advertising and Toto menus to native Modern UI (by Codex)

This commit is contained in:
Codex committed 2026-10-24 11:12:25 +02:00
1 parent 0aa0ed68ca
commit d92cfc3110
36 files changed
+1805 -13

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: GPL-3.0-only
bool App::environment_action(const std::string &action, Rml::Element *target) {
if (action != "environment-level") return false;
if (menu_ != "environment" || !source_ || !target) return true;
const auto index = target->GetAttribute<Rml::String>("data-index", "");
const auto value = target->GetAttribute<Rml::String>("data-id", "");
if (index.size() != 1 || index[0] < '0' || index[0] > '5' ||
value.size() != 1 || value[0] < '0' || value[0] > '6') return true;
const auto snapshot = snap();
const auto result = source_->apply({snapshot.revision, "environment",
{{"kind", "level"}, {"index", index[0] - '0'}, {"value", value[0] - '0'}}});
if (!result.ok) {
message("Das Umfeldbudget konnte nicht übernommen werden. Bitte die Ansicht mit dem aktuellen Stand erneut öffnen.");
return true;
}
focus_after_render_ = target->GetId();
refresh();
return true;
}