thedesk/libthedesk/private/quickwidgetcontainer.h

68 lines
1.8 KiB
C
Raw Normal View History

2020-09-21 22:57:37 +10:00
/****************************************
*
* INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE
* Copyright (C) 2020 Victor Tran
*
* 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
* (at your option) 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 QUICKWIDGETCONTAINER_H
#define QUICKWIDGETCONTAINER_H
#include <QWidget>
namespace Ui {
class QuickWidgetContainer;
}
class Chunk;
2021-03-03 01:09:41 +11:00
class CurrentAppWidget;
2021-04-02 22:56:12 +11:00
class TaskbarApplicationWidget;
2020-09-21 22:57:37 +10:00
struct QuickWidgetContainerPrivate;
class QuickWidgetContainer : public QWidget {
Q_OBJECT
public:
2021-03-03 01:09:41 +11:00
explicit QuickWidgetContainer(QWidget* parent = nullptr);
2020-09-21 22:57:37 +10:00
~QuickWidgetContainer();
2021-03-05 03:13:13 +11:00
QSize sizeHint() const;
2020-09-21 22:57:37 +10:00
void showContainer();
void hideContainer();
2021-03-03 01:09:41 +11:00
bool isShowing();
signals:
void showing();
void hiding();
protected:
friend CurrentAppWidget;
2021-04-02 22:56:12 +11:00
friend TaskbarApplicationWidget;
2021-03-03 01:09:41 +11:00
void setQuickWidget(QWidget* widget);
2020-09-21 22:57:37 +10:00
private:
Ui::QuickWidgetContainer* ui;
QuickWidgetContainerPrivate* d;
void paintEvent(QPaintEvent* event);
void changeEvent(QEvent* event);
2021-03-03 01:09:41 +11:00
bool eventFilter(QObject* watched, QEvent* event);
2020-09-21 22:57:37 +10:00
void calculatePosition();
2021-03-03 01:09:41 +11:00
2020-09-21 22:57:37 +10:00
};
#endif // QUICKWIDGETCONTAINER_H