[Escher] Implement a StackViewController

Change-Id: I1b4ecc996a1af2bef1b8ce6cfa71457d3345c00e
This commit is contained in:
Romain Goyet
2016-08-19 15:25:06 +02:00
parent c5916572fe
commit 961a751131
6 changed files with 205 additions and 0 deletions

31
escher/src/stack_view.cpp Normal file
View 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