[apps/calculation] Improve edit expression rendering

Change-Id: I972d9cf6fd018799966bd8765c6ee35be07aab10
This commit is contained in:
Émilie Feral
2017-03-17 10:30:21 +01:00
parent 5e6470f776
commit 52cd5a704e
2 changed files with 10 additions and 4 deletions

View File

@@ -25,10 +25,14 @@ View * EditExpressionController::ContentView::subviewAtIndex(int index) {
}
void EditExpressionController::ContentView::layoutSubviews() {
KDRect mainViewFrame(0, 0, bounds().width(), bounds().height() - k_textFieldHeight);
KDRect mainViewFrame(0, 0, bounds().width(), bounds().height() - k_textFieldHeight-k_separatorThickness);
m_mainView->setFrame(mainViewFrame);
KDRect inputViewFram(0, bounds().height() - k_textFieldHeight, bounds().width(), k_textFieldHeight);
m_textField.setFrame(inputViewFram);
KDRect inputViewFrame(0, bounds().height() - k_textFieldHeight, bounds().width(), k_textFieldHeight);
m_textField.setFrame(inputViewFrame);
}
void EditExpressionController::ContentView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(KDRect(0, bounds().height() -k_textFieldHeight-k_separatorThickness, bounds().width(), k_separatorThickness), Palette::GreyMiddle);
}
TextField * EditExpressionController::ContentView::textField() {

View File

@@ -29,8 +29,10 @@ private:
void layoutSubviews() override;
TextField * textField();
TableView * mainView();
void drawRect(KDContext * ctx, KDRect rect) const override;
private:
static constexpr KDCoordinate k_textFieldHeight = 20;
static constexpr KDCoordinate k_textFieldHeight = 37;
constexpr static int k_separatorThickness = 1;
TableView * m_mainView;
TextField m_textField;
char m_textBody[255];