From 47a7adf8236d48ae941e5a892d34f6b9488ddc08 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 14 Mar 2021 16:24:04 +0100 Subject: [PATCH] Use readonly properties where possible --- resources/qml/MessageView.qml | 2 +- resources/qml/TimelineView.qml | 2 +- resources/qml/ui/Ripple.qml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml index 1bc10b60..cad09475 100644 --- a/resources/qml/MessageView.qml +++ b/resources/qml/MessageView.qml @@ -43,7 +43,7 @@ ScrollView { property alias model: row.model // use comma to update on scroll property var attachedPos: chat.contentY, attached ? chat.mapFromItem(attached, attached ? attached.width - width : 0, -height) : null - property int padding: 4 + readonly property int padding: 4 visible: Settings.buttonsInTimeline && !!attached && (attached.hovered || messageActionHover.hovered) x: attached ? attachedPos.x : 0 diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 8b98e113..02f6d5f4 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -20,7 +20,7 @@ Page { property var colors: currentActivePalette property var systemInactive property var inactiveColors: currentInactivePalette ? currentInactivePalette : systemInactive - property int avatarSize: 40 + readonly property int avatarSize: 40 property real highlightHue: colors.highlight.hslHue property real highlightSat: colors.highlight.hslSaturation property real highlightLight: colors.highlight.hslLightness diff --git a/resources/qml/ui/Ripple.qml b/resources/qml/ui/Ripple.qml index b240f421..426182ee 100644 --- a/resources/qml/ui/Ripple.qml +++ b/resources/qml/ui/Ripple.qml @@ -13,9 +13,9 @@ Item { property real radius: 0 property color color: "#22000000" property real maxRadius: Math.max(width, height) - property real radiusAnimationRate: 0.05 - property real radiusTailAnimationRate: 0.5 - property real opacityAnimationDuration: 300 + readonly property real radiusAnimationRate: 0.05 + readonly property real radiusTailAnimationRate: 0.5 + readonly property real opacityAnimationDuration: 300 readonly property real diameter: radius * 2 property real centerX property real centerY