mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/hardware_test] Hide title bar view in the hardware test
Change-Id: I413007ec8c997d2f5265f7bd1f75c1795fbb85c2
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user