Files
Seele/src/Engine/UI/Element/Panel.h
T

32 lines
1.1 KiB
C++

#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