Commit 326c9c13 authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf

Qt: spref, add option to select the fullscreen screen

Ref #19305
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 679ec991
......@@ -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 =
......
......@@ -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&amp;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&amp;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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment