Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
e7c8223a by Fatih Uzunoglu at 2026-01-23T10:18:41+00:00
qml: introduce `DelayedBehavior.qml`
- - - - -
6f407249 by Fatih Uzunoglu at 2026-01-23T10:18:41+00:00
qml: make color behavior enabled binding delayed in `PlayButton`
Akin to 078f7edd.
- - - - -
5d5c3ba3 by Fatih Uzunoglu at 2026-01-23T10:18:41+00:00
qml: make color behavior enabled binding delayed in `IconToolButton`
Akin to 078f7edd.
- - - - -
eecc648c by Fatih Uzunoglu at 2026-01-23T10:18:41+00:00
qml: make color behavior enabled binding delayed in `BannerTabButton`
Akin to 078f7edd.
- - - - -
85df2ee9 by Fatih Uzunoglu at 2026-01-23T10:18:41+00:00
qml: use `VLCStyle.DelayedBehavior` in `AnimatedBackground`
No behavioral change intended.
- - - - -
1b28441b by Fatih Uzunoglu at 2026-01-23T10:18:41+00:00
qml: make color behavior enabled binding delayed in `AddressbarButton`
Akin to 078f7edd.
- - - - -
ed053b67 by Fatih Uzunoglu at 2026-01-23T10:18:41+00:00
qml: use `DelayedBehavior` in `AnimatedBackground`
No behavioral change intended.
- - - - -
8 changed files:
- modules/gui/qt/Makefile.am
- modules/gui/qt/meson.build
- modules/gui/qt/network/qml/AddressbarButton.qml
- modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml
- + modules/gui/qt/util/qml/DelayedBehavior.qml
- modules/gui/qt/widgets/qml/AnimatedBackground.qml
- modules/gui/qt/widgets/qml/BannerTabButton.qml
- modules/gui/qt/widgets/qml/IconToolButton.qml
Changes:
=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -1208,7 +1208,8 @@ libqml_module_util_a_QML = \
util/qml/NativeMenu.qml \
util/qml/MLContextMenu.qml \
util/qml/FadeControllerStateGroup.qml \
- util/qml/GridSizeHelper.qml
+ util/qml/GridSizeHelper.qml \
+ util/qml/DelayedBehavior.qml
libqml_module_util_a_Singleton_QML = \
util/qml/Helpers.qml
nodist_libqml_module_util_a_SOURCES = util_qmlassets.cpp
=====================================
modules/gui/qt/meson.build
=====================================
@@ -798,7 +798,8 @@ qml_modules += {
'util/qml/GridSizeHelper.qml',
'util/qml/NativeMenu.qml',
'util/qml/MLContextMenu.qml',
- 'util/qml/FadeControllerStateGroup.qml'
+ 'util/qml/FadeControllerStateGroup.qml',
+ 'util/qml/DelayedBehavior.qml'
),
'singletons': files(
'util/qml/Helpers.qml',
=====================================
modules/gui/qt/network/qml/AddressbarButton.qml
=====================================
@@ -22,6 +22,7 @@ import QtQuick.Templates as T
import VLC.Style
import VLC.Widgets as Widgets
import VLC.Network
+import VLC.Util
T.AbstractButton {
id: button
@@ -93,8 +94,9 @@ T.AbstractButton {
font.pixelSize: button.font.pixelSize
- Behavior on color {
- enabled: theme.initialized
+ DelayedBehavior on color {
+ delayedEnabled: theme.initialized
+
ColorAnimation {
duration: VLCStyle.duration_long
}
=====================================
modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml
=====================================
@@ -228,8 +228,9 @@ T.Control {
Accessible.ignored: true
- Behavior on color {
- enabled: theme.initialized
+ DelayedBehavior on color {
+ delayedEnabled: theme.initialized
+
ColorAnimation {
duration: VLCStyle.duration_veryShort
easing.type: Easing.InOutSine
=====================================
modules/gui/qt/util/qml/DelayedBehavior.qml
=====================================
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (C) 2026 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
+
+// This is useful especially for color animations, as we do not want the
+// animations to run as soon as the theme is initialized, as the colors
+// often adjusted depending on initialization, and to have debouncing.
+Behavior {
+ id: behavior
+
+ // FIXME: Making this property `required` causes weird issues with Qt 6.2
when repeater is involved:
+ property bool delayedEnabled: false // modifying `enabled` is not
permitted, this property should be used instead
+
+ Component.onCompleted: {
+ behavior.enabled = false
+ }
+
+ Binding on enabled {
+ delayed: true
+ value: behavior.delayedEnabled
+ }
+}
=====================================
modules/gui/qt/widgets/qml/AnimatedBackground.qml
=====================================
@@ -21,6 +21,7 @@
import QtQuick
import VLC.Style
+import VLC.Util
Rectangle {
id: root
@@ -45,14 +46,8 @@ Rectangle {
// Animations
//---------------------------------------------------------------------------------------------
- Behavior on border.color {
- Binding on enabled {
- // this is delayed because we don't want the animations to run as
soon
- // as root is enabled, as the colors often adjusted depending on
enabled,
- // and to have debouncing.
- delayed: true
- value: root.enabled
- }
+ DelayedBehavior on border.color {
+ delayedEnabled: root.enabled
ColorAnimation {
id: borderAnimation
@@ -61,14 +56,8 @@ Rectangle {
}
}
- Behavior on color {
- Binding on enabled {
- // this is delayed because we don't want the animations to run as
soon
- // as root is enabled, as the colors often adjusted depending on
enabled,
- // and to have debouncing.
- delayed: true
- value: root.enabled
- }
+ DelayedBehavior on color {
+ delayedEnabled: root.enabled
ColorAnimation {
id: bgAnimation
=====================================
modules/gui/qt/widgets/qml/BannerTabButton.qml
=====================================
@@ -24,6 +24,7 @@ import QtQuick.Layouts
import VLC.MainInterface
import VLC.Widgets as Widgets
import VLC.Style
+import VLC.Util
T.TabButton {
id: control
@@ -157,8 +158,8 @@ T.TabButton {
Layout.maximumWidth: implicitWidth + 1
Layout.leftMargin: iconLabel.visible ? VLCStyle.margin_xsmall : 0
- Behavior on color {
- enabled: theme.initialized
+ DelayedBehavior on color {
+ delayedEnabled: theme.initialized
ColorAnimation {
duration: VLCStyle.duration_short
=====================================
modules/gui/qt/widgets/qml/IconToolButton.qml
=====================================
@@ -23,6 +23,7 @@ import QtQuick.Templates as T
import VLC.MainInterface
import VLC.Widgets as Widgets
import VLC.Style
+import VLC.Util
T.ToolButton {
id: control
@@ -105,8 +106,9 @@ T.ToolButton {
color: control.color
- Behavior on color {
- enabled: theme.initialized
+ DelayedBehavior on color {
+ delayedEnabled: theme.initialized
+
ColorAnimation {
duration: VLCStyle.duration_long
}
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/c1c4701b7600cdb02d0bf2be223979c4859b7d6f...ed053b67e2fdef0e3614a37d3ee87369780ef2d7
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/c1c4701b7600cdb02d0bf2be223979c4859b7d6f...ed053b67e2fdef0e3614a37d3ee87369780ef2d7
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits