Commit a2c4b2d4 authored by Pierre Lamot's avatar Pierre Lamot
Browse files

qt: store the user interface scale factor in Qt configuration file

parent 37f0ca02
......@@ -125,6 +125,8 @@ MainInterface::MainInterface(intf_thread_t *_p_intf , QWidget* parent, Qt::Windo
/* */
m_intfUserScaleFactor = var_InheritFloat(p_intf, "qt-interface-scale");
if (m_intfUserScaleFactor == -1)
m_intfUserScaleFactor = getSettings()->value( "MainWindow/interface-scale", 1.0).toFloat();
winId(); //force window creation
QWindow* window = windowHandle();
if (window)
......@@ -221,6 +223,7 @@ MainInterface::~MainInterface()
settings->beginGroup("MainWindow");
settings->setValue( "pl-dock-status", b_playlistDocked );
settings->setValue( "ShowRemainingTime", m_showRemainingTime );
settings->setValue( "interface-scale", m_intfUserScaleFactor );
/* Save playlist state */
settings->setValue( "playlist-visible", playlistVisible );
......
......@@ -153,7 +153,7 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
" This option only works with Windows and " \
"X11 with composite extensions." )
#define INTERFACE_SCALE_TEXT N_( "User scale factor for the interface, betwwen 0.1 and 10.0" )
#define INTERFACE_SCALE_TEXT N_( "Initial user scale factor for the interface, betwwen 0.3 and 3.0" )
#define ERROR_TEXT N_( "Show unimportant error and warnings dialogs" )
......@@ -283,8 +283,11 @@ vlc_module_begin ()
add_float_with_range( "qt-fs-opacity", 0.8, 0.1, 1., OPACITY_FS_TEXT,
OPACITY_FS_LONGTEXT, false )
add_float_with_range( "qt-interface-scale", 1.0, 0.1, 10., INTERFACE_SCALE_TEXT,
//qt-interface-scale is stored in Qt config file
//this option is here to force an initial scale factor at startup
add_float_with_range( "qt-interface-scale", -1.0, 0.3, 3.0, INTERFACE_SCALE_TEXT,
INTERFACE_SCALE_TEXT, false )
change_volatile()
add_bool( "qt-video-autoresize", true, KEEPSIZE_TEXT,
KEEPSIZE_LONGTEXT, false )
......
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