Skip to content

Commit

Permalink
Merge pull request #1434 from 1445643474/zeno-727
Browse files Browse the repository at this point in the history
fix bug about frmeless dialog
  • Loading branch information
legobadman authored Sep 18, 2023
2 parents 2719e5c + c2c2322 commit 70409cf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ui/zenoedit/dialog/zcheckupdatedlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions ui/zenoedit/dialog/zcheckupdatedlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>625</width>
<height>620</height>
<width>441</width>
<height>177</height>
</rect>
</property>
<property name="windowTitle">
Expand Down
4 changes: 2 additions & 2 deletions ui/zenoedit/res/stylesheet/pushbutton.qss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
6 changes: 4 additions & 2 deletions ui/zenoui/comctrl/dialog/zframelessdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -50,14 +50,16 @@ 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);
pTitleWidget->setAutoFillBackground(true);
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);
Expand Down

0 comments on commit 70409cf

Please sign in to comment.