Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Donate button to About dialog #3838

Merged
merged 2 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions res/images/heart_icon_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions res/images/heart_icon_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions res/images/heart_icon_rainbow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion res/mixxx.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@
<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/heart_icon_rainbow.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
1 change: 1 addition & 0 deletions src/defs_urls.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#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://mixxx.org/donate"

#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, [] {
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>