mirror of
https://github.com/fergalmoran/flameshot.git
synced 2025-12-22 09:51:06 +00:00
Code refactoring - change code style to the new clang-format rules
This commit is contained in:
@@ -16,30 +16,32 @@
|
||||
// along with Flameshot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "infowindow.h"
|
||||
#include <QIcon>
|
||||
#include <QVBoxLayout>
|
||||
#include <QTableWidget>
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QIcon>
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
#include <QTableWidget>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
#include <QCursor>
|
||||
#include <QGuiApplication>
|
||||
#include <QRect>
|
||||
#include <QScreen>
|
||||
#include <QGuiApplication>
|
||||
#endif
|
||||
|
||||
// InfoWindow show basic information about the usage of Flameshot
|
||||
|
||||
InfoWindow::InfoWindow(QWidget *parent) : QWidget(parent) {
|
||||
InfoWindow::InfoWindow(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
setWindowIcon(QIcon(":img/app/flameshot.svg"));
|
||||
setWindowTitle(tr("About"));
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
QRect position = frameGeometry();
|
||||
QScreen *screen = QGuiApplication::screenAt(QCursor::pos());
|
||||
QScreen* screen = QGuiApplication::screenAt(QCursor::pos());
|
||||
position.moveCenter(screen->availableGeometry().center());
|
||||
move(position.topLeft());
|
||||
#endif
|
||||
@@ -50,34 +52,35 @@ InfoWindow::InfoWindow(QWidget *parent) : QWidget(parent) {
|
||||
show();
|
||||
}
|
||||
|
||||
|
||||
void InfoWindow::initLabels() {
|
||||
QLabel *icon = new QLabel();
|
||||
void InfoWindow::initLabels()
|
||||
{
|
||||
QLabel* icon = new QLabel();
|
||||
icon->setPixmap(QPixmap(":img/app/flameshot.svg"));
|
||||
icon->setAlignment(Qt::AlignHCenter);
|
||||
m_layout->addWidget(icon);
|
||||
|
||||
QLabel *licenseTitleLabel = new QLabel(tr("<u><b>License</b></u>"), this);
|
||||
QLabel* licenseTitleLabel = new QLabel(tr("<u><b>License</b></u>"), this);
|
||||
licenseTitleLabel->setAlignment(Qt::AlignHCenter);
|
||||
m_layout->addWidget(licenseTitleLabel);
|
||||
|
||||
QLabel *licenseLabel = new QLabel(QStringLiteral("GPLv3+"), this);
|
||||
QLabel* licenseLabel = new QLabel(QStringLiteral("GPLv3+"), this);
|
||||
licenseLabel->setAlignment(Qt::AlignHCenter);
|
||||
m_layout->addWidget(licenseLabel);
|
||||
m_layout->addStretch();
|
||||
|
||||
QLabel *versionTitleLabel = new QLabel(tr("<u><b>Version</b></u>"), this);
|
||||
QLabel* versionTitleLabel = new QLabel(tr("<u><b>Version</b></u>"), this);
|
||||
versionTitleLabel->setAlignment(Qt::AlignHCenter);
|
||||
m_layout->addWidget(versionTitleLabel);
|
||||
QString versionMsg = "Flameshot " + QStringLiteral(APP_VERSION) + "\nCompiled with Qt "
|
||||
+ QT_VERSION_STR;
|
||||
QLabel *versionLabel = new QLabel(versionMsg, this);
|
||||
QString versionMsg = "Flameshot " + QStringLiteral(APP_VERSION) +
|
||||
"\nCompiled with Qt " + QT_VERSION_STR;
|
||||
QLabel* versionLabel = new QLabel(versionMsg, this);
|
||||
versionLabel->setAlignment(Qt::AlignHCenter);
|
||||
m_layout->addWidget(versionLabel);
|
||||
m_layout->addSpacing(30);
|
||||
}
|
||||
|
||||
void InfoWindow::keyPressEvent(QKeyEvent *e) {
|
||||
void InfoWindow::keyPressEvent(QKeyEvent* e)
|
||||
{
|
||||
if (e->key() == Qt::Key_Escape) {
|
||||
close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user