[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: simplify subtitle assignment in NetworkGridItem
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Jul 21 08:17:26 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
c44673b1 by Prince Gupta at 2024-07-21T08:01:10+00:00
qml: simplify subtitle assignment in NetworkGridItem
- - - - -
b0828077 by Prince Gupta at 2024-07-21T08:01:10+00:00
qml: improve gridview alignment in browseview
- - - - -
1 changed file:
- modules/gui/qt/network/qml/NetworkGridItem.qml
Changes:
=====================================
modules/gui/qt/network/qml/NetworkGridItem.qml
=====================================
@@ -74,13 +74,17 @@ Widgets.GridItem {
title: model.name || qsTr("Unknown share")
subtitle: {
- if (!model.mrl) {
- return ""
- } else if ((model.type === NetworkMediaModel.TYPE_NODE || model.type === NetworkMediaModel.TYPE_DIRECTORY) && model.mrl.toString() === "vlc://nop") {
- return ""
- } else {
- return model.mrl
- }
+ // make sure subtitle is never empty otherwise it causes alignment issues
+ const defaultTxt = "--"
+
+ const mrl = model.mrl?.toString() || ""
+ const type = model.type
+
+ if ((type === NetworkMediaModel.TYPE_NODE || type === NetworkMediaModel.TYPE_DIRECTORY)
+ && (mrl === "vlc://nop"))
+ return defaultTxt
+
+ return mrl || defaultTxt
}
pictureOverlay: Item {
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d33cfe3be57d00aac84f9b0080df08911604abca...b0828077400bb235f212dc51215cfc577b48c21f
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d33cfe3be57d00aac84f9b0080df08911604abca...b0828077400bb235f212dc51215cfc577b48c21f
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