更换SpkWindow基类为QWidget并修复多个问题

修复mResizable为false时阻止窗口移动的问题
更改About窗口为固定大小
This commit is contained in:
RigoLigoRLC
2022-02-06 22:40:46 +08:00
parent 58a0336a23
commit f2e417e02a
8 changed files with 63 additions and 39 deletions

View File

@@ -7,9 +7,12 @@ SpkAbout::SpkAbout(QWidget *parent) : SpkDialog(parent)
{
setWindowModality(Qt::ApplicationModal);
mDialogWidget->setMaximumWidth(600);
// mDialogWidget->setMaximumWidth(600);
mDialogWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setFixedSize(550, 450);
SetResizable(false); // Do you like the dilemma of using self created widget?
mIconLay = new QHBoxLayout;
mSpkVersion = new QLabel;
@@ -24,25 +27,31 @@ SpkAbout::SpkAbout(QWidget *parent) : SpkDialog(parent)
mSpkIcon = new QLabel;
mSpkIcon->setPixmap(QIcon(":/icons/spark-store.svg").pixmap(QSize(128, 128)));
auto description =
auto description = tr(
"Spark Store was started when Chinese home-grown Linux operating systems "
"had initially hit the market. Because the Linux desktop ecosystem is not "
"good enough at the time being, volunteers built this small App Store in "
"the hope that users can get useful applications faster.\n\n"
"Right now we are not just a Chinese group. We are discovering our way into "
"more Debian-based Linux OSes, and build a real community software repository "
"for users around the world.";
"for users around the world.");
mDescriptionText = new QLabel;
mDescriptionText->setObjectName("spk_about_desc");
mDescriptionText->setWordWrap(true);
mDescriptionText->setText(description);
mIconLay->addStretch(3);
mIconLay->addWidget(mSpkIcon);
mIconLay->addStretch(1);
mIconLay->addWidget(mSpkVersion);
mIconLay->setAlignment(Qt::AlignVCenter);
mIconLay->addStretch(3);
mIconLay->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
AddStretch();
AddLayout(mIconLay);
AddSpacing(18);
AddWidget(mDescriptionText);
AddStretch();
SetMargin(18, 0, 18, 18);
GetTitleBar()->SetOperationButton(SpkTitleBar::OperationButton::Close);