1 /*
2 # PostgreSQL Database Modeler (pgModeler)
3 #
4 # Copyright 2006-2020 - Raphael Araújo e Silva <raphael@pgmodeler.io>
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation version 3.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # The complete text of GPLv3 is at LICENSE file on source code root directory.
16 # Also, you can get the complete GNU General Public License at <http://www.gnu.org/licenses/>
17 */
18 
19 #include "donatewidget.h"
20 #include "globalattributes.h"
21 #include <QDesktopServices>
22 #include <QUrl>
23 #include "pgmodeleruins.h"
24 
DonateWidget(QWidget * parent)25 DonateWidget::DonateWidget(QWidget *parent) : QWidget(parent)
26 {
27 	setupUi(this);
28 	setWindowFlags(Qt::Widget | Qt::FramelessWindowHint);
29 
30 	QGraphicsDropShadowEffect * drop_shadow=new QGraphicsDropShadowEffect(this);
31 	drop_shadow->setOffset(5,5);
32 	drop_shadow->setBlurRadius(30);
33 	this->setGraphicsEffect(drop_shadow);
34 
35 	connect(hide_tb, &QToolButton::clicked,
36 			[&](){
37 		this->close();
38 		emit s_visibilityChanged(false);
39 	});
40 
41 	connect(donate_tb, &QToolButton::clicked,
42 			[&](){
43 		QDesktopServices::openUrl(QUrl(GlobalAttributes::PgModelerDonateURL));
44 		this->close();
45 		emit s_visibilityChanged(false);
46 	});
47 
48 	PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::BigFontFactor);
49 	this->adjustSize();
50 }
51