From c2c232208e5ace6c0be2c3e5793adb9f0d183030 Mon Sep 17 00:00:00 2001 From: zhuohy <1445643474@qq.com> Date: Mon, 18 Sep 2023 12:30:04 +0800 Subject: [PATCH] fix bug about frmeless dialog --- ui/zenoedit/dialog/zcheckupdatedlg.cpp | 4 ++-- ui/zenoedit/dialog/zcheckupdatedlg.ui | 4 ++-- ui/zenoedit/res/stylesheet/pushbutton.qss | 4 ++-- ui/zenoui/comctrl/dialog/zframelessdialog.cpp | 6 ++++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ui/zenoedit/dialog/zcheckupdatedlg.cpp b/ui/zenoedit/dialog/zcheckupdatedlg.cpp index ac3721a831..d645e5e7b3 100644 --- a/ui/zenoedit/dialog/zcheckupdatedlg.cpp +++ b/ui/zenoedit/dialog/zcheckupdatedlg.cpp @@ -60,8 +60,8 @@ void ZCheckUpdateDlg::updateView(bool bVisible) m_ui->m_remindBtn->setVisible(bVisible); m_ui->m_updateBtn->setVisible(bVisible); - QSize size = bVisible ? QSize(560, 600): QSize(500, 200); - this->setFixedSize(ZenoStyle::dpiScaledSize(size)); + QSize size = bVisible ? QSize(560, 600): QSize(500, 180); + m_ui->m_mainWidget->setFixedSize(ZenoStyle::dpiScaledSize(size)); } void ZCheckUpdateDlg::requestLatestVersion() diff --git a/ui/zenoedit/dialog/zcheckupdatedlg.ui b/ui/zenoedit/dialog/zcheckupdatedlg.ui index dc202f62ed..7589b2632a 100644 --- a/ui/zenoedit/dialog/zcheckupdatedlg.ui +++ b/ui/zenoedit/dialog/zcheckupdatedlg.ui @@ -9,8 +9,8 @@ 0 0 - 625 - 620 + 441 + 177 diff --git a/ui/zenoedit/res/stylesheet/pushbutton.qss b/ui/zenoedit/res/stylesheet/pushbutton.qss index 058a7bf28d..6c36fd5f90 100644 --- a/ui/zenoedit/res/stylesheet/pushbutton.qss +++ b/ui/zenoedit/res/stylesheet/pushbutton.qss @@ -344,11 +344,11 @@ QPushButton[cssClass="select_subgraph"] QPushButton#closebtn { background-color: transparent; - background-image: url(:/icons/closebtn.svg); + border-image: url(:/icons/closebtn.svg); border:0; } QPushButton#closebtn:hover { - background-image: url(:/icons/closebtn_on.svg); + border-image: url(:/icons/closebtn_on.svg); } \ No newline at end of file diff --git a/ui/zenoui/comctrl/dialog/zframelessdialog.cpp b/ui/zenoui/comctrl/dialog/zframelessdialog.cpp index 2bc820340f..7363850d83 100644 --- a/ui/zenoui/comctrl/dialog/zframelessdialog.cpp +++ b/ui/zenoui/comctrl/dialog/zframelessdialog.cpp @@ -41,7 +41,7 @@ void ZFramelessDialog::initTitleWidget() QPushButton* pBtnClose = new QPushButton(this); pBtnClose->setObjectName("closebtn"); - pBtnClose->setFixedSize(ZenoStyle::dpiScaledSize(QSize(24, 24))); + pBtnClose->setFixedSize(ZenoStyle::dpiScaledSize(QSize(20, 20))); connect(pBtnClose, &QPushButton::clicked, this, &ZFramelessDialog::close); QHBoxLayout* pTitleLayout = new QHBoxLayout; @@ -50,7 +50,8 @@ void ZFramelessDialog::initTitleWidget() pTitleLayout->addWidget(m_pLbTitle, 0, Qt::AlignCenter); pTitleLayout->addStretch(); pTitleLayout->addWidget(pBtnClose, 0, Qt::AlignCenter); - pTitleLayout->setContentsMargins(12, 12, 12, 12); + qreal margin = ZenoStyle::dpiScaled(8); + pTitleLayout->setContentsMargins(margin, margin, margin, margin); QWidget* pTitleWidget = new QWidget(this); pTitleWidget->setLayout(pTitleLayout); @@ -58,6 +59,7 @@ void ZFramelessDialog::initTitleWidget() QPalette pal = palette(); pal.setColor(QPalette::Window, QColor("#121417")); pTitleWidget->setPalette(pal); + pTitleWidget->setFixedHeight(ZenoStyle::dpiScaled(36)); QVBoxLayout* pLayout = new QVBoxLayout(this); pLayout->addWidget(pTitleWidget);