From fcc395053a3830e1537b9b6d849adc165fabb3d5 Mon Sep 17 00:00:00 2001 From: jokul Date: Mon, 13 Jul 2026 21:43:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96UI=E7=BB=86=E8=8A=82?= =?UTF-8?q?=20-=20=E6=A0=87=E9=A2=98=E5=B1=85=E4=B8=AD=E3=80=81=E5=8E=82?= =?UTF-8?q?=E5=95=86=E5=9B=BE=E6=A0=87=E3=80=81=E9=80=8F=E6=98=8E=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E3=80=81tooltip=E5=88=86=E8=A1=8C=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 弹窗标题居中显示 - GPU卡片图标根据厂商显示简称(NV/AMD/Intel等) - 任务栏图标改为透明背景+边框样式 - 加深蓝色调提高文字对比度 - 刷新按钮改为蓝底白字 - tooltip多显卡分行显示 --- package/driverview.qml | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/package/driverview.qml b/package/driverview.qml index 20a5663..798df83 100644 --- a/package/driverview.qml +++ b/package/driverview.qml @@ -30,28 +30,32 @@ AppletItem { readonly property color tertiaryText: Qt.rgba(basePalette.r, basePalette.g, basePalette.b, 0.5) readonly property color cardBackground: Qt.rgba(basePalette.r, basePalette.g, basePalette.b, 0.06) readonly property color cardBorder: Qt.rgba(basePalette.r, basePalette.g, basePalette.b, 0.1) - readonly property color accentBlue: Qt.rgba(36 / 255, 118 / 255, 220 / 255, 1) - readonly property color accentBlueLight: Qt.rgba(36 / 255, 118 / 255, 220 / 255, 0.15) + readonly property color accentBlue: Qt.rgba(20 / 255, 80 / 255, 160 / 255, 1) + readonly property color accentBlueLight: Qt.rgba(20 / 255, 80 / 255, 160 / 255, 0.12) // 图标区域 Rectangle { - anchors.fill: parent - color: accentBlue - radius: 8 + anchors.centerIn: parent + width: dockSize * 0.7 + height: dockSize * 0.7 + color: "transparent" + radius: width * 0.45 + border.width: 1 + border.color: root.secondaryText Text { anchors.centerIn: parent text: "GPU" - font.pixelSize: root.dockSize * 0.3 + font.pixelSize: root.dockSize * 0.22 font.bold: true - color: "white" + color: root.primaryText } } // 悬停提示 PanelToolTip { id: toolTip - text: root.ready ? root.gpuSummary : qsTr("No GPU detected") + text: root.ready ? root.deviceInfo.replace(/\n/g, "\n") : qsTr("No GPU detected") toolTipX: DockPanelPositioner.x toolTipY: DockPanelPositioner.y } @@ -106,6 +110,8 @@ AppletItem { Layout.fillWidth: true spacing: 10 + Item { Layout.fillWidth: true } + Rectangle { width: 28 height: 28 @@ -126,8 +132,9 @@ AppletItem { font.pixelSize: 16 font.bold: true color: root.primaryText - Layout.fillWidth: true } + + Item { Layout.fillWidth: true } } // 分隔线 @@ -200,7 +207,7 @@ AppletItem { Text { anchors.centerIn: parent - text: "GPU" + text: parseGpuVendorShort(modelData) font.pixelSize: 14 font.bold: true color: root.accentBlue @@ -272,13 +279,13 @@ AppletItem { font.pixelSize: 13 background: Rectangle { - color: refreshBtn.hovered ? root.accentBlue : root.accentBlueLight + color: refreshBtn.hovered ? Qt.darker(root.accentBlue, 1.2) : root.accentBlue radius: 8 } contentItem: Text { text: refreshBtn.text - color: refreshBtn.hovered ? "white" : root.accentBlue + color: "white" font.pixelSize: refreshBtn.font.pixelSize horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter @@ -320,6 +327,17 @@ AppletItem { return info } + // 识别 GPU 厂商简称 + function parseGpuVendorShort(info) { + var name = info.toLowerCase() + if (name.indexOf("nvidia") !== -1) return "NV" + if (name.indexOf("amd") !== -1 || name.indexOf("ati") !== -1 || name.indexOf("advanced micro") !== -1) return "AMD" + if (name.indexOf("intel") !== -1) return "Intel" + if (name.indexOf("qualcomm") !== -1) return "QC" + if (name.indexOf("microsoft") !== -1) return "MS" + return "GPU" + } + // 点击处理 TapHandler { acceptedButtons: Qt.LeftButton