From c3476c9f9e0539cf08206d5efa6cd62ec663d529 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Sun, 9 Nov 2025 13:40:06 -0500 Subject: [PATCH] MediaCard: fix vertical centering of disc icon when nothing is playing --- .../Panels/ControlCenter/Cards/MediaCard.qml | 63 +++++-------------- 1 file changed, 15 insertions(+), 48 deletions(-) diff --git a/Modules/Panels/ControlCenter/Cards/MediaCard.qml b/Modules/Panels/ControlCenter/Cards/MediaCard.qml index 2914ee09..7b922fbb 100644 --- a/Modules/Panels/ControlCenter/Cards/MediaCard.qml +++ b/Modules/Panels/ControlCenter/Cards/MediaCard.qml @@ -183,61 +183,28 @@ NBox { } } - ColumnLayout { + // Content container that adjusts for player selector + Item { anchors.fill: parent - anchors.margins: Style.marginM + anchors.topMargin: playerSelectorButton.visible ? (playerSelectorButton.height + Style.marginXS + Style.marginM) : Style.marginM + anchors.leftMargin: Style.marginM + anchors.rightMargin: Style.marginM + anchors.bottomMargin: Style.marginM - // No media player detected - use Loader for performance - Loader { - id: fallbackLoader - Layout.fillWidth: true - Layout.fillHeight: true - active: !root.hasActivePlayer - - sourceComponent: ColumnLayout { - spacing: Style.marginS - - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } - - Item { - Layout.fillWidth: true - - ColumnLayout { - anchors.centerIn: parent - spacing: Style.marginL - - Item { - Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: Style.fontSizeXXXL * 4 - Layout.preferredHeight: Style.fontSizeXXXL * 4 - - // Center icon (static, no animation to avoid GPU cost) - NIcon { - anchors.centerIn: parent - icon: "disc" - pointSize: Style.fontSizeXXXL * 3 - color: Color.mOnSurfaceVariant - opacity: 1.0 - } - } - } - } - - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } - } + // No media player detected - centered disc icon + NIcon { + anchors.centerIn: parent + visible: !root.hasActivePlayer + icon: "disc" + pointSize: Style.fontSizeXXXL * 3 + color: Color.mOnSurfaceVariant + opacity: 1.0 } // MediaPlayer Main Content - use Loader for performance Loader { id: mainLoader - Layout.fillWidth: true - Layout.fillHeight: true + anchors.fill: parent active: root.hasActivePlayer sourceComponent: ColumnLayout {