From c2b7b458f913523e2c477de46dbcf80d7c0f63ef Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 11 Dec 2019 13:03:33 -0400 Subject: [PATCH] Use the "Binding on ..." syntax whenever possible --- TODO.md | 7 +------ src/qml/Base/HCircleProgressBar.qml | 8 ++------ src/qml/Base/MediaPlayer/OSD.qml | 4 +--- src/qml/Chat/Timeline/EventImageTextBubble.qml | 4 +--- src/qml/MainPane/MainPane.qml | 4 +--- 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/TODO.md b/TODO.md index 981fdd7d..9a059527 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,4 @@ -- binding on ... +- invite keybind & context menu - better cancel for all boxes - Media @@ -72,11 +72,6 @@ - In join room page, show the matching room's avatar when typing - In find someone page, show the matching user's avatar when typing - - Inviting members to a room - - Make invite icon blink if there's no one but ourself in the room, - but never do it again once the user hovered it long enough to show - tooltip or clicked on it once - - Combine events so they take less space - After combining is implemented, no need to hide profile changes anymore. - Replies diff --git a/src/qml/Base/HCircleProgressBar.qml b/src/qml/Base/HCircleProgressBar.qml index 67447d1b..cb5cb762 100644 --- a/src/qml/Base/HCircleProgressBar.qml +++ b/src/qml/Base/HCircleProgressBar.qml @@ -28,16 +28,12 @@ RadialBar { theme.controls.circleProgressBar.indeterminateSpan - Binding { - target: bar; - property: "value"; + Binding on value { value: bar.to * bar.indeterminateSpan when: bar.indeterminate } - Binding { - target: bar - property: "showText" + Binding on showText { value: false when: bar.indeterminate } diff --git a/src/qml/Base/MediaPlayer/OSD.qml b/src/qml/Base/MediaPlayer/OSD.qml index 81b79ffd..157432ce 100644 --- a/src/qml/Base/MediaPlayer/OSD.qml +++ b/src/qml/Base/MediaPlayer/OSD.qml @@ -130,9 +130,7 @@ HColumnLayout { } } - Binding { - target: timeSlider - property: "value" + Binding on value { value: boundPosition when: ! timeSlider.pressed } diff --git a/src/qml/Chat/Timeline/EventImageTextBubble.qml b/src/qml/Chat/Timeline/EventImageTextBubble.qml index a8887cd0..97ef8754 100644 --- a/src/qml/Chat/Timeline/EventImageTextBubble.qml +++ b/src/qml/Chat/Timeline/EventImageTextBubble.qml @@ -17,9 +17,7 @@ HLabel { radius: theme.radius } - Binding { - target: bubble - property: "visible" + Binding on visible { value: false when: ! Boolean(bubble.text) } diff --git a/src/qml/MainPane/MainPane.qml b/src/qml/MainPane/MainPane.qml index 502bb98b..0e627e40 100644 --- a/src/qml/MainPane/MainPane.qml +++ b/src/qml/MainPane/MainPane.qml @@ -28,9 +28,7 @@ HDrawer { Behavior on opacity { HOpacityAnimator {} } - Binding { - target: mainPane - property: "visible" + Binding on visible { value: false when: ! mainUI.accountsPresent }