[escher] Modify header view controller to handle the logic without data

Change-Id: I87b544e39f24961683085af3f6060be357ee4f24
This commit is contained in:
Émilie Feral
2016-10-13 11:07:43 +02:00
parent c28f7bc6c7
commit 7156ce81b5
8 changed files with 95 additions and 125 deletions

View File

@@ -1,15 +1,12 @@
#include <escher/button.h>
#include <assert.h>
Button::Button(Responder * parentResponder) :
Button::Button(Responder * parentResponder, const char * textBody, Invocation invocation) :
Responder(parentResponder),
m_textView(),
m_invocation(Invocation(nullptr, nullptr)),
m_textView(TextView(textBody, 0.5f, 0.5f)),
m_invocation(invocation),
m_backgroundColor(KDColorWhite)
{
m_textView.setBackgroundColor(KDColorWhite);
m_textView.setTextColor(KDColorBlack);
m_textView.setAlignment(0.5f, 0.5f);
}
void Button::drawRect(KDContext * ctx, KDRect rect) const {
@@ -39,14 +36,6 @@ bool Button::handleEvent(Ion::Events::Event event) {
}
}
void Button::setText(const char * textBody) {
m_textView.setText(textBody);
}
void Button::setInvocation(Invocation invocation) {
m_invocation = invocation;
}
void Button::setBackgroundColor(KDColor backgroundColor) {
m_backgroundColor = backgroundColor;
m_textView.setBackgroundColor(backgroundColor);