mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-28 18:20:14 +01:00
[Escher] Implement a StackViewController
Change-Id: I1b4ecc996a1af2bef1b8ce6cfa71457d3345c00e
This commit is contained in:
31
escher/src/stack_view.cpp
Normal file
31
escher/src/stack_view.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <escher/stack_view.h>
|
||||
extern "C" {
|
||||
#include <assert.h>
|
||||
}
|
||||
|
||||
StackView::StackView() :
|
||||
ChildlessView(),
|
||||
m_name(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
void StackView::setName(const char * name) {
|
||||
m_name = name;
|
||||
markRectAsDirty(bounds());
|
||||
}
|
||||
|
||||
void StackView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(rect, KDColor(0xFFCD50));
|
||||
ctx->drawString(m_name, {0,0}, true);
|
||||
}
|
||||
|
||||
#if ESCHER_VIEW_LOGGING
|
||||
const char * StackView::className() const {
|
||||
return "StackView";
|
||||
}
|
||||
|
||||
void StackView::logAttributes(std::ostream &os) const {
|
||||
View::logAttributes(os);
|
||||
os << " name=\"" << m_name << "\"";
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user