[vlc-commits] Qt: spref, add option to select the fullscreen screen
Pierre Lamot
git at videolan.org
Fri Dec 22 11:06:18 CET 2017
vlc/vlc-3.0 | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Dec 20 17:58:13 2017 +0100| [40e152db5e09f433bb17b848d4bca09d522d1aca] | committer: Hugo Beauzée-Luyssen
Qt: spref, add option to select the fullscreen screen
Ref #19305
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 326c9c13d024670ce80fc233013738ce511813eb)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=40e152db5e09f433bb17b848d4bca09d522d1aca
---
modules/gui/qt/components/simple_preferences.cpp | 26 +++++++++++++++++
modules/gui/qt/ui/sprefs_video.ui | 36 ++++++++++++++++--------
2 files changed, 51 insertions(+), 11 deletions(-)
diff --git a/modules/gui/qt/components/simple_preferences.cpp b/modules/gui/qt/components/simple_preferences.cpp
index cc530e22cf..7121998135 100644
--- a/modules/gui/qt/components/simple_preferences.cpp
+++ b/modules/gui/qt/components/simple_preferences.cpp
@@ -42,6 +42,7 @@
#include <QStyleFactory>
#include <QSettings>
+#include <QScreen>
#include <QtAlgorithms>
#include <QDir>
#include <assert.h>
@@ -361,6 +362,24 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONFIG_BOOL( "video-deco", windowDecorations );
CONFIG_GENERIC( "vout", StringList, ui.voutLabel, outputModule );
+ optionWidgets["fullscreenScreenB"] = ui.fullscreenScreenBox;
+ ui.fullscreenScreenBox->addItem( qtr("Automatic"), -1 );
+ int i_screenCount = 0;
+ foreach( QScreen* screen, QGuiApplication::screens() )
+ {
+ ui.fullscreenScreenBox->addItem( screen->name(), i_screenCount );
+ i_screenCount++;
+ }
+ p_config = config_FindConfig( "qt-fullscreen-screennumber" );
+ if( p_config )
+ {
+ int i_defaultScreen = p_config->value.i + 1;
+ if ( i_defaultScreen < 0 || i_defaultScreen > ( ui.fullscreenScreenBox->count() - 1 ) )
+ ui.fullscreenScreenBox->setCurrentIndex( 0 );
+ else
+ ui.fullscreenScreenBox->setCurrentIndex(p_config->value.i + 1);
+ }
+
#ifdef _WIN32
CONFIG_BOOL( "directx-overlay", overlay );
CONFIG_BOOL( "directx-hw-yuv", hwYUVBox );
@@ -1037,6 +1056,13 @@ void SPrefsPanel::apply()
break;
}
+ case SPrefsVideo:
+ {
+ int i_fullscreenScreen = qobject_cast<QComboBox *>(optionWidgets["fullscreenScreenB"])->currentData().toInt();
+ config_PutInt( p_intf, "qt-fullscreen-screennumber", i_fullscreenScreen );
+ break;
+ }
+
case SPrefsAudio:
{
bool b_checked =
diff --git a/modules/gui/qt/ui/sprefs_video.ui b/modules/gui/qt/ui/sprefs_video.ui
index 766f747c2e..899faeca60 100644
--- a/modules/gui/qt/ui/sprefs_video.ui
+++ b/modules/gui/qt/ui/sprefs_video.ui
@@ -46,6 +46,23 @@
<string>Display</string>
</property>
<layout class="QGridLayout" name="gridLayout">
+ <item row="3" column="0">
+ <widget class="QLabel" name="voutLabel">
+ <property name="text">
+ <string>O&utput</string>
+ </property>
+ <property name="buddy">
+ <cstring>outputModule</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="windowDecorations">
+ <property name="text">
+ <string>Window decorations</string>
+ </property>
+ </widget>
+ </item>
<item row="0" column="0">
<widget class="QCheckBox" name="fullscreen">
<property name="text">
@@ -60,20 +77,16 @@
</property>
</widget>
</item>
- <item row="3" column="0">
- <widget class="QLabel" name="voutLabel">
+ <item row="4" column="1">
+ <widget class="QComboBox" name="fullscreenScreenBox"/>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="fullscreenScreenLabel">
<property name="text">
- <string>O&utput</string>
+ <string>Fullscreen Video Device</string>
</property>
<property name="buddy">
- <cstring>outputModule</cstring>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QCheckBox" name="windowDecorations">
- <property name="text">
- <string>Window decorations</string>
+ <cstring>fullscreenScreenBox</cstring>
</property>
</widget>
</item>
@@ -305,6 +318,7 @@
<tabstop>fullscreen</tabstop>
<tabstop>windowDecorations</tabstop>
<tabstop>outputModule</tabstop>
+ <tabstop>fullscreenScreenBox</tabstop>
<tabstop>overlay</tabstop>
<tabstop>hwYUVBox</tabstop>
<tabstop>kvaFixT23</tabstop>
More information about the vlc-commits
mailing list