Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.5 KB
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2014 Boudewijn Rempt <[email protected]>
 *  SPDX-FileCopyrightText: 2021 Alvin Wong <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */
#ifndef KIS_SPLASH_SCREEN_H
#define KIS_SPLASH_SCREEN_H

#include <QWidget>
#include <QTimer>
#include <QVector>

class QPixmap;
class QSvgWidget;
class QLabel;

#include "kritaui_export.h"

class KRITAUI_EXPORT KisSplashScreen : public QWidget
{
    Q_OBJECT
public:
    struct Source {
        QString key;
        QString title;
        QString resourcePath;
        QString artistName;
        bool isAvailable;
        bool isDefault;

        QString description() const;
        QString artistCredit() const;
    };

    explicit KisSplashScreen(int height, QWidget *parent = 0,
        Qt::WindowFlags f = Qt::WindowFlags(Qt::SplashScreen | Qt::FramelessWindowHint));

    void repaint();

    void show();

    void setLoadingText(QString text);

    static Source getCurrentSource();
    static Source getAvailableSource(const QString &key);
    static bool canChooseSplashScreen();
    static QVector<Source> getSources();

private:
    void updateSplashImage(const int height);

    static QString defaultSplashResourcePath();

    QTimer m_timer;
    bool m_displayLinks { false };
    QLabel* m_lblSplash;
    QSvgWidget *m_brandingSvg;
    QSvgWidget *m_bannerSvg;
    QLabel *m_loadingTextLabel;
    QLabel *m_artCreditsLabel;
    QString m_versionHtml;
};

#endif // KIS_SPLASH_SCREEN_H