ui: Added GitHub and Patreon buttons to start window

This commit is contained in:
Eberhard Graether
2019-11-17 16:14:24 +01:00
parent 9b86f0e824
commit b5e0387f1e
6 changed files with 44 additions and 10 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

+7 -3
View File
@@ -1,14 +1,18 @@
#projectButton {
#projectButton, #infoButton {
background: white;
border: 1px solid lightgray;
border-radius: 8px;
color: black;
padding: 3px 5px 2px;
padding: 4px 5px 3px;
font-size: 14px;
min-width: 6em;
}
#projectButton:hover {
#infoButton {
padding: 4px 15px 3px;
}
#projectButton:hover, #infoButton:hover {
color: white;
background: #2D3F85;
}
+2 -2
View File
@@ -514,12 +514,12 @@ void QtMainWindow::showErrorHelpMessage()
void QtMainWindow::showChangelog()
{
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/SourcetrailBugTracker/#changelog"));
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/Sourcetrail/blob/master/CHANGELOG.md"));
}
void QtMainWindow::showBugtracker()
{
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/SourcetrailBugTracker/issues"));
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/Sourcetrail/issues"));
}
void QtMainWindow::showLicenses()
+28
View File
@@ -1,6 +1,7 @@
#include "QtStartScreen.h"
#include <QCheckBox>
#include <QDesktopServices>
#include <QLabel>
#include <QString>
#include <QHBoxLayout>
@@ -86,6 +87,8 @@ QtStartScreen::QtStartScreen(QWidget *parent)
, m_pythonIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/python_icon.png").wstr()))
, m_javaIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/java_icon.png").wstr()))
, m_projectIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/empty_icon.png").wstr()))
, m_githubIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"startscreen/github_icon.png").wstr()))
, m_patreonIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"startscreen/patreon_icon.png").wstr()))
{
}
@@ -174,6 +177,31 @@ void QtStartScreen::setupStartScreen()
col->addSpacing(15);
QPushButton* githubButton = new QPushButton("Contribute on GitHub", this);
githubButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
githubButton->setObjectName("infoButton");
githubButton->setIcon(m_githubIcon);
githubButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(githubButton, &QPushButton::clicked, [](){
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/Sourcetrail", QUrl::TolerantMode));
});
col->addWidget(githubButton);
col->addSpacing(8);
// QPushButton* patreonButton = new QPushButton("Support on Patreon", this);
QPushButton* patreonButton = new QPushButton("Become a Patron", this);
patreonButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
patreonButton->setObjectName("infoButton");
patreonButton->setIcon(m_patreonIcon);
patreonButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(patreonButton, &QPushButton::clicked, [](){
QDesktopServices::openUrl(QUrl("https://www.patreon.com/sourcetrail", QUrl::TolerantMode));
});
col->addWidget(patreonButton);
col->addSpacing(15);
{
QLabel* newsHeader = new QLabel("News:");
newsHeader->setObjectName("boldLabel");
+7 -5
View File
@@ -48,11 +48,13 @@ private slots:
private:
std::vector<QtRecentProjectButton*> m_recentProjectsButtons;
QIcon m_cppIcon;
QIcon m_cIcon;
QIcon m_pythonIcon;
QIcon m_javaIcon;
QIcon m_projectIcon;
const QIcon m_cppIcon;
const QIcon m_cIcon;
const QIcon m_pythonIcon;
const QIcon m_javaIcon;
const QIcon m_projectIcon;
const QIcon m_githubIcon;
const QIcon m_patreonIcon;
};
#endif // QT_START_SCREEN_H