fix bug 145498

This commit is contained in:
zhnagyuanyuan 2022-11-04 17:51:50 +08:00
parent 09b1335ba2
commit a3b9a405b2
1 changed files with 9 additions and 11 deletions

View File

@ -22,14 +22,14 @@ AptProxyDialog::~AptProxyDialog()
void AptProxyDialog::initUi() void AptProxyDialog::initUi()
{ {
setWindowTitle(tr("Set Apt Proxy")); setWindowTitle(tr("Set Apt Proxy"));
this->setFixedSize(480, 200); this->setFixedSize(480, 204);
QVBoxLayout *mAptProxyLyt = new QVBoxLayout(this); QVBoxLayout *mAptProxyLyt = new QVBoxLayout(this);
mAptProxyLyt->setContentsMargins(24, 24, 24, 24); mAptProxyLyt->setContentsMargins(24, 24, 24, 24);
mAptProxyLyt->setSpacing(16); mAptProxyLyt->setSpacing(8);
QFrame *mHostFrame = new QFrame(this); QFrame *mHostFrame = new QFrame(this);
mHostFrame->setFixedSize(432, 36); mHostFrame->setFixedWidth(432);
mHostFrame->setFrameShape(QFrame::NoFrame); mHostFrame->setFrameShape(QFrame::NoFrame);
QHBoxLayout *mLyt_1= new QHBoxLayout(mHostFrame); QHBoxLayout *mLyt_1= new QHBoxLayout(mHostFrame);
@ -37,19 +37,19 @@ void AptProxyDialog::initUi()
mLyt_1->setSpacing(8); mLyt_1->setSpacing(8);
FixLabel *mSetHostLabel = new FixLabel(mHostFrame); FixLabel *mSetHostLabel = new FixLabel(mHostFrame);
mSetHostLabel->setFixedSize(92, 36); mSetHostLabel->setFixedWidth(92);
mSetHostLabel->setText(tr("Server Address")); mSetHostLabel->setText(tr("Server Address"));
mHostEdit = new QLineEdit(mHostFrame); mHostEdit = new QLineEdit(mHostFrame);
mHostEdit->setAttribute(Qt::WA_InputMethodEnabled, false); //限制中文输入法 mHostEdit->setAttribute(Qt::WA_InputMethodEnabled, false); //限制中文输入法
mHostEdit->setFixedSize(332, 36); mHostEdit->setFixedWidth(332);
mHostEdit->installEventFilter(this); mHostEdit->installEventFilter(this);
mLyt_1->addWidget(mSetHostLabel); mLyt_1->addWidget(mSetHostLabel);
mLyt_1->addWidget(mHostEdit); mLyt_1->addWidget(mHostEdit);
QFrame *mPortFrame = new QFrame(this); QFrame *mPortFrame = new QFrame(this);
mPortFrame->setFixedSize(432, 36); mPortFrame->setFixedWidth(432);
mPortFrame->setFrameShape(QFrame::NoFrame); mPortFrame->setFrameShape(QFrame::NoFrame);
QHBoxLayout *mLyt_2= new QHBoxLayout(mPortFrame); QHBoxLayout *mLyt_2= new QHBoxLayout(mPortFrame);
@ -57,11 +57,11 @@ void AptProxyDialog::initUi()
mLyt_2->setSpacing(8); mLyt_2->setSpacing(8);
QLabel *mSetPortLabel = new QLabel(tr("Port") ,mPortFrame); QLabel *mSetPortLabel = new QLabel(tr("Port") ,mPortFrame);
mSetPortLabel->setFixedSize(92, 36); mSetPortLabel->setFixedWidth(92);
mPortEdit = new QLineEdit(mPortFrame); mPortEdit = new QLineEdit(mPortFrame);
mPortEdit->setAttribute(Qt::WA_InputMethodEnabled, false); //限制中文输入法 mPortEdit->setAttribute(Qt::WA_InputMethodEnabled, false); //限制中文输入法
mPortEdit->setFixedSize(332, 36); mPortEdit->setFixedWidth(332);
mPortEdit->installEventFilter(this); mPortEdit->installEventFilter(this);
mLyt_2->addWidget(mSetPortLabel); mLyt_2->addWidget(mSetPortLabel);
@ -76,11 +76,9 @@ void AptProxyDialog::initUi()
mLyt_3->setSpacing(16); mLyt_3->setSpacing(16);
mCancelBtn = new QPushButton(mChooseFrame); mCancelBtn = new QPushButton(mChooseFrame);
mCancelBtn->setMinimumWidth(96);
mCancelBtn->setText(tr("Cancel")); mCancelBtn->setText(tr("Cancel"));
mConfirmBtn = new QPushButton(mChooseFrame); mConfirmBtn = new QPushButton(mChooseFrame);
mConfirmBtn->setMinimumWidth(96);
mConfirmBtn->setText(tr("Confirm")); mConfirmBtn->setText(tr("Confirm"));
mLyt_3->addStretch(); mLyt_3->addStretch();
@ -89,7 +87,7 @@ void AptProxyDialog::initUi()
mAptProxyLyt->addWidget(mHostFrame); mAptProxyLyt->addWidget(mHostFrame);
mAptProxyLyt->addWidget(mPortFrame); mAptProxyLyt->addWidget(mPortFrame);
mAptProxyLyt->addSpacing(16); mAptProxyLyt->addStretch();
mAptProxyLyt->addWidget(mChooseFrame); mAptProxyLyt->addWidget(mChooseFrame);
} }