[apps/sequence|graph|calculation] ADd a margin in edited text fields

Change-Id: I5450720bc0d58bceb8ab490d4fb837b4d79eef73
This commit is contained in:
Émilie Feral
2017-05-10 15:36:58 +02:00
parent d190f2724f
commit 3e3df48051
8 changed files with 24 additions and 5 deletions

View File

@@ -27,12 +27,15 @@ View * EditExpressionController::ContentView::subviewAtIndex(int index) {
void EditExpressionController::ContentView::layoutSubviews() {
KDRect mainViewFrame(0, 0, bounds().width(), bounds().height() - k_textFieldHeight-k_separatorThickness);
m_mainView->setFrame(mainViewFrame);
KDRect inputViewFrame(0, bounds().height() - k_textFieldHeight, bounds().width(), k_textFieldHeight);
KDRect inputViewFrame(k_textMargin, bounds().height() - k_textFieldHeight, bounds().width()-k_textMargin, k_textFieldHeight);
m_textField.setFrame(inputViewFrame);
}
void EditExpressionController::ContentView::drawRect(KDContext * ctx, KDRect rect) const {
// Draw the separator
ctx->fillRect(KDRect(0, bounds().height() -k_textFieldHeight-k_separatorThickness, bounds().width(), k_separatorThickness), Palette::GreyMiddle);
// Color the margin
ctx->fillRect(KDRect(0, bounds().height() -k_textFieldHeight, k_textMargin, k_textFieldHeight), m_textField.backgroundColor());
}
TextField * EditExpressionController::ContentView::textField() {