Commit b673bc0e authored by kaniini's avatar kaniini

add about window

parent af9f2691
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg4"
version="1.1"
height="1536"
width="1536">
<defs
id="defs8" />
<path
id="path2"
d="m 1026,1250 v -160 c 0,-18 -14,-32 -32,-32 H 898 V 546 c 0,-18 -14,-32 -32,-32 H 546 c -18,0 -32,14 -32,32 v 160 c 0,18 14,32 32,32 h 96 v 320 h -96 c -18,0 -32,14 -32,32 v 160 c 0,18 14,32 32,32 h 448 c 18,0 32,-14 32,-32 z M 898,354 V 194 c 0,-18 -14,-32 -32,-32 H 674 c -18,0 -32,14 -32,32 v 160 c 0,18 14,32 32,32 h 192 c 18,0 32,-14 32,-32 z m 640,416 c 0,424 -344,768 -768,768 C 346,1538 2,1194 2,770 2,346 346,2 770,2 c 424,0 768,344 768,768 z" />
</svg>
This diff is collapsed.
......@@ -39,7 +39,8 @@ SOURCES += \
ui/notificationimpl.cc \
ui/threadwindow.cc \
ui/iconutils.cc \
ui/preferenceswindow.cc
ui/preferenceswindow.cc \
ui/aboutwindow.cc
HEADERS += \
core/account.h \
......@@ -58,7 +59,8 @@ HEADERS += \
ui/notificationimpl.h \
ui/threadwindow.h \
ui/iconutils.h \
ui/preferenceswindow.h
ui/preferenceswindow.h \
ui/aboutwindow.h
FORMS +=
......
......@@ -12,5 +12,7 @@
<file>icons/action-preferences.svg</file>
<file>icons/action-refresh.svg</file>
<file>icons/action-compose.svg</file>
<file>icons/banner-colorbg.png</file>
<file>icons/action-about.svg</file>
</qresource>
</RCC>
#include "aboutwindow.h"
#include <QIcon>
#include <QApplication>
#define LOGO_WIDTH 386 / 2
#define LOGO_HEIGHT 250 / 2
AboutWindow::AboutWindow(QWidget * parent)
: QDialog(parent),
m_layout(new QVBoxLayout(this)),
m_logo(new QLabel),
m_application_name(new QLabel),
m_copyright(new QLabel),
m_license(new QLabel)
{
QIcon logo = QIcon (":/embedded-assets/icons/banner-colorbg.png");
m_logo->setPixmap (logo.pixmap (LOGO_WIDTH, LOGO_HEIGHT));
m_logo->setAlignment (Qt::AlignCenter);
m_application_name->setText (QString ("<big>%1 %2</big>").arg (qApp->applicationName (),
qApp->applicationVersion ()));
m_application_name->setAlignment (Qt::AlignCenter);
m_copyright->setText (tr ("Copyright © 2019 Pleroma Contributors"));
m_copyright->setAlignment (Qt::AlignCenter);
m_license->setText (tr ("This software is licensed to you under the GNU GPLv3.\n"
"A copy of the GPLv3 has been included with the software in the GPL-3 file.\n"
"A list of copyright holders has also been included as the AUTHORS file."));
m_license->setAlignment (Qt::AlignCenter);
m_layout->addWidget (m_logo);
m_layout->addWidget (m_application_name);
m_layout->addWidget (m_copyright);
m_layout->addWidget (m_license);
}
#ifndef ABOUTWINDOW_H
#define ABOUTWINDOW_H
#include <QWidget>
#include <QDialog>
#include <QVBoxLayout>
#include <QLabel>
class AboutWindow : public QDialog
{
public:
AboutWindow(QWidget * parent = nullptr);
private:
QVBoxLayout *m_layout;
QLabel *m_logo;
QLabel *m_application_name;
QLabel *m_copyright;
QLabel *m_license;
};
#endif // ABOUTWINDOW_H
......@@ -22,7 +22,9 @@ MainWindow::MainWindow(QWidget *parent,
m_compose_button(new QToolButton(m_toolbar)),
m_refresh_button(new QToolButton(m_toolbar)),
m_prefs_button(new QToolButton(m_toolbar)),
m_about_button(new QToolButton(m_toolbar)),
m_prefs_window(new PreferencesWindow()),
m_about_window(new AboutWindow()),
m_account_manager(manager)
{
// onboarding layout
......@@ -73,6 +75,18 @@ MainWindow::MainWindow(QWidget *parent,
QWidget * spacer = new QWidget;
spacer->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
m_toolbar->addWidget(spacer);
QObject::connect(m_about_button, &QToolButton::clicked, [=] () {
m_about_window->show();
});
m_about_button->setIcon (pixmap_from_theme (palette (), "michabo-action-about",
":/embedded-assets/icons/action-about.svg",
Default, 24));
m_about_button->setText (tr("About"));
m_about_button->setToolTip (tr("About"));
m_toolbar->addWidget(m_about_button);
m_toolbar->addWidget(m_prefs_button);
// layout selection
......
......@@ -6,6 +6,7 @@
#include "identitywidget.h"
#include "timelineselectorwidget.h"
#include "preferenceswindow.h"
#include "aboutwindow.h"
#include <QMainWindow>
#include <QWidget>
......@@ -35,7 +36,9 @@ private:
QToolButton *m_compose_button;
QToolButton *m_refresh_button;
QToolButton *m_prefs_button;
QToolButton *m_about_button;
PreferencesWindow *m_prefs_window;
AboutWindow *m_about_window;
Michabo::AccountManager *m_account_manager;
void updateLayout();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment