Krita Source Code Documentation
Loading...
Searching...
No Matches
KisWelcomePageWidget.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2018 Scott Petrovic <scottpetrovic@gmail.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KISWELCOMEPAGEWIDGET_H
8#define KISWELCOMEPAGEWIDGET_H
9
10#include "kritaui_export.h"
11#include "KisViewManager.h"
12#include <KisUpdaterBase.h>
13#include <KisKineticScroller.h>
14
15#include <QAction>
16#include <QWidget>
17#include "ui_KisWelcomePage.h"
18#include <QStandardItemModel>
19#include <QScopedPointer>
20#include <QFont>
21
22#include "config-updaters.h"
24class KisMainWindow;
25
27class KRITAUI_EXPORT KisWelcomePageWidget : public QWidget, public Ui::KisWelcomePage
28{
29 Q_OBJECT
30
31 public:
32 explicit KisWelcomePageWidget(QWidget *parent);
33 ~KisWelcomePageWidget() override;
34
35 void setMainWindow(KisMainWindow* m_mainWindow);
36
37public Q_SLOTS:
40 void showDropAreaIndicator(bool show);
41
42 void slotUpdateThemeColors();
43
44#ifdef ENABLE_UPDATERS
45 void slotSetUpdateStatus(KisUpdaterStatus updateStatus);
46 void slotShowUpdaterErrorDetails();
47#endif
48
49private Q_SLOTS:
50 void slotNewFileClicked();
51 void slotOpenFileClicked();
52 void slotPaste();
53
54 void newsStateChanged(bool hasNews);
55
56 void recentDocumentClicked(QModelIndex index);
57 void slotRecentDocContextMenuRequest(const QPoint &pos);
58
62 void slotRecentFilesModelIsUpToDate();
63
64 void recentFilesResized();
65
66 void slotScrollerStateChanged(QScroller::State state){ KisKineticScroller::updateCursor(this, state); }
67
68 void slotSetNewsEnabled(bool newsEnabled);
69 void slotCheckNews();
70
71#ifdef ENABLE_UPDATERS
72 void slotRunVersionUpdate();
73#endif
74
75#ifdef Q_OS_ANDROID
76 void slotUpdateDonationState();
77#endif
78
79 bool isDevelopmentBuild();
80
81 QFont largerFont();
82
83protected:
84
85 // QWidget overrides
86 void dragEnterEvent(QDragEnterEvent * event) override;
87 void dropEvent(QDropEvent * event) override;
88 void dragMoveEvent(QDragMoveEvent * event) override;
89 void dragLeaveEvent(QDragLeaveEvent * event) override;
90 void changeEvent(QEvent *event) override;
91
92 bool eventFilter(QObject *watched, QEvent *event) override;
93
94
95private:
96 void setupNewsLangSelection(QMenu *newsOptionMenu);
97 void showDevVersionHighlight();
98
99 static void updateShortcutLink(QToolButton *button, QLabel *label, QAction *action);
100
101#ifdef ENABLE_UPDATERS
102 void updateVersionUpdaterFrame();
103#endif
104
105#ifdef Q_OS_ANDROID
106 void initDonations();
107#endif
108
109 KisMainWindow *m_mainWindow {nullptr};
110
115 const QString analyticsString = "pk_campaign=startup-sceen&pk_kwd=";
116
117
118 // keeping track of link colors with theme change
119 QColor textColor;
123
125#ifdef ENABLE_UPDATERS
126 QScopedPointer<KisUpdaterBase> m_versionUpdater;
127 KisUpdaterStatus m_updaterStatus;
128#endif
129
130 QScopedPointer<RecentItemDelegate> recentItemDelegate;
131
132};
133
134#endif // KISWELCOMEPAGEWIDGET_H
Main window for Krita.
A widget for displaying if no documents are open. This will display in the MDI area.
void slotScrollerStateChanged(QScroller::State state)
QScopedPointer< RecentItemDelegate > recentItemDelegate
QString button(const QWheelEvent &ev)
KRITAWIDGETUTILS_EXPORT void updateCursor(QWidget *source, QScroller::State state)