[apps/hardware_test] Hide title bar view in the hardware test

Change-Id: I413007ec8c997d2f5265f7bd1f75c1795fbb85c2
This commit is contained in:
Émilie Feral
2017-05-04 13:47:17 +02:00
parent c1be0309f3
commit ce947a7e07
3 changed files with 19 additions and 3 deletions

View File

@@ -5,7 +5,8 @@ extern "C" {
AppsWindow::AppsWindow() :
Window(),
m_titleBarView(TitleBarView())
m_titleBarView(TitleBarView()),
m_hideTitleBarView(false)
{
}
@@ -41,6 +42,13 @@ bool AppsWindow::updateAlphaLock() {
return m_titleBarView.setAlphaLockStatus(alphaLockStatus);
}
void AppsWindow::hideTitleBarView(bool hide) {
if (m_hideTitleBarView != hide) {
m_hideTitleBarView = hide;
layoutSubviews();
}
}
int AppsWindow::numberOfSubviews() const {
return (m_contentView == nullptr ? 1 : 2);
}
@@ -54,9 +62,10 @@ View * AppsWindow::subviewAtIndex(int index) {
}
void AppsWindow::layoutSubviews() {
m_titleBarView.setFrame(KDRect(0, 0, bounds().width(), k_titleBarHeight));
KDCoordinate titleHeight = m_hideTitleBarView ? 0 : k_titleBarHeight;
m_titleBarView.setFrame(KDRect(0, 0, bounds().width(), titleHeight));
if (m_contentView != nullptr) {
m_contentView->setFrame(KDRect(0, k_titleBarHeight, bounds().width(), bounds().height()-k_titleBarHeight));
m_contentView->setFrame(KDRect(0, titleHeight, bounds().width(), bounds().height()-titleHeight));
}
}