From: Daniel Karbach Date: Sat, 9 Dec 2017 23:10:47 +0000 (+0100) Subject: reorder record panel X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=41ee8b5d0229752576a55e102d8510ea1dbc909b;p=blobs.git reorder record panel --- diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index 9d73b92..126e307 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -316,21 +316,28 @@ RecordsPanel::RecordsPanel(world::Simulation &sim) holders.reserve(sim.Records().size() * (world::Record::MAX + 1)); int ri = 0; for (const auto &r : sim.Records()) { + Panel *by_panel = new Panel; + by_panel + ->Direction(Panel::VERTICAL); + Panel *val_panel = new Panel; + val_panel + ->Direction(Panel::VERTICAL); + Panel *tab_panel = new Panel; + tab_panel + ->Direction(Panel::HORIZONTAL) + ->Spacing(10.0f) + ->Add(by_panel) + ->Add(val_panel); Label *rec_label = new Label(sim.Assets().fonts.medium); rec_label->Text(r.name); - Label *by_label = new Label(sim.Assets().fonts.medium); - by_label->Text("By"); Panel *rec_panel = new Panel; rec_panel ->Direction(Panel::VERTICAL) - ->Add(rec_label); - Panel *by_panel = new Panel; - by_panel - ->Direction(Panel::VERTICAL) - ->Add(by_label); + ->Add(rec_label) + ->Add(tab_panel); for (int i = 0; i < world::Record::MAX; ++i) { Label *val_label = new Label(sim.Assets().fonts.medium); - rec_panel->Add(val_label); + val_panel->Add(val_label); records.push_back(val_label); Label *holder_label = new Label(sim.Assets().fonts.medium); by_panel->Add(holder_label); @@ -340,8 +347,7 @@ RecordsPanel::RecordsPanel(world::Simulation &sim) group_panel ->Direction(Panel::HORIZONTAL) ->Spacing(10.0f) - ->Add(rec_panel) - ->Add(by_panel); + ->Add(rec_panel); panel.Add(group_panel); ++ri; }