Use SetMinimumSize in about dialog
This commit is contained in:
@@ -95,24 +95,13 @@ About::About(QWidget *parent):QDialog(parent) {
|
|||||||
|
|
||||||
ui_.label_title->setFont(title_font);
|
ui_.label_title->setFont(title_font);
|
||||||
ui_.label_title->setText(Title);
|
ui_.label_title->setText(Title);
|
||||||
ui_.label_title->adjustSize();
|
|
||||||
ui_.label_text->setText(MainHtml());
|
ui_.label_text->setText(MainHtml());
|
||||||
ui_.label_text->adjustSize();
|
|
||||||
ui_.text_contributors->setText(ContributorsHtml());
|
ui_.text_contributors->setText(ContributorsHtml());
|
||||||
|
|
||||||
ui_.buttonBox->button(QDialogButtonBox::Close)->setShortcut(QKeySequence::Close);
|
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 About::MainHtml() const {
|
||||||
|
|
||||||
QString ret;
|
QString ret;
|
||||||
@@ -134,9 +123,9 @@ QString About::MainHtml() const {
|
|||||||
ret += "</p>";
|
ret += "</p>";
|
||||||
|
|
||||||
ret += "<p>";
|
ret += "<p>";
|
||||||
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 += "<br />";
|
ret += "<br />";
|
||||||
ret += tr("You can sponsor the author on %1. You can also make a one-time payment through %2.").arg("<a href=\"https://github.com/sponsors/jonaski\">GitHub sponsors</a>.").arg("<a href=\"https://paypal.me/jonaskvinge\">paypal.me/jonaskvinge</a>");
|
ret += tr("You can sponsor the author on %1. You can also make a one-time payment through %2.").arg("<a href=\"https://github.com/sponsors/jonaski\">GitHub sponsors</a>").arg("<a href=\"https://paypal.me/jonaskvinge\">paypal.me/jonaskvinge</a>");
|
||||||
ret += "</p>";
|
ret += "</p>";
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#include "ui_about.h"
|
#include "ui_about.h"
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
class QShowEvent;
|
|
||||||
|
|
||||||
class About : public QDialog {
|
class About : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -40,9 +39,6 @@ class About : public QDialog {
|
|||||||
public:
|
public:
|
||||||
explicit About(QWidget *parent = nullptr);
|
explicit About(QWidget *parent = nullptr);
|
||||||
|
|
||||||
protected:
|
|
||||||
void showEvent(QShowEvent*);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Person {
|
struct Person {
|
||||||
Person(const QString &n, const QString &e = QString()) : name(n), email(e) {}
|
Person(const QString &n, const QString &e = QString()) : name(n), email(e) {}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
<property name="focusPolicy">
|
<property name="focusPolicy">
|
||||||
<enum>Qt::StrongFocus</enum>
|
<enum>Qt::StrongFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>About</string>
|
||||||
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../../data/icons.qrc">
|
<iconset resource="../../data/icons.qrc">
|
||||||
<normaloff>:/icons/64x64/strawberry.png</normaloff>:/icons/64x64/strawberry.png</iconset>
|
<normaloff>:/icons/64x64/strawberry.png</normaloff>:/icons/64x64/strawberry.png</iconset>
|
||||||
@@ -37,12 +40,15 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
<enum>QLayout::SetDefaultConstraint</enum>
|
<enum>QLayout::SetMinimumSize</enum>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="layout_about">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetMinimumSize</enum>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_logo">
|
<layout class="QVBoxLayout" name="layout_left">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_icon">
|
<widget class="QLabel" name="label_icon">
|
||||||
<property name="pixmap">
|
<property name="pixmap">
|
||||||
@@ -91,9 +97,18 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_text">
|
<layout class="QVBoxLayout" name="layout_right">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetMinimumSize</enum>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_title">
|
<widget class="QLabel" name="label_title">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -107,6 +122,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_text">
|
<widget class="QLabel" name="label_text">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user