Falkon Develop
Cross-platform Qt-based web browser
tabicon.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2014-2018 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#ifndef TABICON_H
19#define TABICON_H
20
21#include <QWidget>
22#include <QImage>
23
24#include "qzcommon.h"
25
26class QTimer;
27
28class WebTab;
29
30class FALKON_EXPORT TabIcon : public QWidget
31{
32 Q_OBJECT
33
34public:
35 struct Data {
41 };
42 explicit TabIcon(QWidget* parent = nullptr);
43
44 void setWebTab(WebTab* tab);
45 void updateIcon();
46
47 static Data *data();
48
49Q_SIGNALS:
50 void resized();
51
52private Q_SLOTS:
53 void showLoadingAnimation();
54 void hideLoadingAnimation();
55
56 void updateAudioIcon(bool recentlyAudible);
57 void updateAnimationFrame();
58
59private:
60 void show();
61 void hide();
62 bool shouldBeVisible() const;
63
64 bool event(QEvent *event) override;
65 void paintEvent(QPaintEvent* event) override;
66 void mousePressEvent(QMouseEvent* event) override;
67
68 WebTab* m_tab;
69 QTimer* m_updateTimer;
70 QTimer* m_hideTimer;
71 QPixmap m_sitePixmap;
72 int m_currentFrame;
73 bool m_animationRunning;
74 bool m_audioIconDisplayed;
75 QRect m_audioIconRect;
76};
77
78#endif // TABICON_H
void resized()
Definition: webtab.h:40
#define FALKON_EXPORT
Definition: qzcommon.h:28
int framesCount
Definition: tabicon.h:36
QPixmap audioPlayingPixmap
Definition: tabicon.h:39
int animationInterval
Definition: tabicon.h:37
QPixmap animationPixmap
Definition: tabicon.h:38
QPixmap audioMutedPixmap
Definition: tabicon.h:40