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
26
class
QTimer;
27
28
class
WebTab
;
29
30
class
FALKON_EXPORT
TabIcon
:
public
QWidget
31
{
32
Q_OBJECT
33
34
public
:
35
struct
Data
{
36
int
framesCount
;
37
int
animationInterval
;
38
QPixmap
animationPixmap
;
39
QPixmap
audioPlayingPixmap
;
40
QPixmap
audioMutedPixmap
;
41
};
42
explicit
TabIcon
(QWidget* parent =
nullptr
);
43
44
void
setWebTab(
WebTab
* tab);
45
void
updateIcon();
46
47
static
Data
*data();
48
49
Q_SIGNALS:
50
void
resized
();
51
52
private
Q_SLOTS:
53
void
showLoadingAnimation();
54
void
hideLoadingAnimation();
55
56
void
updateAudioIcon(
bool
recentlyAudible);
57
void
updateAnimationFrame();
58
59
private
:
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
TabIcon
Definition:
tabicon.h:31
TabIcon::resized
void resized()
WebTab
Definition:
webtab.h:40
qzcommon.h
FALKON_EXPORT
#define FALKON_EXPORT
Definition:
qzcommon.h:28
TabIcon::Data
Definition:
tabicon.h:35
TabIcon::Data::framesCount
int framesCount
Definition:
tabicon.h:36
TabIcon::Data::audioPlayingPixmap
QPixmap audioPlayingPixmap
Definition:
tabicon.h:39
TabIcon::Data::animationInterval
int animationInterval
Definition:
tabicon.h:37
TabIcon::Data::animationPixmap
QPixmap animationPixmap
Definition:
tabicon.h:38
TabIcon::Data::audioMutedPixmap
QPixmap audioMutedPixmap
Definition:
tabicon.h:40
src
lib
tabwidget
tabicon.h
Generated by
1.9.3