Skip to content

Commit fb15724

Browse files
committed
Plugins::Player: add hide tool bar
1 parent e2dcf05 commit fb15724

16 files changed

Lines changed: 267 additions & 62 deletions

‎App/Client/View.cpp‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,28 @@ CView::~CView()
1818
{
1919
qDebug(log) << Q_FUNC_INFO;
2020
}
21+
22+
int CView::SetFullScreen(bool bFull)
23+
{
24+
int nRet = 0;
25+
nRet = OnFullScreen(bFull);
26+
//! Call the void OnFullScreen(bool) of the current view
27+
//! \see CFrmPlayer::OnFullScreen
28+
//! \snippet Plugins\Player\FrmPlayer.cpp Full Screen
29+
auto pWin = GetCurrentView();
30+
if(pWin) {
31+
if(-1 < pWin->metaObject()->indexOfMethod("OnFullScreen(bool)")) {
32+
int nRet = 0;
33+
bool bRet = QMetaObject::invokeMethod(
34+
pWin, "OnFullScreen",
35+
Qt::DirectConnection,
36+
Q_RETURN_ARG(int, nRet),
37+
Q_ARG(bool, bFull));
38+
if(!bRet || nRet) {
39+
qCritical(log) << QString("Call %1:OnFullScreen(bool) fail")
40+
.arg(pWin->metaObject()->className());
41+
}
42+
}
43+
}
44+
return nRet;
45+
}

‎App/Client/View.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CView : public QWidget
3737
virtual int SetCurrentView(QWidget* pView) = 0;
3838
virtual void SetWidowsTitle(QWidget* pView, const QString& szTitle,
3939
const QIcon& icon, const QString& szToolTip) = 0;
40-
virtual int SetFullScreen(bool bFull) = 0;
40+
virtual int SetFullScreen(bool bFull);
4141
virtual int SetVisibleTab(bool bVisible) = 0;
4242

4343
Q_SIGNALS:
@@ -46,6 +46,7 @@ class CView : public QWidget
4646
void sigCurrentChanged(const QWidget* pView);
4747

4848
protected:
49+
virtual int OnFullScreen(bool bFull) = 0;
4950
CParameterApp* m_pParameterApp;
5051
};
5152

‎App/Client/ViewSplitter.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ void CViewSplitter::SetWidowsTitle(
246246
SetSizes();
247247
}
248248

249-
int CViewSplitter::SetFullScreen(bool bFull)
249+
int CViewSplitter::OnFullScreen(bool bFull)
250250
{
251251
int nRet = 0;
252252
if(0 >= m_nCount) return 0;

‎App/Client/ViewSplitter.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CViewSplitter : public CView
2828
virtual void SetWidowsTitle(
2929
QWidget *pView, const QString &szTitle,
3030
const QIcon &icon, const QString &szToolTip) override;
31-
virtual int SetFullScreen(bool bFull) override;
31+
virtual int OnFullScreen(bool bFull) override;
3232
virtual int SetVisibleTab(bool bVisible) override;
3333

3434
private:

‎App/Client/ViewTable.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void CViewTable::SetWidowsTitle(QWidget* pView, const QString& szTitle,
142142
m_pTab->setTabIcon(nIndex, QIcon());
143143
}
144144

145-
int CViewTable::SetFullScreen(bool bFull)
145+
int CViewTable::OnFullScreen(bool bFull)
146146
{
147147
if(!m_pTab) return -1;
148148
if(bFull) {

‎App/Client/ViewTable.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CViewTable : public CView
2626
virtual QWidget *GetCurrentView() override;
2727
virtual int SetCurrentView(QWidget* pView) override;
2828
virtual void SetWidowsTitle(QWidget* pView, const QString& szTitle, const QIcon& icon, const QString& szToolTip) override;
29-
virtual int SetFullScreen(bool bFull) override;
29+
virtual int OnFullScreen(bool bFull) override;
3030
virtual int SetVisibleTab(bool bVisible) override;
3131

3232
private Q_SLOTS:

‎Plugins/Player/DlgPlayer.cpp‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ CDlgPlayer::CDlgPlayer(CParameterPlayer *pPara, QWidget *parent)
8383
m_pRecordUI = new CParameterRecordUI(ui->tabWidget);
8484
m_pRecordUI->SetParameter(&m_pParameters->m_Record);
8585
ui->tabWidget->addTab(m_pRecordUI, m_pRecordUI->windowIcon(), m_pRecordUI->windowTitle());
86+
87+
#ifndef HAVE_QVideoWidget
88+
ui->lbHideToolBar->hide();
89+
ui->spHideToolBar->hide();
90+
ui->lbHideToolBarUnit->hide();
91+
#endif
92+
ui->spHideToolBar->setValue(m_pParameters->GetHideToolBar());
8693
}
8794

8895
CDlgPlayer::~CDlgPlayer()
@@ -132,6 +139,8 @@ void CDlgPlayer::accept()
132139
break;
133140
}
134141

142+
m_pParameters->SetHideToolBar(ui->spHideToolBar->value());
143+
135144
m_pParameters->SetSubtitle(ui->cbEnableSubtitle->isChecked());
136145
m_pParameters->SetEnableAudioInput(ui->gbAudioInput->isChecked());
137146
m_pParameters->SetAudioInput(ui->cmbAudioInput->currentIndex());

‎Plugins/Player/DlgPlayer.ui‎

Lines changed: 87 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,93 @@
5454
</item>
5555
</layout>
5656
</item>
57+
<item row="1" column="0">
58+
<layout class="QHBoxLayout" name="horizontalLayout">
59+
<item>
60+
<widget class="QComboBox" name="cmbType"/>
61+
</item>
62+
<item>
63+
<widget class="QComboBox" name="cmbCamera">
64+
<property name="sizePolicy">
65+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
66+
<horstretch>0</horstretch>
67+
<verstretch>0</verstretch>
68+
</sizepolicy>
69+
</property>
70+
</widget>
71+
</item>
72+
<item>
73+
<widget class="QLineEdit" name="leUrl"/>
74+
</item>
75+
<item>
76+
<widget class="QPushButton" name="pbUrlBrowse">
77+
<property name="text">
78+
<string>Browse</string>
79+
</property>
80+
</widget>
81+
</item>
82+
</layout>
83+
</item>
84+
<item row="2" column="0">
85+
<layout class="QHBoxLayout" name="horizontalLayout_4">
86+
<item>
87+
<widget class="QLabel" name="lbHideToolBar">
88+
<property name="sizePolicy">
89+
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
90+
<horstretch>0</horstretch>
91+
<verstretch>0</verstretch>
92+
</sizepolicy>
93+
</property>
94+
<property name="text">
95+
<string>Hide play toolbar when full scrren(0: disable)</string>
96+
</property>
97+
</widget>
98+
</item>
99+
<item>
100+
<widget class="QSpinBox" name="spHideToolBar">
101+
<property name="sizePolicy">
102+
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
103+
<horstretch>0</horstretch>
104+
<verstretch>0</verstretch>
105+
</sizepolicy>
106+
</property>
107+
<property name="maximum">
108+
<number>999</number>
109+
</property>
110+
<property name="value">
111+
<number>60</number>
112+
</property>
113+
</widget>
114+
</item>
115+
<item>
116+
<widget class="QLabel" name="lbHideToolBarUnit">
117+
<property name="sizePolicy">
118+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
119+
<horstretch>0</horstretch>
120+
<verstretch>0</verstretch>
121+
</sizepolicy>
122+
</property>
123+
<property name="text">
124+
<string>S</string>
125+
</property>
126+
</widget>
127+
</item>
128+
</layout>
129+
</item>
57130
<item row="3" column="0">
131+
<widget class="QCheckBox" name="cbEnableSubtitle">
132+
<property name="sizePolicy">
133+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
134+
<horstretch>0</horstretch>
135+
<verstretch>0</verstretch>
136+
</sizepolicy>
137+
</property>
138+
<property name="text">
139+
<string>Enable subtitle</string>
140+
</property>
141+
</widget>
142+
</item>
143+
<item row="4" column="0">
58144
<layout class="QHBoxLayout" name="horizontalLayout_11">
59145
<item>
60146
<widget class="QGroupBox" name="gbAudioInput">
@@ -141,34 +227,7 @@
141227
</item>
142228
</layout>
143229
</item>
144-
<item row="1" column="0">
145-
<layout class="QHBoxLayout" name="horizontalLayout">
146-
<item>
147-
<widget class="QComboBox" name="cmbType"/>
148-
</item>
149-
<item>
150-
<widget class="QComboBox" name="cmbCamera">
151-
<property name="sizePolicy">
152-
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
153-
<horstretch>0</horstretch>
154-
<verstretch>0</verstretch>
155-
</sizepolicy>
156-
</property>
157-
</widget>
158-
</item>
159-
<item>
160-
<widget class="QLineEdit" name="leUrl"/>
161-
</item>
162-
<item>
163-
<widget class="QPushButton" name="pbUrlBrowse">
164-
<property name="text">
165-
<string>Browse</string>
166-
</property>
167-
</widget>
168-
</item>
169-
</layout>
170-
</item>
171-
<item row="4" column="0">
230+
<item row="5" column="0">
172231
<spacer name="verticalSpacer">
173232
<property name="orientation">
174233
<enum>Qt::Orientation::Vertical</enum>
@@ -181,13 +240,6 @@
181240
</property>
182241
</spacer>
183242
</item>
184-
<item row="2" column="0">
185-
<widget class="QCheckBox" name="cbEnableSubtitle">
186-
<property name="text">
187-
<string>Enable subtitle</string>
188-
</property>
189-
</widget>
190-
</item>
191243
</layout>
192244
</widget>
193245
</widget>

0 commit comments

Comments
 (0)