ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
player_fullscreen.h
Go to the documentation of this file.
1//
2// Copyright (c) 2026, Astute Systems PTY LTD
3//
4// This file is part of the VivoeX project developed by Astute Systems.
5//
6// License. See the LICENSE file in the project root for full license details.
7//
12
13#ifndef STREAMS_PLAYER_FULLSCREEN_H
14#define STREAMS_PLAYER_FULLSCREEN_H
15
16#include <QDialog>
17#include <QGraphicsOpacityEffect>
18#include <QLabel>
19#include <QList>
20#include <QMargins>
21#include <QObject>
22#include <QPointer>
23#include <QPropertyAnimation>
24#include <QPushButton>
25#include <QRect>
26#include <QShortcut>
27#include <QString>
28#include <QWidget>
29
30namespace toolx::streams {
31
34class PlayerFullscreen : public QObject
35{
36 Q_OBJECT
37
38public:
45 explicit PlayerFullscreen(QDialog *dialog, QPushButton *button);
46
47 ~PlayerFullscreen() final = default;
48
49 PlayerFullscreen(const PlayerFullscreen &) = delete;
50 PlayerFullscreen &operator=(const PlayerFullscreen &) = delete;
51
55 void toggle();
56
57private:
59 QDialog *m_dialog;
61 QPushButton *m_button;
65 bool m_was_maximized = false;
67 QShortcut *m_escape = nullptr;
69 QList<QPointer<QWidget>> m_hidden_widgets;
71 QMargins m_margins;
73 int m_spacing = 0;
77 QLabel *m_hint = nullptr;
79 QGraphicsOpacityEffect *m_hint_effect = nullptr;
81 QPropertyAnimation *m_hint_animation = nullptr;
82
84 void showHint();
85
87 void hideHint();
88
90 void setChromeHidden(bool hidden);
91
93 void updateButton();
94};
95
96} // namespace toolx::streams
97
98#endif // STREAMS_PLAYER_FULLSCREEN_H
PlayerFullscreen(QDialog *dialog, QPushButton *button)
Attach fullscreen handling to a player dialog.
Definition player_fullscreen.cpp:26
QString m_style_sheet
The dialog style sheet before entering fullscreen.
Definition player_fullscreen.h:75
QGraphicsOpacityEffect * m_hint_effect
Opacity effect of the hint.
Definition player_fullscreen.h:79
void setChromeHidden(bool hidden)
Hide (or restore) everything except the video view, so the video fills the screen.
Definition player_fullscreen.cpp:115
QRect m_normal_geometry
The geometry before entering fullscreen.
Definition player_fullscreen.h:63
int m_spacing
The layout spacing before entering fullscreen.
Definition player_fullscreen.h:73
void toggle()
Toggle fullscreen on / off.
Definition player_fullscreen.cpp:45
QMargins m_margins
The layout margins before entering fullscreen.
Definition player_fullscreen.h:71
void showHint()
Show the hint at the top centre, then fade it out.
Definition player_fullscreen.cpp:80
QLabel * m_hint
The "exit fullscreen" hint overlay.
Definition player_fullscreen.h:77
void hideHint()
Hide the hint immediately.
Definition player_fullscreen.cpp:70
QShortcut * m_escape
Esc shortcut, enabled only while fullscreen.
Definition player_fullscreen.h:67
QList< QPointer< QWidget > > m_hidden_widgets
Widgets hidden while fullscreen (status bar, buttons).
Definition player_fullscreen.h:69
QDialog * m_dialog
The player dialog.
Definition player_fullscreen.h:59
void updateButton()
Update the button text and tooltip for the current state.
Definition player_fullscreen.cpp:150
bool m_was_maximized
Whether the window was maximised before entering fullscreen.
Definition player_fullscreen.h:65
QPropertyAnimation * m_hint_animation
Fade out animation of the hint.
Definition player_fullscreen.h:81
QPushButton * m_button
The toggle button.
Definition player_fullscreen.h:61