1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +00:00

LibGUI: Improve widget registration mechanism a bit

Allow registering widgets from namespaces other than GUI. :^)
Also add a few widgets.
This commit is contained in:
Andreas Kling 2020-09-14 09:56:00 +02:00
parent 3ab706cac3
commit 3c580233d1
2 changed files with 22 additions and 13 deletions

View file

@ -38,9 +38,9 @@
#include <LibGfx/Rect.h>
#include <LibGfx/StandardCursor.h>
#define REGISTER_WIDGET(class_name) \
extern WidgetClassRegistration registration_##class_name; \
WidgetClassRegistration registration_##class_name(#class_name, []() { return class_name::construct(); });
#define REGISTER_WIDGET(namespace_, class_name) \
extern GUI::WidgetClassRegistration registration_##class_name; \
GUI::WidgetClassRegistration registration_##class_name(#namespace_ "::" #class_name, []() { return namespace_::class_name::construct(); });
namespace GUI {