add: Widget registry
This commit is contained in:
@@ -9,8 +9,9 @@ using namespace std::chrono_literals;
|
||||
#include "ScreenManager.hpp"
|
||||
#include "display/Display.hpp"
|
||||
#include "font/Font.hpp"
|
||||
#include "render/RenderTarget.hpp"
|
||||
#include "widgets/clock/Analog.hpp"
|
||||
//#include "render/RenderTarget.hpp"
|
||||
//#include "widgets/clock/Analog.hpp"
|
||||
#include "widgets/WidgetRegistry.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -25,7 +26,9 @@ int main()
|
||||
|
||||
frame::ScreenManager screen(std::move(display));
|
||||
|
||||
screen.setRoot(frame::widgets::AnalogClock::Create());
|
||||
auto const& widgets = frame::Service::get<frame::widgets::WidgetRegistry>();
|
||||
|
||||
screen.setRoot(widgets->Create("AnalogClock"));
|
||||
|
||||
screen.MainLoop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user