dock/src/mainwindow.h

79 lines
1.9 KiB
C
Raw Normal View History

2021-03-15 20:17:11 -07:00
/*
2021-03-16 03:13:34 -07:00
* Copyright (C) 2021 CutefishOS Team.
2021-03-15 20:17:11 -07:00
*
2021-06-20 11:52:26 -07:00
* Author: Reion Wong <reionwong@gmail.com>
2021-03-15 20:17:11 -07:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QQuickView>
#include <QTimer>
2021-07-21 01:49:49 -07:00
#include "activity.h"
2021-03-15 20:17:11 -07:00
#include "docksettings.h"
#include "applicationmodel.h"
#include "fakewindow.h"
2021-05-06 22:36:48 -07:00
#include "trashmanager.h"
2021-03-15 20:17:11 -07:00
class MainWindow : public QQuickView
{
Q_OBJECT
public:
explicit MainWindow(QQuickView *parent = nullptr);
~MainWindow();
signals:
void resizingFished();
void iconSizeChanged();
void positionChanged();
private:
QRect windowRect() const;
void resizeWindow();
2021-07-21 21:55:44 -07:00
void initScreens();
2021-03-15 20:17:11 -07:00
void initSlideWindow();
void updateViewStruts();
2021-06-20 11:52:26 -07:00
void clearViewStruts();
2021-03-15 20:17:11 -07:00
void createFakeWindow();
void deleteFakeWindow();
private slots:
2021-07-21 21:55:44 -07:00
void onPrimaryScreenChanged(QScreen *screen);
2021-03-15 20:17:11 -07:00
void onPositionChanged();
void onIconSizeChanged();
void onVisibilityChanged();
2021-06-20 11:52:26 -07:00
protected:
bool eventFilter(QObject *obj, QEvent *e) override;
2021-03-15 20:17:11 -07:00
private:
2021-07-21 01:49:49 -07:00
Activity *m_activity;
2021-03-15 20:17:11 -07:00
DockSettings *m_settings;
ApplicationModel *m_appModel;
FakeWindow *m_fakeWindow;
2021-05-06 22:36:48 -07:00
TrashManager *m_trashManager;
2021-06-20 11:52:26 -07:00
2021-06-22 00:24:16 -07:00
bool m_hideBlocked;
2021-06-20 11:52:26 -07:00
QTimer *m_showTimer;
QTimer *m_hideTimer;
2021-03-15 20:17:11 -07:00
};
#endif // MAINWINDOW_H