feat: 添加新页面
This commit is contained in:
@@ -169,7 +169,8 @@ void ElaCentralStackedWidget::doWindowStackSwitch(ElaWindowType::StackSwitchMode
|
||||
void ElaCentralStackedWidget::paintEvent(QPaintEvent *event) {
|
||||
QRect targetRect = this->rect();
|
||||
// ADDZY: 左上角向右下移动(1, 1),右下角向右下收缩(10, 10)
|
||||
targetRect.adjust(1, 1, 10, 10);
|
||||
// targetRect.adjust(1, 1, 10, 10);
|
||||
targetRect.adjust(0, 0, -3, -3);
|
||||
QPainter painter(this);
|
||||
painter.save();
|
||||
painter.setRenderHints(QPainter::Antialiasing);
|
||||
@@ -177,6 +178,7 @@ void ElaCentralStackedWidget::paintEvent(QPaintEvent *event) {
|
||||
painter.setPen(QPen(ElaThemeColor(_themeMode, BasicBaseLine), 1.5));
|
||||
painter.setBrush(ElaThemeColor(_themeMode, WindowCentralStackBase));
|
||||
if (_isHasRadius) {
|
||||
// ADDZY: 顶点圆角
|
||||
painter.drawRoundedRect(targetRect, 10, 10);
|
||||
} else {
|
||||
painter.drawRect(targetRect);
|
||||
|
||||
@@ -154,6 +154,12 @@ enum NodeOperateReturnType {
|
||||
};
|
||||
Q_ENUM_CREATE(NodeOperateReturnType)
|
||||
|
||||
/* ADDZY
|
||||
* Auto: 根据窗口尺寸调整
|
||||
* Minimal: 点击标题栏的按钮展开,点击其他位置隐藏
|
||||
* Compact: 侧边栏持续最小化显示
|
||||
* Maximal: 侧边栏持续最大化显示
|
||||
*/
|
||||
enum NavigationDisplayMode {
|
||||
Auto = 0x0000,
|
||||
Minimal = 0x0001,
|
||||
|
||||
@@ -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