Skip to content

Commit

Permalink
fix:修复url弹窗中文字与输入框的距离问题
Browse files Browse the repository at this point in the history
设置url弹窗中文字与输入框距离为10

Log:修复url弹窗问题
Bug:https://pms.uniontech.com/bug-view-155981.html
  • Loading branch information
qingfuliu committed Oct 26, 2023
1 parent 7c54cfa commit 67a1e15
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/widgets/url_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include <DGuiApplicationHelper>


#include <iostream>
DWIDGET_USE_NAMESPACE
DGUI_USE_NAMESPACE

Expand All @@ -21,10 +23,25 @@ namespace dmr {
setOnButtonClickedClose(false);
setDefaultButton(1);
setIcon(QIcon::fromTheme("deepin-movie"));
setMessage(QApplication::translate("UrlDialog", "Please enter the URL:"));

m_lineEdit = new LineEdit(this);
addContent(m_lineEdit);
QLabel* m_messageLabel=new QLabel;
m_messageLabel->setText(QApplication::translate("UrlDialog", "Please enter the URL:"));
m_messageLabel->setAlignment(Qt::AlignHCenter|Qt::AlignBottom);
m_lineEdit = new LineEdit;

/**
* m_widget包含一个垂直布局
* 存放了m_messageLabel和m_lineEdit
*/
QWidget* m_widget=new QWidget;
QVBoxLayout* m_contentLayout=new QVBoxLayout;
m_contentLayout->setSpacing(10);
m_contentLayout->setContentsMargins({0,0,0,0});
m_contentLayout->addWidget(m_messageLabel);
m_contentLayout->addWidget(m_lineEdit);
m_widget->setLayout(m_contentLayout);
addContent(m_widget);

m_lineEdit->setFocusPolicy(Qt::StrongFocus);
this->setFocusProxy(m_lineEdit);

Expand Down

0 comments on commit 67a1e15

Please sign in to comment.