[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

@@ -50,19 +50,19 @@ View * ParametersController::ContentView::subviewAtIndex(int index) {
return &m_secondParameterDefinition;
}
void ParametersController::ContentView::layoutSubviews() {
void ParametersController::ContentView::layoutSubviews(bool force) {
KDCoordinate titleHeight = KDFont::SmallFont->glyphSize().height()+k_titleMargin;
m_titleView.setFrame(KDRect(0, 0, bounds().width(), titleHeight));
m_titleView.setFrame(KDRect(0, 0, bounds().width(), titleHeight), force);
KDCoordinate tableHeight = m_selectableTableView->minimalSizeForOptimalDisplay().height();
m_selectableTableView->setFrame(KDRect(0, titleHeight, bounds().width(), tableHeight));
m_selectableTableView->setFrame(KDRect(0, titleHeight, bounds().width(), tableHeight), force);
KDCoordinate textHeight = KDFont::SmallFont->glyphSize().height();
KDCoordinate defOrigin = (titleHeight+tableHeight)/2+(bounds().height()-textHeight)/2;
m_secondParameterDefinition.setFrame(KDRectZero);
m_secondParameterDefinition.setFrame(KDRectZero, force);
if (m_numberOfParameters == 2) {
defOrigin = (titleHeight+tableHeight)/2+(bounds().height()-2*textHeight-k_textMargin)/2;
m_secondParameterDefinition.setFrame(KDRect(0, defOrigin+textHeight+k_textMargin, bounds().width(), textHeight));
m_secondParameterDefinition.setFrame(KDRect(0, defOrigin+textHeight+k_textMargin, bounds().width(), textHeight), force);
}
m_firstParameterDefinition.setFrame(KDRect(0, defOrigin, bounds().width(), textHeight));
m_firstParameterDefinition.setFrame(KDRect(0, defOrigin, bounds().width(), textHeight), force);
}
/* Parameters Controller */