feat: 添加新页面
This commit is contained in:
@@ -170,7 +170,7 @@ void ElaAppBarPrivate::_onThemeModeChange(ElaThemeType::ThemeMode themeMode) {
|
||||
_themeChangeButton->setElaIcon(ElaIconType::SunBright);
|
||||
}
|
||||
}
|
||||
|
||||
// ADDZY: 计算得到最小宽度,控制窗口宽度
|
||||
int ElaAppBarPrivate::_calculateMinimumWidth() {
|
||||
Q_Q(ElaAppBar);
|
||||
int width = 0;
|
||||
@@ -183,9 +183,14 @@ int ElaAppBarPrivate::_calculateMinimumWidth() {
|
||||
width += 10;
|
||||
}
|
||||
bool isHasNavigationBar = false;
|
||||
if (q->parentWidget()->findChild<ElaNavigationBar *>()) {
|
||||
// FIXME: 这里是不是不应该只检测是否有`ElaNavigationBar`子节点?
|
||||
// TODO: 调整判断逻辑
|
||||
ElaNavigationBar *navigationBar = q->parentWidget()->findChild<ElaNavigationBar *>();
|
||||
if (navigationBar && navigationBar->isMaximized()) {
|
||||
isHasNavigationBar = true;
|
||||
width += 305;
|
||||
} else if (navigationBar && navigationBar->isMinimized()) {
|
||||
width += 10;
|
||||
} else {
|
||||
width += 5;
|
||||
}
|
||||
@@ -205,6 +210,8 @@ int ElaAppBarPrivate::_calculateMinimumWidth() {
|
||||
width += button->width();
|
||||
}
|
||||
}
|
||||
// width -= 200;
|
||||
// qDebug()<<"width: "<<width;
|
||||
return width;
|
||||
}
|
||||
|
||||
@@ -221,4 +228,4 @@ QVBoxLayout *ElaAppBarPrivate::_createVLayout(QWidget *widget) {
|
||||
vLayout->addWidget(widget);
|
||||
vLayout->addStretch();
|
||||
return vLayout;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user