[vlc-commits] [Git][videolan/vlc][master] qt: improve default widths of advanced prefs panels

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Jul 1 09:28:28 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
721cf129 by Lyndon Brown at 2021-07-01T08:53:24+00:00
qt: improve default widths of advanced prefs panels

many panels in the advanced view had horizontal scrolling under the default
widths, giving poor UX. a lot of space was unnecessarily eaten up by the
tree, with width simply shared in a 50:50 split between the tree and the
page panels. (counting just exactly how many is made difficult by the fact
that some long panel titles force automatic width adjustments, and it's
just not worth the effort to work around that to get a count).

with addition of a size policy we can very comfortably steal 100px from the
tree, giving a 3:5 ratio. this alone makes a big difference, but still
leaves 9 panels unfixed on my platform, including four rather significant
ones (two root category nodes and two subcats). an additional bump of +50px
to the panel width takes care of 3 of those.

of the remaining 6:
 - 3 are due to a couple of filters with rather long names. a rather
   substantial further increase in panel width would be required to prevent
   the problem for these. it would be better to simplify the names.
 - 2 are due to a long option name in the x264 plugins, which can be fixed
   later by removing an unnecessary portion of the shorttext.
 - the splitters-clone case remains a little bit off. we could fix this
   with a further +25px maybe, however i plan to shorten certain names
   anyway in later work which will do the job without such extra width so
   it's perhaps not worth it.

this thus implements the size policy, and adjusts the tree and panel widths
from 400px each to 300px and 550px respectively.

users can always adjust these manually, but better to improve the defaults!

- - - - -


1 changed file:

- modules/gui/qt/dialogs/preferences/preferences.cpp


Changes:

=====================================
modules/gui/qt/dialogs/preferences/preferences.cpp
=====================================
@@ -126,6 +126,10 @@ PrefsDialog::PrefsDialog( QWidget *parent, qt_intf_t *_p_intf )
     advanced_split_widget->addWidget( advanced_tree_panel );
     advanced_split_widget->addWidget( advanced_panels_stack );
 
+    advanced_split_widget->setSizes(QList<int>() << 300 << 550);
+    advanced_tree_panel->sizePolicy().setHorizontalStretch(1);
+    advanced_panels_stack->sizePolicy().setHorizontalStretch(2);
+
     stack->insertWidget( ADVANCED, advanced_split_widget );
 
     /* Layout  */
@@ -147,7 +151,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, qt_intf_t *_p_intf )
     BUTTONACT( simple, setSimple() );
     BUTTONACT( all, setAdvanced() );
 
-    QVLCTools::restoreWidgetPosition( p_intf, "Preferences", this, QSize( 800 , 700 ) );
+    QVLCTools::restoreWidgetPosition( p_intf, "Preferences", this, QSize( 850, 700 ) );
 }
 
 PrefsDialog::~PrefsDialog()



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/721cf129d715a1756cc7f292276b94d9601d7a18

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/721cf129d715a1756cc7f292276b94d9601d7a18
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list