MythTV master
interactivescreen.cpp
Go to the documentation of this file.
1// MythTV
2#include "mythplayerui.h"
4
6 : MythScreenType(static_cast<MythScreenType*>(nullptr), Name),
7 m_player(Player)
8{
9 m_painter = Painter;
10 UpdateArea();
11}
12
14{
15 if (m_player)
16 emit m_player->ResizeForInteractiveTV(QRect());
17}
18
20{
21 if (m_childrenList.isEmpty())
22 {
23 m_safeArea = {};
24 }
25 else if (m_player && m_player->GetVideoOutput())
26 {
27 float tmp = 0.0;
28 QRect dummy;
29 m_player->GetVideoOutput()->GetOSDBounds(dummy, m_safeArea, tmp, tmp, tmp);
30 }
32}
33
35{
36 UpdateArea();
37
38 QRegion visible;
39 for (const auto *img : std::as_const(m_childrenList))
40 visible = visible.united(img->GetArea());
41
42 if (visible.isEmpty())
43 return;
44
45 QRect bounding = visible.boundingRect();
46 bounding = bounding.translated(m_safeArea.topLeft());
47 bounding = m_safeArea.intersected(bounding);
48 int left = m_safeArea.left() - bounding.left();
49 int top = m_safeArea.top() - bounding.top();
50 SetArea(MythRect(bounding));
51
52 for (auto *img : std::as_const(m_childrenList))
53 img->SetArea(MythRect(img->GetArea().translated(left, top)));
54}
55
56#include "moc_interactivescreen.cpp"
InteractiveScreen(MythPlayerUI *Player, MythPainter *Painter, const QString &Name)
MythPlayerUI * m_player
void Close() override
void ResizeForInteractiveTV(const QRect &Rect)
MythVideoOutput * GetVideoOutput(void)
Definition: mythplayer.h:163
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:18
Screen in which all other widgets are contained and rendered.
virtual void SetArea(const MythRect &rect)
Definition: mythuitype.cpp:596
MythPainter * m_painter
Definition: mythuitype.h:309
QList< MythUIType * > m_childrenList
Definition: mythuitype.h:266
virtual void GetOSDBounds(QRect &Total, QRect &Visible, float &VisibleAspect, float &FontScaling, float ThemeAspect) const