ui: Added GitHub and Patreon buttons to start window
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user