Initial UI implementation by AI
This commit is contained in:
1 parent
f2a3f59ab1
commit
908b52441f
29 files changed
+884
-186
No files matched your search
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
#include "UI/Element/Div.h"
|
||||
#include "UI/Style/Class.h"
|
||||
|
||||
namespace Seele {
|
||||
namespace UI {
|
||||
// a styled block container: defaults to the standard editor chrome
|
||||
// (dark background, padding, text color); the user's template args override any of it
|
||||
template<StyleClass... classes>
|
||||
class Panel : public Div<classes...> {
|
||||
public:
|
||||
// forward every Div construction form (no children / variadic / initializer list)
|
||||
using Div<classes...>::Div;
|
||||
virtual ~Panel() {}
|
||||
virtual void applyStyle(Style parentStyle, const Theme& theme) override {
|
||||
// start from the panel chrome, then let the user's classes win
|
||||
style = parentStyle;
|
||||
style.outerDisplay = OuterDisplayType::Block;
|
||||
style.backgroundColor = theme.color(ColorToken::Gray900);
|
||||
style.textColor = theme.color(ColorToken::White);
|
||||
uint32 pad = theme.spacing(8);
|
||||
style.paddingTop = pad;
|
||||
style.paddingBottom = pad;
|
||||
style.paddingLeft = pad;
|
||||
style.paddingRight = pad;
|
||||
(classes::apply(style, theme), ...);
|
||||
}
|
||||
private:
|
||||
};
|
||||
} // namespace UI
|
||||
} // namespace Seele
|
||||
Reference in new issue
Block a user