[escher/view] setFrame and layoutSubviews can be forced

This commit is contained in:
Léa Saviot
2019-10-02 11:22:49 +02:00
parent f85658f5e6
commit 9f018eb9d9
168 changed files with 421 additions and 405 deletions

View File

@@ -25,18 +25,18 @@ View * WarningController::ContentView::subviewAtIndex(int index) {
return views[index];
}
void WarningController::ContentView::layoutSubviews() {
void WarningController::ContentView::layoutSubviews(bool force) {
if (numberOfSubviews() == 1) {
m_textView1.setFrame(bounds());
m_textView1.setFrame(bounds(), force);
m_textView1.setAlignment(k_middleAlignment, k_middleAlignment);
return;
}
assert(numberOfSubviews() == 2);
KDRect fullBounds = bounds();
KDCoordinate halfHeight = fullBounds.height()/2;
m_textView1.setFrame(KDRect(fullBounds.topLeft(), fullBounds.width(), halfHeight));
m_textView1.setFrame(KDRect(fullBounds.topLeft(), fullBounds.width(), halfHeight), force);
m_textView1.setAlignment(k_middleAlignment, k_shiftedAlignment);
m_textView2.setFrame(KDRect(fullBounds.left(), fullBounds.top()+halfHeight, fullBounds.width(), halfHeight));
m_textView2.setFrame(KDRect(fullBounds.left(), fullBounds.top()+halfHeight, fullBounds.width(), halfHeight), force);
}
KDSize WarningController::ContentView::minimalSizeForOptimalDisplay() const {