From c618a0b5dfead30831d1b28be22c316b79f5253c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 11 Oct 2025 12:52:37 -0500 Subject: [PATCH] Use native QML icon support --- app/gui/AppView.qml | 22 ++++++---------------- app/gui/NavigableToolButton.qml | 14 +++----------- 2 files changed, 9 insertions(+), 27 deletions(-) diff --git a/app/gui/AppView.qml b/app/gui/AppView.qml index 74a6a38c..8afa1f07 100644 --- a/app/gui/AppView.qml +++ b/app/gui/AppView.qml @@ -129,14 +129,9 @@ CenteredGridView { implicitWidth: 85 implicitHeight: 85 - Image { - source: "qrc:/res/play_arrow_FILL1_wght700_GRAD200_opsz48.svg" - anchors.centerIn: parent - sourceSize { - width: 75 - height: 75 - } - } + icon.source: "qrc:/res/play_arrow_FILL1_wght700_GRAD200_opsz48.svg" + icon.width: 75 + icon.height: 75 onClicked: { launchOrResumeSelectedApp(true) @@ -157,14 +152,9 @@ CenteredGridView { implicitWidth: 85 implicitHeight: 85 - Image { - source: "qrc:/res/stop_FILL1_wght700_GRAD200_opsz48.svg" - anchors.centerIn: parent - sourceSize { - width: 75 - height: 75 - } - } + icon.source: "qrc:/res/stop_FILL1_wght700_GRAD200_opsz48.svg" + icon.width: 75 + icon.height: 75 onClicked: { doQuitGame() diff --git a/app/gui/NavigableToolButton.qml b/app/gui/NavigableToolButton.qml index bbf6d248..07f6d41d 100644 --- a/app/gui/NavigableToolButton.qml +++ b/app/gui/NavigableToolButton.qml @@ -7,17 +7,9 @@ ToolButton { activeFocusOnTab: true - // FIXME: We're using an Image here rather than icon.source because - // icons don't work on Qt 5.9 LTS. - Image { - id: image - source: iconSource - anchors.centerIn: parent.background - sourceSize { - width: parent.background.width * 1.10 - height: parent.background.height * 1.10 - } - } + icon.source: iconSource + icon.width: background.width * 1.10 + icon.height: background.height * 1.10 // This determines the size of the Material highlight. We increase it // from the default because we use larger than normal icons for TV readability.