55#include " manager/font.hpp"
66#include " manager/resource_manager.hpp"
77#include " recording_component.hpp"
8+ #include " ui/components/text_button.hpp"
89#include " ui/widget.hpp"
910
1011#include < fmt/format.h>
@@ -20,23 +21,47 @@ custom_ui::RecordingComponent::RecordingComponent(
2021 ui::Focusable{focus_helper.focus_id ()},
2122 ui::Hoverable{layout.get_rect ()},
2223 m_main_layout{ utils::SizeIdentity<2 >(), focus_helper.focus_id (),
23- ui::Direction::Vertical ,
24- std::array<double , 1 >{ 0.6 }, ui::RelativeMargin{layout.get_rect (), ui::Direction::Vertical,0.05 }, std::pair<double , double >{ 0.05 , 0.03 },
24+ ui::Direction::Horizontal ,
25+ std::array<double , 1 >{ 0.9 }, ui::RelativeMargin{layout.get_rect (), ui::Direction::Vertical,0.05 }, std::pair<double , double >{ 0.05 , 0.03 },
2526 layout,false
2627 },m_metadata{std::move (metadata)}{
2728
28- m_main_layout.add <ui::Label>(
29+
30+ auto text_layout_index = m_main_layout.add <ui::TileLayout>(
31+ utils::SizeIdentity<2 >(), focus_helper.focus_id (), ui::Direction::Vertical, std::array<double , 1 >{ 0.6 },
32+ ui::RelativeMargin{ layout.get_rect (), ui::Direction::Vertical, 0.05 },
33+ std::pair<double , double >{ 0.05 , 0.03 }
34+ );
35+
36+ auto * text_layout = m_main_layout.get <ui::TileLayout>(text_layout_index);
37+
38+
39+ m_main_layout.add <ui::TextButton>(
40+ service_provider, " Render" , service_provider->font_manager ().get (FontId::Default), Color::white (),
41+ focus_helper.focus_id (),
42+ [](const ui::TextButton&) -> bool {
43+ // TODO
44+
45+ return false ;
46+ },
47+ std::pair<double , double >{ 0.95 , 0.85 },
48+ ui::Alignment{ ui::AlignmentHorizontal::Middle, ui::AlignmentVertical::Center },
49+ std::pair<double , double >{ 0.1 , 0.1 }
50+ );
51+
52+ text_layout->add <ui::Label>(
2953 service_provider, " name: ?" , service_provider->font_manager ().get (FontId::Default), Color::white (),
3054 std::pair<double , double >{ 0.5 , 0.5 },
3155 ui::Alignment{ ui::AlignmentHorizontal::Middle, ui::AlignmentVertical::Center }
3256 );
3357
34- const auto information_layout_index = m_main_layout.add <ui::TileLayout>(
58+
59+ const auto information_layout_index = text_layout->add <ui::TileLayout>(
3560 utils::SizeIdentity<3 >(), focus_helper.focus_id (), ui::Direction::Horizontal,
3661 std::array<double , 2 >{ 0.33 , 0.66 }, ui::AbsolutMargin{ 10 }, std::pair<double , double >{ 0.05 , 0.03 }
3762 );
3863
39- auto * const information_layout = m_main_layout. get <ui::TileLayout>(information_layout_index);
64+ auto * const information_layout = text_layout-> get <ui::TileLayout>(information_layout_index);
4065
4166
4267 information_layout->add <ui::Label>(
@@ -104,9 +129,11 @@ helper::BoolWrapper<std::pair<ui::EventHandleType, ui::Widget*>> custom_ui::Reco
104129
105130[[nodiscard]] std::tuple<ui::Label*, ui::Label*, ui::Label*, ui::Label*> custom_ui::RecordingComponent::get_texts () {
106131
107- auto * name_text = m_main_layout.get <ui::Label>(0 );
132+ auto * text_layout = m_main_layout.get <ui::TileLayout>(0 );
133+
134+ auto * name_text = text_layout->get <ui::Label>(0 );
108135
109- auto * information_layout = m_main_layout. get <ui::TileLayout>(1 );
136+ auto * information_layout = text_layout-> get <ui::TileLayout>(1 );
110137
111138 auto * source_text = information_layout->get <ui::Label>(0 );
112139 auto * date_text = information_layout->get <ui::Label>(1 );
0 commit comments