[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: use image for the shadow in Player instead of shader effect
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Jun 30 07:46:20 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
e5832e6d by Fatih Uzunoglu at 2024-06-30T07:33:35+00:00
qml: use image for the shadow in Player instead of shader effect
`DropShadow` available in `Qt5Compat` does not support adjusting
samples (Qt 6.2), because we do not want to compile shaders at
run-time (explicit opt-out on Qt 6.7).
The default samples setting yields an inferior shadow quality
compared to the pre-generated shadow image. Not only that,
depending on the platform, it may appear completely bugged.
Here, this shadow is a stand-alone shadow so we do not need
caching. Without caching, using pre-generated image can be
justified also considering the (a)synchronoucity.
- - - - -
27e459c7 by Fatih Uzunoglu at 2024-06-30T07:33:35+00:00
qml: remove CoverShadow.qml
- - - - -
4 changed files:
- modules/gui/qt/Makefile.am
- modules/gui/qt/player/qml/Player.qml
- modules/gui/qt/qml.qrc
- − modules/gui/qt/widgets/qml/CoverShadow.qml
Changes:
=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -1042,7 +1042,6 @@ libqt_plugin_la_QML = \
widgets/qml/ComboBoxExt.qml \
widgets/qml/AcrylicBackground.qml \
widgets/qml/AnimatedBackground.qml \
- widgets/qml/CoverShadow.qml \
widgets/qml/CSDThemeButton.qml \
widgets/qml/CSDThemeButtonSet.qml \
widgets/qml/CSDWindowButton.qml \
=====================================
modules/gui/qt/player/qml/Player.qml
=====================================
@@ -431,17 +431,19 @@ FocusScope {
if (status === Image.Ready)
backgroundImage.scheduleUpdate()
}
- }
- //don't use a DoubleShadow here as cover size will change
- //dynamically with the window size
- Widgets.CoverShadow {
- anchors.fill: parent
- source: cover
- primaryVerticalOffset: VLCStyle.dp(24)
- primaryBlurRadius: VLCStyle.dp(54)
- secondaryVerticalOffset: VLCStyle.dp(5)
- secondaryBlurRadius: VLCStyle.dp(14)
+ // TODO: Qt >= 6.4 Investigate using MultiEffect.
+ Widgets.DoubleShadow {
+ anchors.centerIn: parent
+ sourceItem: parent
+
+ cache: false
+
+ primaryVerticalOffset: VLCStyle.dp(24)
+ primaryBlurRadius: VLCStyle.dp(54)
+ secondaryVerticalOffset: VLCStyle.dp(5)
+ secondaryBlurRadius: VLCStyle.dp(14)
+ }
}
}
=====================================
modules/gui/qt/qml.qrc
=====================================
@@ -83,7 +83,6 @@
<file alias="LocalTabBar.qml">widgets/qml/LocalTabBar.qml</file>
<file alias="IconButton.qml">widgets/qml/IconButton.qml</file>
<file alias="DragItem.qml">widgets/qml/DragItem.qml</file>
- <file alias="CoverShadow.qml">widgets/qml/CoverShadow.qml</file>
<file alias="DefaultShadow.qml">widgets/qml/DefaultShadow.qml</file>
<file alias="OverlayMenu.qml">widgets/qml/OverlayMenu.qml</file>
<file alias="ToolTipExt.qml">widgets/qml/ToolTipExt.qml</file>
=====================================
modules/gui/qt/widgets/qml/CoverShadow.qml deleted
=====================================
@@ -1,59 +0,0 @@
-
-/*****************************************************************************
- * Copyright (C) 2020 VLC authors and VideoLAN
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * ( at your option ) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-import QtQuick
-import Qt5Compat.GraphicalEffects
-
-import "qrc:///style/"
-
-Item {
- id: root
-
- property alias cached: primaryShadow.cached
- property alias source: primaryShadow.source
-
- property alias primaryColor: primaryShadow.color
- property alias primaryVerticalOffset: primaryShadow.verticalOffset
- property alias primaryHorizontalOffset: primaryShadow.horizontalOffset
- property alias primaryBlurRadius: primaryShadow.radius
-
- property alias secondaryColor: secondaryShadow.color
- property alias secondaryVerticalOffset: secondaryShadow.verticalOffset
- property alias secondaryHorizontalOffset: secondaryShadow.horizontalOffset
- property alias secondaryBlurRadius: secondaryShadow.radius
-
- DropShadow {
- id: primaryShadow
-
- anchors.fill: parent
- horizontalOffset: 0
- spread: 0
- color: Qt.rgba(0, 0, 0, .22)
- }
-
- DropShadow {
- id: secondaryShadow
-
- anchors.fill: parent
- source: primaryShadow.source
- horizontalOffset: 0
- spread: 0
- color: Qt.rgba(0, 0, 0, .18)
- cached: root.cached
- }
-}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/482c5b4a3e972f5c0f4779ad44caacddca1d01e3...27e459c7783f02d9e62cd82d8dcb1dab4ba349ff
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/482c5b4a3e972f5c0f4779ad44caacddca1d01e3...27e459c7783f02d9e62cd82d8dcb1dab4ba349ff
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