From 3ddad976910235cf39c76af4d71b727db01c011e Mon Sep 17 00:00:00 2001 From: talksik Date: Fri, 6 Jun 2025 09:13:21 -0700 Subject: [PATCH] fix: binding loop for AppIcon component --- AppIcon.qml | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/AppIcon.qml b/AppIcon.qml index 34959b3..5366985 100644 --- a/AppIcon.qml +++ b/AppIcon.qml @@ -1,29 +1,28 @@ import QtQuick import QtQuick.Controls.Basic -Item { - id: item +Button { + id: button required property string source property color color: Theme.foreground property int iconHeight: 15 property int iconWidth: 15 - property var onClicked - height: item.iconHeight - width: item.iconWidth + implicitWidth: iconWidth + leftPadding + rightPadding + implicitHeight: iconHeight + topPadding + bottomPadding + padding: 0 + horizontalPadding: 0 - Button { - anchors.centerIn: parent - background: Rectangle { - color: "transparent" - } - // FIX: onClicked doesn't work - onClicked: if (item.onClicked) - item.onClicked() - icon.source: item.source - icon.width: item.iconWidth - icon.height: item.iconHeight - icon.color: item.color - enabled: item.onClicked ? true : false + text: "" + + background: Rectangle { + color: "transparent" } + + icon.source: source + icon.width: iconWidth + icon.height: iconHeight + icon.color: color + + enabled: false }