[vlc-commits] [Git][videolan/vlc][master] 5 commits: qml: introduce `highPixelDensityThreshold` in `VLCStyle.qml`

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Aug 24 10:54:59 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
23176383 by Fatih Uzunoglu at 2025-08-24T10:39:15+00:00
qml: introduce `highPixelDensityThreshold` in `VLCStyle.qml`

- - - - -
c3fa7dd0 by Fatih Uzunoglu at 2025-08-24T10:39:15+00:00
qml: disable sub-pixel alignment of flickable content with high dpi in `ListViewExt`

Sub-pixel alignment can be useful with animations (including smooth scrolling), but
it should not be necessary if the screen is high dpi.

There is similar concern in `anchors.centerIn`, but `anchors.alignWhenCentered` is
`true` by default (unlike `Flickable`'s` `pixelAligned`).

- - - - -
c3f97a91 by Fatih Uzunoglu at 2025-08-24T10:39:15+00:00
qml: disable sub-pixel alignment of flickable content with high dpi in `HomePage`

Sub-pixel alignment can be useful with animations (including smooth scrolling), but
it should not be necessary if the screen is high dpi.

There is similar concern in `anchors.centerIn`, but `anchors.alignWhenCentered` is
`true` by default (unlike `Flickable`'s` `pixelAligned`).

- - - - -
98aca201 by Fatih Uzunoglu at 2025-08-24T10:39:15+00:00
qml: disable sub-pixel alignment of flickable content with high dpi in `ExpandGridView`

Sub-pixel alignment can be useful with animations (including smooth scrolling), but
it should not be necessary if the screen is high dpi.

There is similar concern in `anchors.centerIn`, but `anchors.alignWhenCentered` is
`true` by default (unlike `Flickable`'s` `pixelAligned`).

- - - - -
81d3086f by Fatih Uzunoglu at 2025-08-24T10:39:15+00:00
qml: disable sub-pixel alignment of flickable content with high dpi in `BrowseHomeDisplay`

Sub-pixel alignment can be useful with animations (including smooth scrolling), but
it should not be necessary if the screen is high dpi.

There is similar concern in `anchors.centerIn`, but `anchors.alignWhenCentered` is
`true` by default (unlike `Flickable`'s` `pixelAligned`).

- - - - -


5 changed files:

- modules/gui/qt/medialibrary/qml/HomePage.qml
- modules/gui/qt/network/qml/BrowseHomeDisplay.qml
- modules/gui/qt/style/VLCStyle.qml
- modules/gui/qt/widgets/qml/ExpandGridView.qml
- modules/gui/qt/widgets/qml/ListViewExt.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/HomePage.qml
=====================================
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  ******************************************************************************/
 import QtQuick
+import QtQuick.Window
 import QtQuick.Controls
 import QtQuick.Templates as T
 
@@ -92,6 +93,8 @@ T.Page {
         topMargin: VLCStyle.layoutTitle_top_padding
         bottomMargin: topMargin
 
+        pixelAligned: (Screen.pixelDensity >= VLCStyle.highPixelDensityThreshold) // no need for sub-pixel alignment with high pixel density
+
         property bool _hasMedias: true
 
         Timer {


=====================================
modules/gui/qt/network/qml/BrowseHomeDisplay.qml
=====================================
@@ -16,6 +16,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 import QtQuick
+import QtQuick.Window
 import QtQuick.Controls
 import QtQuick.Templates as T
 import QtQml.Models
@@ -133,6 +134,8 @@ FocusScope {
 
         focus: true
 
+        pixelAligned: (Screen.pixelDensity >= VLCStyle.highPixelDensityThreshold) // no need for sub-pixel alignment with high pixel density
+
         contentWidth: column.width
         contentHeight: column.height
 


=====================================
modules/gui/qt/style/VLCStyle.qml
=====================================
@@ -47,6 +47,8 @@ QtObject {
         ctx: MainCtx
     }
 
+    readonly property real highPixelDensityThreshold: 5.9 // 150 dpi (dpmm)
+
     // Sizes
     readonly property double margin_xxxsmall: MainCtx.dp(2, scale);
     readonly property double margin_xxsmall: MainCtx.dp(4, scale);


=====================================
modules/gui/qt/widgets/qml/ExpandGridView.qml
=====================================
@@ -795,6 +795,8 @@ FocusScope {
 
         boundsBehavior: Flickable.StopAtBounds
 
+        pixelAligned: (Screen.pixelDensity >= VLCStyle.highPixelDensityThreshold) // no need for sub-pixel alignment with high pixel density
+
         ScrollBar.vertical: ScrollBarExt {
             id: flickableScrollBar
         }


=====================================
modules/gui/qt/widgets/qml/ListViewExt.qml
=====================================
@@ -77,6 +77,8 @@ ListView {
 
     // Settings
 
+    pixelAligned: (Screen.pixelDensity >= VLCStyle.highPixelDensityThreshold) // no need for sub-pixel alignment with high pixel density
+
     focus: true
 
     activeFocusOnTab: true



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/35401cd15fa70124eccbc6f6b51d9e50011f4be1...81d3086ff0a31b82e495f13ceb3c24cc9d6e7922

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/35401cd15fa70124eccbc6f6b51d9e50011f4be1...81d3086ff0a31b82e495f13ceb3c24cc9d6e7922
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list