From 033d56a4b332ded5b4e326bf060192ac1469d0d8 Mon Sep 17 00:00:00 2001
From: Jonas Kvinge
Date: Mon, 8 Jun 2020 23:40:15 +0200
Subject: [PATCH] Use SetMinimumSize in about dialog
---
src/dialogs/about.cpp | 15 ++-------------
src/dialogs/about.h | 4 ----
src/dialogs/about.ui | 29 +++++++++++++++++++++++++----
3 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/src/dialogs/about.cpp b/src/dialogs/about.cpp
index 21c062b43..87c5b2d49 100644
--- a/src/dialogs/about.cpp
+++ b/src/dialogs/about.cpp
@@ -95,24 +95,13 @@ About::About(QWidget *parent):QDialog(parent) {
ui_.label_title->setFont(title_font);
ui_.label_title->setText(Title);
- ui_.label_title->adjustSize();
ui_.label_text->setText(MainHtml());
- ui_.label_text->adjustSize();
ui_.text_contributors->setText(ContributorsHtml());
ui_.buttonBox->button(QDialogButtonBox::Close)->setShortcut(QKeySequence::Close);
}
-void About::showEvent(QShowEvent*) {
-
- setMinimumHeight(0);
- setMaximumHeight(9000);
- adjustSize();
- setFixedHeight(height() + 40);
-
-}
-
QString About::MainHtml() const {
QString ret;
@@ -134,9 +123,9 @@ QString About::MainHtml() const {
ret += "
";
ret += "";
- ret += tr("If you like this Strawberry and can make use of it, consider sponsoring or donating.");
+ ret += tr("If you like Strawberry and can make use of it, consider sponsoring or donating.");
ret += "
";
- ret += tr("You can sponsor the author on %1. You can also make a one-time payment through %2.").arg("GitHub sponsors.").arg("paypal.me/jonaskvinge");
+ ret += tr("You can sponsor the author on %1. You can also make a one-time payment through %2.").arg("GitHub sponsors").arg("paypal.me/jonaskvinge");
ret += "
";
return ret;
diff --git a/src/dialogs/about.h b/src/dialogs/about.h
index d91250ee9..30fb97e15 100644
--- a/src/dialogs/about.h
+++ b/src/dialogs/about.h
@@ -32,7 +32,6 @@
#include "ui_about.h"
class QWidget;
-class QShowEvent;
class About : public QDialog {
Q_OBJECT
@@ -40,9 +39,6 @@ class About : public QDialog {
public:
explicit About(QWidget *parent = nullptr);
- protected:
- void showEvent(QShowEvent*);
-
private:
struct Person {
Person(const QString &n, const QString &e = QString()) : name(n), email(e) {}
diff --git a/src/dialogs/about.ui b/src/dialogs/about.ui
index 48b628b99..44765b87e 100644
--- a/src/dialogs/about.ui
+++ b/src/dialogs/about.ui
@@ -25,6 +25,9 @@
Qt::StrongFocus
+
+ About
+
:/icons/64x64/strawberry.png:/icons/64x64/strawberry.png
@@ -37,12 +40,15 @@
- QLayout::SetDefaultConstraint
+ QLayout::SetMinimumSize
-
-
+
+
+ QLayout::SetMinimumSize
+
-
-
+
-
@@ -91,9 +97,18 @@
-
-
+
+
+ QLayout::SetMinimumSize
+
-
+
+
+ 0
+ 0
+
+
@@ -107,6 +122,12 @@
-
+
+
+ 0
+ 0
+
+