std::unique_ptr<dick::GUI::Widget> m_make_score_container() { const double text_height = al_get_font_line_height(m_context->m_const.menu_font); double max_width = 0; std::vector<HighScoreEntry> entries = m_high_score.get_entries_for_balls(m_ball_counts[m_ball_index]); std::reverse(begin(entries), end(entries)); auto name_rail = m_context->m_gui.make_container_rail( dick::GUI::Direction::DOWN, text_height * 1.125); auto score_rail = m_context->m_gui.make_container_rail( dick::GUI::Direction::DOWN, text_height * 1.125); for (const auto& entry: entries) { double name_width = al_get_text_width( m_context->m_const.menu_font, entry.name.c_str()); if (name_width > max_width) { max_width = name_width; } name_rail->insert( m_context->m_gui.make_label_ex( entry.name, m_context->m_const.menu_font)); score_rail->insert( m_context->m_gui.make_label_ex( std::to_string(entry.score), m_context->m_const.menu_font)); } score_rail->set_offset({ 2 * max_width, 0.0 }); auto container = m_context->m_gui.make_container_free(); container->insert(std::move(name_rail)); container->insert(std::move(score_rail)); auto panel = m_context->m_gui.make_container_panel(); panel->insert(std::unique_ptr<dick::GUI::Widget> { container.release() }); std::unique_ptr<dick::GUI::Widget> result = std::move(panel); return result; }