[apps/settings] SelectableViewWithMessages: position the additional

messages at the bottom of the view
This commit is contained in:
Émilie Feral
2020-02-11 10:07:20 +01:00
committed by Léa Saviot
parent 3c52631245
commit 8a87bcfc5b

View File

@@ -6,6 +6,8 @@ using namespace Shared;
namespace Settings {
static inline KDCoordinate maxCoordinate(KDCoordinate x, KDCoordinate y) { return x > y ? x : y; }
SelectableViewWithMessages::SelectableViewWithMessages(SelectableTableView * selectableTableView) :
m_selectableTableView(selectableTableView),
m_numberOfMessages(0)
@@ -45,7 +47,7 @@ void SelectableViewWithMessages::layoutSubviews(bool force) {
// Layout the text
KDCoordinate textHeight = KDFont::SmallFont->glyphSize().height();
KDCoordinate defOrigin = tableHeight + (bounds().height() - tableHeight - m_numberOfMessages*textHeight - Metric::CommonTopMargin)/2;
KDCoordinate defOrigin = maxCoordinate(bounds().height() - Metric::CommonBottomMargin - m_numberOfMessages*textHeight, tableHeight);
for (int i = 0; i < m_numberOfMessages; i++) {
m_messageLines[i].setFrame(KDRect(0, defOrigin, bounds().width(), textHeight), force);