Skip to content

Commit

Permalink
WIP add donate button to About dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed May 7, 2021
1 parent de70eba commit 3623339
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
4 changes: 3 additions & 1 deletion res/mixxx.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
<file>images/library/ic_library_traktor.svg</file>
<file>images/library/ic_library_rekordbox.svg</file>
<file>images/library/ic_library_serato.svg</file>
<!-- logo and icon for 'About' dialog -->
<!-- logo and icons for 'About' dialog -->
<file>images/mixxx_logo.svg</file>
<file>images/mixxx_icon.svg</file>
<file>images/heart_icon_light.svg</file>
<file>images/heart_icon_dark.svg</file>
<file>images/mixxx-icon-logo-symbolic.svg</file> <!-- default launch image -->
<file>images/skin_preview_placeholder.png</file>
<file>images/ic_checkmark.svg</file>
Expand Down
3 changes: 3 additions & 0 deletions src/defs_urls.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#define MIXXX_WEBSITE_SHORT_URL "www.mixxx.org"
#define MIXXX_SUPPORT_URL "https://www.mixxx.org/support/"
#define MIXXX_TRANSLATION_URL "https://www.transifex.com/projects/p/mixxxdj/"
#define MIXXX_DONATE_URL \
"https://www.paypal.com/cgi-bin/" \
"webscr?cmd=_s-xclick&hosted_button_id=QSFMYWN2B3JD2"

#define MIXXX_CONTROLLER_FORUMS_URL \
"https://mixxx.discourse.group/c/controller-mappings/10"
Expand Down
11 changes: 11 additions & 0 deletions src/dialog/dlgabout.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "dialog/dlgabout.h"

#include <QDesktopServices>
#include <QFile>
#include <QLocale>

Expand Down Expand Up @@ -343,6 +344,16 @@ DlgAbout::DlgAbout(QWidget* parent) : QDialog(parent), Ui::DlgAboutDlg() {
MIXXX_WEBSITE_URL,
tr("Official Website")));

if (!Color::isDimColor(palette().text().color())) {
btnDonate->setIcon(QIcon(":/images/heart_icon_light.svg"));
} else {
btnDonate->setIcon(QIcon(":/images/heart_icon_dark.svg"));
}
btnDonate->setText(tr("Donate"));
connect(btnDonate, &QPushButton::clicked, this, [this] {
QDesktopServices::openUrl(QUrl(MIXXX_DONATE_URL));
});

connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgAbout::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgAbout::reject);
}
17 changes: 16 additions & 1 deletion src/dialog/dlgaboutdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,22 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnDonate"/>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
Expand Down Expand Up @@ -261,7 +277,6 @@ p, li { white-space: pre-wrap; }
</customwidgets>
<resources>
<include location="../../res/mixxx.qrc"/>
<include location="../../res/mixxx.qrc"/>
</resources>
<connections/>
</ui>

0 comments on commit 3623339

Please sign in to comment.