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 "aboutwidget.h"
20 #include "pgmodeleruins.h"
21 #include "baseobjectview.h"
22 #include <QScreen>
23 #include <QDesktopWidget>
24 
AboutWidget(QWidget * parent)25 AboutWidget::AboutWidget(QWidget *parent) : QWidget(parent)
26 {
27 	setupUi(this);
28 
29 	QGraphicsDropShadowEffect * drop_shadow=new QGraphicsDropShadowEffect(this);
30 	drop_shadow->setOffset(5,5);
31 	drop_shadow->setBlurRadius(30);
32 	this->setGraphicsEffect(drop_shadow);
33 
34 	PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::HugeFontFactor);
35 	PgModelerUiNs::configureWidgetFont(pgmodeler_ver_lbl, PgModelerUiNs::HugeFontFactor);
36 	PgModelerUiNs::configureWidgetFont(build_lbl, PgModelerUiNs::BigFontFactor);
37 	PgModelerUiNs::configureWidgetFont(build_num_lbl, PgModelerUiNs::BigFontFactor);
38 
39 	pgmodeler_ver_lbl->setText(QString("v%1 ").arg(GlobalAttributes::PgModelerVersion));
40 	build_num_lbl->setText(QString("%1 Qt %2").arg(GlobalAttributes::PgModelerBuildNumber).arg(QT_VERSION_STR));
41 
42 	connect(hide_tb, &QToolButton::clicked, this,
43 			[&](){
44 		this->close();
45 		emit s_visibilityChanged(false);
46 	});
47 
48 	double factor = BaseObjectView::getScreenDpiFactor();
49 	this->adjustSize();
50 	this->resize(this->minimumWidth() * factor, this->minimumHeight() * factor);
51 }
52