Connect Almanac UI to revision-bound career history (by Codex)
This commit is contained in:
1 parent
4b6c18f654
commit
959154c3c0
18 files changed
+405
-44
No files matched your search
+3
-13
@@ -787,6 +787,7 @@ class App final : public Rml::EventListener {
|
||||
bool stadium_event(Rml::Event &);
|
||||
std::string render_almanac();
|
||||
bool almanac_action(const std::string &, Rml::Element *);
|
||||
bool almanac_layout_update();
|
||||
std::string render_indoor();
|
||||
bool indoor_action(const std::string &, Rml::Element *);
|
||||
std::string training_balls(const std::string &, int, int, bool,
|
||||
@@ -1084,19 +1085,7 @@ class App final : public Rml::EventListener {
|
||||
bool changed = false;
|
||||
// History can contain every competition on one date. Keep its whole-row
|
||||
// buttons on the same centre even when the long list gains a scrollbar.
|
||||
if (auto *history = element("alm-day-list")) {
|
||||
if (auto *content = doc_->QuerySelector(".window .content")) {
|
||||
const float width = content->GetBox().GetSize(Rml::BoxArea::Content).x;
|
||||
if (std::abs(width - almanac_list_width_) >= .001f) {
|
||||
almanac_list_width_ = width;
|
||||
history->SetProperty("width", scalar(width) + "px");
|
||||
Rml::ElementList rows;
|
||||
history->QuerySelectorAll(rows, ".alm-list-head,.alm-match-row");
|
||||
for (auto *row : rows) row->SetProperty("width", scalar(width) + "px");
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
changed |= almanac_layout_update();
|
||||
auto *list = element("report-list");
|
||||
if (!list || !list->IsClassSet("match-list"))
|
||||
return changed;
|
||||
@@ -1541,6 +1530,7 @@ public:
|
||||
#include "modern/ui/engine_contracts.inc"
|
||||
#include "modern/ui/engine_calendar.inc"
|
||||
#include "modern/ui/engine_friendlies.inc"
|
||||
#include "modern/ui/engine_almanac.inc"
|
||||
} // namespace
|
||||
bool is_modern_world(const fs::path &file) {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user