[escher] Remove big modal view drawing hack.

Change-Id: I09b0d9ee1db8db9a736577770f540e69cc78d660
This commit is contained in:
Léa Saviot
2018-04-25 09:48:49 +02:00
parent d9c89ea0c9
commit 9f09ee8339

View File

@@ -23,18 +23,12 @@ void ModalViewController::ContentView::setMainView(View * regularView) {
}
int ModalViewController::ContentView::numberOfSubviews() const {
KDRect regularFrame = bounds();
KDRect modalFrame = modalViewFrame();
bool shouldDrawTheRegularViewBehind = !modalFrame.contains(regularFrame.topLeft()) || !modalFrame.contains(regularFrame.bottomRight());
return 1 + (m_isDisplayingModal && shouldDrawTheRegularViewBehind);
return 1 + m_isDisplayingModal;
}
View * ModalViewController::ContentView::subviewAtIndex(int index) {
switch (index) {
case 0:
if (m_isDisplayingModal && numberOfSubviews() == 1) {
return m_currentModalView;
}
return m_regularView;
case 1:
if (numberOfSubviews() == 2) {