#include #include #include #include #include "core/task.hpp" #include "support/fixed_metrics.hpp" #include "ui/application.hpp" #include "ui/label.hpp" #include "ui/theme.hpp" #include "ui/widgets.hpp" using namespace playfin; using namespace playfin::ui; using playfin::platform::Action; using playfin::platform::Event; namespace { bool same(Color a, Color b) { return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a; } const Label* labelOf(const View& view) { for (const auto& child : view.children()) { if (const auto* label = dynamic_cast(child.get())) { return label; } } return nullptr; } struct Rig { core::WorkerPool pool{1}; core::MainQueue mainQueue; test::FixedMetrics metrics; std::unique_ptr app; Rig() { app = std::make_unique(Application::Services{pool, mainQueue, metrics, nullptr}); } ~Rig() { applyAccent(accentPalette().front()); } }; struct TwoButtons : Screen { Button* first; Button* second; TwoButtons() { auto* row = add(Axis::Row); first = row->add