From 2c37d85bad7cac1834686426b845d9aaa38ffa79 Mon Sep 17 00:00:00 2001 From: zeqi Date: Sun, 12 Apr 2026 12:32:29 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=83=8C=E6=99=AF=E5=A3=81=E7=BA=B8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zeqi --- debian/changelog | 8 +- gxde-hardware-viewer.py | 155 ++- translations/gxde-hardware-viewer_zh_CN.ts | 1471 ++++++++++---------- 3 files changed, 899 insertions(+), 735 deletions(-) diff --git a/debian/changelog b/debian/changelog index da9521e..884ad65 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -gxde-hardware-viewer (2.6.0) UNRELEASED; urgency=medium +gxde-hardware-viewer (2.6.1) UNRELEASED; urgency=medium [ zeqi ] * 显示页新增显存大小和剩余显存 @@ -7,14 +7,12 @@ gxde-hardware-viewer (2.6.0) UNRELEASED; urgency=medium * 修改系统信息页面显示硬盘容量功能,修改为显示硬盘+容量 * 优化界面UI * 修改程序使用的Qt主题 - * 优化获取显卡驱动功能 - * 修复无法获取网卡型号的问题 - * 优化驱动更新功能,避免混入一下无关的包,如“linuxqq” + * 新增自定义背景功能 [ gfdgd_xi ] * 新增多显示器信息显示 - -- gfdgd_xi <3025613752@qq.com> Sat, 04 Apr 2026 20:56:06 +0800 + -- zeqi Sun, 12 Apr 2026 20:16:55 +0800 gxde-hardware-viewer (2.5.6-1) UNRELEASED; urgency=medium diff --git a/gxde-hardware-viewer.py b/gxde-hardware-viewer.py index e60ed7f..8223163 100644 --- a/gxde-hardware-viewer.py +++ b/gxde-hardware-viewer.py @@ -13,13 +13,13 @@ import time from datetime import datetime from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QListWidget, QListWidgetItem, QStackedWidget, - QLabel, QGroupBox, QFormLayout, QTextEdit, + QLabel, QGroupBox, QFormLayout, QTextEdit, QFileDialog, QTableWidget, QTableWidgetItem, QProgressBar, QFrame, QPushButton, QMenu, QMessageBox, QAbstractItemView, QDialog, QDialogButtonBox) -from PyQt6.QtCore import Qt, QTimer, QTranslator, QCoreApplication, QLocale, QThread, pyqtSignal, QProcess -from PyQt6.QtGui import QColor, QIcon, QFont, QPalette, QPixmap +from PyQt6.QtCore import Qt, QTimer, QTranslator, QCoreApplication, QLocale, QThread, pyqtSignal, QProcess, QSettings +from PyQt6.QtGui import QColor, QIcon, QFont, QPainter, QPalette, QPixmap -version = "2.6.0" +version = "2.6.1" uname = platform.uname() @@ -185,6 +185,84 @@ class CacheManager: else: self.cache.clear() +def get_gxde_theme(): + """获取系统主题""" + try: + result = subprocess.run( + ['gsettings', 'get', 'com.deepin.dde.appearance', 'gtk-theme'], + capture_output=True, text=True, timeout=2 + ) + if result.returncode == 0: + theme = result.stdout.strip().strip("'").strip('"') + if 'dark' in theme.lower(): + return 'dark' + else: + return 'light' + except Exception as e: + print(f"Failed to get GXDE theme: {e}") + return 'light' + +class CentralWidget(QWidget): + """支持背景图片和半透明遮罩的中央部件""" + def __init__(self, parent=None): + super().__init__(parent) + self.bg_image_path = "" + self.overlay_enabled = False + + self.setObjectName("centralWidget") + self.cached_scaled_pixmap = None + self.cached_size = None + + self.current_theme = get_gxde_theme() + self.update_overlay_color() + + def set_background_image(self, path): + """设置背景图片路径,传入空字符串表示清除背景""" + self.bg_image_path = path + self.overlay_enabled = bool(path and os.path.exists(path)) + self.cached_scaled_pixmap = None + self.cached_size = None + self.update() + + def update_overlay_color(self): + """根据当前主题设置遮罩颜色""" + if self.current_theme == 'dark': + self.overlay_color = QColor(0, 0, 0, 80) + else: + self.overlay_color = QColor(255, 255, 255, 80) + + def paintEvent(self, event): + super().paintEvent(event) + painter = QPainter(self) + + if self.bg_image_path and os.path.exists(self.bg_image_path): + # 获取当前控件的逻辑尺寸 + target_size = self.size() + + # 检查是否需要重新缩放 + if self.cached_scaled_pixmap is None or self.cached_size != target_size: + pixmap = QPixmap(self.bg_image_path) + if not pixmap.isNull(): + # 获取设备像素比 + dpr = self.devicePixelRatioF() + # 按物理像素尺寸缩放,避免模糊 + physical_size = target_size * dpr + scaled = pixmap.scaled( + physical_size, + Qt.AspectRatioMode.IgnoreAspectRatio, + Qt.TransformationMode.SmoothTransformation + ) + scaled.setDevicePixelRatio(dpr) + self.cached_scaled_pixmap = scaled + self.cached_size = target_size + + if self.cached_scaled_pixmap is not None: + painter.drawPixmap(0, 0, self.cached_scaled_pixmap) + + # 绘制半透明遮罩层 + if self.overlay_enabled: + painter.fillRect(self.rect(), self.overlay_color) + class HardwareManager(QMainWindow): def __init__(self): super().__init__() @@ -247,6 +325,11 @@ class HardwareManager(QMainWindow): self.monitor_timer.timeout.connect(self.update_hardware_info) self.monitor_timer.start() + settings = QSettings("GXDE", "HardwareViewer") + saved_path = settings.value("background/image_path", "") + if saved_path: + self.apply_background_image(saved_path) + def init_scaling_factor(self): """初始化缩放因子,用于适配不同分辨率""" self.scaling_factor = 1.0 @@ -270,7 +353,7 @@ class HardwareManager(QMainWindow): self.resize(self.scaled(900), self.scaled(600)) # 创建中心部件 - central_widget = QWidget() + central_widget = CentralWidget() self.setCentralWidget(central_widget) # 主布局 @@ -355,6 +438,10 @@ class HardwareManager(QMainWindow): self.menu = QMenu() export_action = self.menu.addAction(self.tr("Export all information to desktop")) export_action.triggered.connect(self.export_all_info) + background_action = self.menu.addAction(self.tr("Set Background Image")) + background_action.triggered.connect(self.choose_background_image) + remove_background_action = self.menu.addAction(self.tr("Remove Background")) + remove_background_action.triggered.connect(self.remove_background_image) about_action = self.menu.addAction(self.tr("About")) about_action.triggered.connect(self.show_about) self.gxde_title_bar.menu_button.setMenu(self.menu) @@ -609,6 +696,64 @@ class HardwareManager(QMainWindow): except Exception as e: QMessageBox.critical(self, self.tr("Export Failed"), self.tr("An error occurred while exporting hardware information:\n{}").format(str(e))) + + def choose_background_image(self): + """弹出文管对话框选择背景图片""" + + settings = QSettings("GXDE", "HardwareViewer") + last_dir = settings.value("background/last_dir", os.path.expanduser("~")) + + file_path, _ = QFileDialog.getOpenFileName( + self, + self.tr("Select Background Image"), + last_dir, + self.tr("Image Files (*.png *.jpg *.jpeg *.bmp *.gif);;All Files (*)") + ) + + if file_path: + # 保存目录 + settings.setValue("background/last_dir", os.path.dirname(file_path)) + # 保存图片路径 + settings.setValue("background/image_path", file_path) + # 应用背景 + self.apply_background_image(file_path) + + def apply_background_image(self, path): + """设置背景图片并保存设置""" + if not path or not os.path.exists(path): + return + self.centralWidget().set_background_image(path) + + self.sidebar.setStyleSheet(f""" + QListWidget {{ + padding-top: {self.scaled(10)}px; + border-right: none; + border-top: none; + }} + QListWidgetItem {{ + height: {self.scaled(36)}px; + padding-left: {self.scaled(15)}px; + font-size: {self.scaled(14)}px; + }} + QListWidget::item:selected {{ + color: #E6004C; + selection-background-color: #F380A6; + border-left: 3px solid #E6004C; + }} + QListWidget::item:hover:!selected {{ + color: grey; + border-left: 3px solid grey; + }} + """) + + self.sidebar.viewport().setStyleSheet("background-color: transparent;") + + def remove_background_image(self): + """移除背景图片""" + self.centralWidget().set_background_image("") + # 清除保存的设置 + settings = QSettings("GXDE", "HardwareViewer") + settings.remove("background/image_path") def show_about(self): dialog = AboutDialog(self) diff --git a/translations/gxde-hardware-viewer_zh_CN.ts b/translations/gxde-hardware-viewer_zh_CN.ts index 9187482..2a57600 100644 --- a/translations/gxde-hardware-viewer_zh_CN.ts +++ b/translations/gxde-hardware-viewer_zh_CN.ts @@ -1,1192 +1,1213 @@ - + AboutDialog - - About GXDE Hardware Viewer - 关于 GXDE 硬件查看器 + + About GXDE Hardware Viewer + 关于 GXDE 硬件查看器 - - GXDE Hardware Viewer - GXDE 硬件查看器 + + GXDE Hardware Viewer + GXDE 硬件查看器 - - Version: - 版本: + + Version: + 版本: - - - Acknowledgments - 鸣谢 + + + Acknowledgments + 鸣谢 - - Thanks to all the open source software we've used and to you who are using it now - 感谢所有使用过的开源软件和正在使用的你 + + Thanks to all the open source software we've used and to you who are using it now + 感谢所有使用过的开源软件和正在使用的你 - - + + GXDE Hardware Manager is a lightweight hardware information viewer specifically designed for the GXDE desktop environment - + GXDE 硬件管理器是一款专为 GXDE 桌面环境打造的轻量型硬件信息查看工具 - - + + HardwareManager - - GXDE Hardware Manager - GXDE 硬件管理器 + + GXDE Hardware Manager + GXDE 硬件管理器 - - - - System - 系统信息 + + + + System + 系统信息 - - - CPU - 处理器 + + + CPU + 处理器 - - - Memory - 内存 + + + Memory + 内存 - - - Storage - 存储 + + + Storage + 存储 - - - Network - 网络 + + + Network + 网络 - - - Display - 显示 + + + Display + 显示 - - - Sound - 声音 + + + Sound + 声音 - - - Input Devices - 输入设备 + + + Input Devices + 输入设备 - - Driver Update - 驱动升级 + + Driver Update + 驱动升级 - - - Export all information to desktop - 导出所有信息到桌面 + + + Export all information to desktop + 导出所有信息到桌面 - - - About - 关于 + + Set Background Image + 设置背景壁纸 - - Copy - 复制 + + Remove Background + 移除背景壁纸 - - System Information - 系统信息 + + + About + 关于 - - Host Name - 主机名 + + Copy + 复制 - - Kernel - 内核版本 + + System Information + 系统信息 - - - Architecture - 架构 + + Host Name + 主机名 - - Boot Time - 启动时间 + + Kernel + 内核版本 - - CPU Info - CPU信息 + + + Architecture + 架构 - - Processor Model - 处理器型号 + + Boot Time + 启动时间 - - Physical Cores - 物理核心 + + CPU Info + CPU信息 - - Logical Cores - 逻辑核心 + + Processor Model + 处理器型号 - - Current Frequency - 当前频率 + + Physical Cores + 物理核心 - - Maximum Frequency - 最大频率 + + Logical Cores + 逻辑核心 - - Minimum Frequency - 最小频率 + + Current Frequency + 当前频率 - - - - Memory Information - 内存信息 + + Maximum Frequency + 最大频率 - - Total Memory - 总内存 + + Minimum Frequency + 最小频率 - - Used - 已使用 + + + + Memory Information + 内存信息 - - Free - 空闲 + + Total Memory + 总内存 - - Available - 可用 + + Used + 已使用 - - Cache - 缓存 + + Free + 空闲 - - Memory Usage - 内存使用率 + + Available + 可用 - - Total Swap - 交换分区总容量 + + Cache + 缓存 - - Used Swap - 交换分区已使用 + + Memory Usage + 内存使用率 - - Free Swap - 交换分区空闲 + + Total Swap + 交换分区总容量 - - Swap Usage - 交换分区使用率 + + Used Swap + 交换分区已使用 - - - Device - 设备 + + Free Swap + 交换分区空闲 - - - Mount Point - 挂载点 + + Swap Usage + 交换分区使用率 - - - File System - 文件系统 + + + Device + 设备 - - - Total Capacity - 总容量 + + + Mount Point + 挂载点 - - - Available Space - 可用空间 + + + File System + 文件系统 - - Disk Information - 磁盘信息 + + + Total Capacity + 总容量 - - - - - Empty - + + + Available Space + 可用空间 - - - - - - - - - - - - - - - - - - - Unknown - 未知 + + Disk Information + 磁盘信息 - - - Connected - 已连接 + + + + + Empty + - - - Disconnected - 未连接 + + + + + + + + + + + + + + + + + + + Unknown + 未知 - - - - Interface Name - 接口名称 + + + Connected + 已连接 - - - IP Address - IP地址 + + + Disconnected + 未连接 - - - MAC Address - MAC地址 + + + + Interface Name + 接口名称 - - - - Status - 状态 + + + IP Address + IP地址 - - Network Information - 网络信息 + + + MAC Address + MAC地址 - - Display Information - 显示信息 + + + + Status + 状态 - - Graphics Card - 显卡 + + Network Information + 网络信息 - - - Resolution - 分辨率 + + Display Information + 显示信息 - - - Color Depth - 色深 + + Graphics Card + 显卡 - - - Refresh Rate - 刷新率 + + + Resolution + 分辨率 - - Hardware Information - 硬件信息 + + + Color Depth + 色深 - - Export Successful - 导出成功 + + + Refresh Rate + 刷新率 - - Hardware information has been successfully exported to: + + Hardware Information + 硬件信息 + + + + Export Successful + 导出成功 + + + + Hardware information has been successfully exported to: {} - 硬件信息已成功导出到: + 硬件信息已成功导出到: {} - - Export Failed - 导出失败 + + Export Failed + 导出失败 - - An error occurred while exporting hardware information: + + An error occurred while exporting hardware information: {} - 导出硬件信息时发生错误: + 导出硬件信息时发生错误: {} - - Unable to get system version - 无法获取系统版本 + + Select Background Image + 选择背景壁纸 + + + + Image Files (*.png *.jpg *.jpeg *.bmp *.gif);;All Files (*) + 图片文件 (*.png *.jpg *.jpeg *.bmp *.gif);;所有文件 (*) + + + + Unable to get system version + 无法获取系统版本 - - - Failed to retrieve: {} - 获取失败: {} + + + Failed to retrieve: {} + 获取失败: {} - - Unknown system version - 未知系统版本 + + Unknown system version + 未知系统版本 - - Operating System: - 操作系统: + + Operating System: + 操作系统: - - Hostname: - 主机名: + + Hostname: + 主机名: - - Kernel Version: - 内核版本: + + Kernel Version: + 内核版本: - - System Architecture: - 系统架构: + + System Architecture: + 系统架构: - - Boot Time: - 启动时间: + + Boot Time: + 启动时间: - - System Overview - 系统概览 + + System Overview + 系统概览 - - Processor: - 处理器: + + Processor: + 处理器: - - {} ({} cores {} threads) - {} ({} 核 {} 线程) + + {} ({} cores {} threads) + {} ({} 核 {} 线程) - - - Total Memory: - 内存总容量: + + + Total Memory: + 内存总容量: - - Disks: - 硬盘: + + Disks: + 硬盘: - - Hardware Overview - 硬件概览 + + Hardware Overview + 硬件概览 - - Loaded Kernel Modules - 已加载驱动模块 + + Loaded Kernel Modules + 已加载驱动模块 - - Processor Model: - 处理器型号: + + Processor Model: + 处理器型号: - - Architecture: - 架构: + + Architecture: + 架构: - - Physical Cores: - 物理核心: + + Physical Cores: + 物理核心: - - Logical Cores: - 逻辑核心: + + Logical Cores: + 逻辑核心: - - Current Frequency: - 当前频率: + + Current Frequency: + 当前频率: - - Maximum Frequency: - 最大频率: + + Maximum Frequency: + 最大频率: - - Minimum Frequency: - 最小频率: + + Minimum Frequency: + 最小频率: - - Basic Information - 基本信息 + + Basic Information + 基本信息 - - CPU Driver Information - CPU驱动信息 + + CPU Driver Information + CPU驱动信息 - - - Used: - 已使用: + + + Used: + 已使用: - - - Free: - 空闲: + + + Free: + 空闲: - - Available: - 可用: + + Available: + 可用: - - Cache: - 缓存: + + Cache: + 缓存: - - Memory Hardware & Drivers - 内存硬件与驱动 + + Memory Hardware & Drivers + 内存硬件与驱动 - - Total Swap: - 总交换分区: + + Total Swap: + 总交换分区: - - Swap Information - 交换分区信息 + + Swap Information + 交换分区信息 - - - No Permission - 无权限 + + + No Permission + 无权限 - - Disk Partitions - 磁盘分区 + + Disk Partitions + 磁盘分区 - - Device Name - 设备信息 + + Device Name + 设备信息 - - Model - 型号 + + Model + 型号 - - - Driver Module - 驱动模块 + + + Driver Module + 驱动模块 - - Storage Devices & Drivers - 存储设备与驱动 + + Storage Devices & Drivers + 存储设备与驱动 - - Read Count: - 读取次数: + + Read Count: + 读取次数: - - Write Count: - 写入次数: + + Write Count: + 写入次数: - - Read Bytes: - 读取字节: + + Read Bytes: + 读取字节: - - Write Bytes: - 写入字节: + + Write Bytes: + 写入字节: - - Disk I/O Statistics - 磁盘IO统计 + + Disk I/O Statistics + 磁盘IO统计 - - Network Interfaces - 网络接口 + + Network Interfaces + 网络接口 - - Device Model - 设备型号 + + Device Model + 设备型号 - - Network Devices & Drivers - 网络设备与驱动 + + Network Devices & Drivers + 网络设备与驱动 - - Bytes Received: - 接收字节: + + Bytes Received: + 接收字节: - - Bytes Sent: - 发送字节: + + Bytes Sent: + 发送字节: - - Packets Received: - 接收包数: + + Packets Received: + 接收包数: - - Packets Sent: - 发送包数: + + Packets Sent: + 发送包数: - - Receive Errors: - 接收错误: + + Receive Errors: + 接收错误: - - Transmit Errors: - 发送错误: + + Transmit Errors: + 发送错误: - - Network Traffic Statistics - 网络流量统计 + + Network Traffic Statistics + 网络流量统计 - - Graphics Card: - 显卡: + + Graphics Card: + 显卡: - - Total VRAM: - 显存总量: + + Total VRAM: + 显存总量: - - Available VRAM: - 可用显存: + + Available VRAM: + 可用显存: - - Graphics Information - 图形信息 + + Graphics Information + 图形信息 - - Screen Name - 屏幕名称 + + Screen Name + 屏幕名称 - - Connected Displays - 已连接显示器 + + Connected Displays + 已连接显示器 - - Display Driver Information - 显示设备驱动信息 + + Display Driver Information + 显示设备驱动信息 - - Audio Output Devices: - 音频输出设备: + + Audio Output Devices: + 音频输出设备: - - - - - - - {} (Driver: {}) - - {} (驱动: {}) + + + + + + - {} (Driver: {}) + - {} (驱动: {}) - - Audio Input Devices: - 音频输入设备: + + Audio Input Devices: + 音频输入设备: - - Audio Devices & Drivers - 声音设备与驱动 + + Audio Devices & Drivers + 声音设备与驱动 - - Audio Driver Details - 音频驱动详情 + + Audio Driver Details + 音频驱动详情 - - Keyboard: - 键盘: + + Keyboard: + 键盘: - - Mouse: - 鼠标: + + Mouse: + 鼠标: - - Other Input Devices: - 其它输入设备: + + Other Input Devices: + 其它输入设备: - - Input Devices & Drivers - 输入设备与驱动 + + Input Devices & Drivers + 输入设备与驱动 - - ⚠️ Warning: This feature will update drivers and the kernel. Please make sure you know what you are doing! -In theory, we probably shouldn't encounter any strange problems (and even if we do, it shouldn't be a disaster). + + ⚠️ Warning: This feature will update drivers and the kernel. Please make sure you know what you are doing! +In theory, we probably shouldn't encounter any strange problems (and even if we do, it shouldn't be a disaster). It is recommended to back up the system and data first. - ⚠️ 警告:此功能将更新驱动程序和内核。请确保您知道自己在做什么! + ⚠️ 警告:此功能将更新驱动程序和内核。请确保您知道自己在做什么! 按道理应该不会遇到奇奇怪怪的问题(就算遇到了也应该不会翻车)。 建议先备份系统和数据。 - - Please select the driver you want to update: - 请选择您要更新的驱动程序: + + Please select the driver you want to update: + 请选择您要更新的驱动程序: - - Please click the 'Check for Updates' button to get available driver updates. - 请点击“检查更新”按钮以获取可用的驱动程序更新。 + + Please click the 'Check for Updates' button to get available driver updates. + 请点击“检查更新”按钮以获取可用的驱动程序更新。 - - - Update - 更新 + + + Update + 更新 - - - - Check for updates - 检查更新 + + + + Check for updates + 检查更新 - - Checking... - 检查中... + + Checking... + 检查中... - - - Error - 错误 + + + Error + 错误 - - All drivers and the kernel are up to date~ - 所有驱动程序和内核都是最新的~ + + All drivers and the kernel are up to date~ + 所有驱动程序和内核都是最新的~ - - Information - 提示 + + Information + 提示 - - Please select the driver or kernel to update first - 请先选择要更新的驱动程序或内核 + + Please select the driver or kernel to update first + 请先选择要更新的驱动程序或内核 - - Updating... - 正在更新... + + Updating... + 正在更新... - - Primary Screen - 主屏幕 + + Primary Screen + 主屏幕 - - Screen - 屏幕 + + Screen + 屏幕 - - Unable to get screen information - 无法获取屏幕信息 + + Unable to get screen information + 无法获取屏幕信息 - - Unknown CPU Model - 未知CPU型号 + + Unknown CPU Model + 未知CPU型号 - - Command does not exist, please check if the path is correct - 命令不存在,请检查路径是否正确 + + Command does not exist, please check if the path is correct + 命令不存在,请检查路径是否正确 - - Error getting CPU model: {} - 获取CPU型号出错: {} + + Error getting CPU model: {} + 获取CPU型号出错: {} - - No physical disks found (lsblk may not be available) - 未找到物理磁盘(lsblk 可能不可用) + + No physical disks found (lsblk may not be available) + 未找到物理磁盘(lsblk 可能不可用) - - Unknown graphics card (no VGA device detected) - 未知显卡(未检测到VGA设备) + + Unknown graphics card (no VGA device detected) + 未知显卡(未检测到VGA设备) - - Unknown graphics card (please ensure lspci command is available) - 未知显卡(请确保lspci命令可用) + + Unknown graphics card (please ensure lspci command is available) + 未知显卡(请确保lspci命令可用) - - Failed to get resolution: {} - 获取分辨率失败: {} + + Failed to get resolution: {} + 获取分辨率失败: {} - - Unknown resolution - 未知分辨率 + + Unknown resolution + 未知分辨率 - - {} bits - {} 位 + + {} bits + {} 位 - - - 32 bits - 32位 + + + 32 bits + 32位 - - {} days {} hours {} minutes - {}天 {}时 {}分 + + {} days {} hours {} minutes + {}天 {}时 {}分 - - (only showing the first 10) - (仅显示前10个) + + (only showing the first 10) + (仅显示前10个) - - Unable to get kernel module information - 无法获取内核模块信息 + + Unable to get kernel module information + 无法获取内核模块信息 - - Vendor - 厂商 + + Vendor + 厂商 - - - Microcode Version - 微码版本 + + + Microcode Version + 微码版本 - - - Scheduler - 调度器 + + + Scheduler + 调度器 - - - Related Driver Modules - 相关驱动模块 + + + Related Driver Modules + 相关驱动模块 - - - Driver Information - 驱动信息 + + + Driver Information + 驱动信息 - - - - Unable to retrieve - 无法获取 + + + + Unable to retrieve + 无法获取 - - - Memory Controller - 内存控制器 + + + Memory Controller + 内存控制器 - - - Memory Type - 内存类型 + + + Memory Type + 内存类型 - - - Memory Speed - 内存速度 + + + Memory Speed + 内存速度 - - - Requires root privileges to view - 需要root权限查看 + + + Requires root privileges to view + 需要root权限查看 - - Failed to get memory hardware information: {} - 获取内存硬件信息失败: {} + + Failed to get memory hardware information: {} + 获取内存硬件信息失败: {} - - Failed to get storage device information: {} - 获取存储设备信息失败: {} + + Failed to get storage device information: {} + 获取存储设备信息失败: {} - - Failed to get network device information: {} - 获取网络设备信息失败: {} + + Failed to get network device information: {} + 获取网络设备信息失败: {} - - OpenGL Vendor - OpenGL供应商 + + OpenGL Vendor + OpenGL供应商 - - OpenGL Renderer - OpenGL渲染器 + + OpenGL Renderer + OpenGL渲染器 - - Graphics Card {} Driver - 显卡 {} 驱动 + + Graphics Card {} Driver + 显卡 {} 驱动 - - Graphics Card {} Driver Version - 显卡 {} 驱动版本 + + + Graphics Card {} Driver Version + 显卡 {} 驱动版本 - - No display driver information detected - 未检测到显示驱动信息 + + No display driver information detected + 未检测到显示驱动信息 - - Unable to get display driver information: {} - 无法获取显示驱动信息: {} + + Unable to get display driver information: {} + 无法获取显示驱动信息: {} - - Failed to get audio device information: {} - 获取声音设备信息失败: {} + + Failed to get audio device information: {} + 获取声音设备信息失败: {} - - Built-in Speakers - 内置扬声器 + + Built-in Speakers + 内置扬声器 - - HDMI Audio Output - HDMI 音频输出 + + HDMI Audio Output + HDMI 音频输出 - - Built-in Microphone - 内置麦克风 + + Built-in Microphone + 内置麦克风 - - Headphone Microphone - 耳机麦克风 + + Headphone Microphone + 耳机麦克风 - - - - Audio Service - 音频服务 + + + + Audio Service + 音频服务 - - Kernel Audio Modules - 内核音频模块 + + Kernel Audio Modules + 内核音频模块 - - Failed to get audio driver information: {} - 获取音频驱动信息失败: {} + + Failed to get audio driver information: {} + 获取音频驱动信息失败: {} - - Failed to get input device information: {} - 获取输入设备信息失败: {} + + Failed to get input device information: {} + 获取输入设备信息失败: {} - - Generic USB Keyboard - 通用USB键盘 + + Generic USB Keyboard + 通用USB键盘 - - Generic USB Mouse - 通用USB鼠标 + + Generic USB Mouse + 通用USB鼠标 - - Touchpad - 触摸板 + + Touchpad + 触摸板 - - Webcam - 摄像头 + + Webcam + 摄像头 - Total Disk Capacity: - 磁盘总容量: + Total Disk Capacity: + 磁盘总容量: - Resolution: - 分辨率: + Resolution: + 分辨率: - Color Depth: - 色深: + Color Depth: + 色深: - Refresh Rate: - 刷新率: + Refresh Rate: + 刷新率: - VRAM: - 显存: + VRAM: + 显存: - Remaining VRAM: - 剩余显存: + Remaining VRAM: + 剩余显存: - Display Devices - 显示设备 + Display Devices + 显示设备 - Please select the driver you want to update (if it is blank, it means all drivers are up to date): - 请选择您要更新的驱动程序(如果为空,则表示所有驱动程序都是最新的): + Please select the driver you want to update (if it is blank, it means all drivers are up to date): + 请选择您要更新的驱动程序(如果为空,则表示所有驱动程序都是最新的): - GXDE硬件管理器 - GXDE硬件管理器 + GXDE硬件管理器 + GXDE硬件管理器 - Total Usage: {}% - 总体使用率: {}% + Total Usage: {}% + 总体使用率: {}% - Core Usage: - 各核心使用率: + Core Usage: + 各核心使用率: - Core {}: {}% - 核心 {}: {}% + Core {}: {}% + 核心 {}: {}% - CPU Usage - CPU使用率 + CPU Usage + CPU使用率 - Memory Usage: {:.1f}% ({} / {}) - 内存使用率: {:.1f}% ({} / {}) + Memory Usage: {:.1f}% ({} / {}) + 内存使用率: {:.1f}% ({} / {}) - Swap Usage: {:.1f}% ({} / {}) - 交换分区使用率: {:.1f}% ({} / {}) + Swap Usage: {:.1f}% ({} / {}) + 交换分区使用率: {:.1f}% ({} / {}) - Failed to get graphics card information: {} - 获取显卡信息失败: {} + Failed to get graphics card information: {} + 获取显卡信息失败: {} - Failed to get kernel modules: {} - 获取内核模块失败: {} + Failed to get kernel modules: {} + 获取内核模块失败: {} - Failed to get CPU driver information: {} - 获取CPU驱动信息失败: {} + Failed to get CPU driver information: {} + 获取CPU驱动信息失败: {} - Language - 语言 + Language + 语言 - - + + UpdateProgressDialog - - Update Progress - 更新进度 + + Update Progress + 更新进度 - - Close - 关闭 + + Close + 关闭 - - + + ✅ Update successful! - + ✅ 升级成功! - - ❌ Update failed. Please check the output. If the problem cannot be resolved,please paste the error onto the forum or QQ group. + + ❌ Update failed. Please check the output. If the problem cannot be resolved,please paste the error onto the forum or QQ group. forum:https://bbs.spark-app.store/ QQ group:712629637 - ❌ 更新失败。请检查输出。如果问题无法解决,请将错误粘贴到论坛或QQ群。 + ❌ 更新失败。请检查输出。如果问题无法解决,请将错误粘贴到论坛或QQ群。 论坛:https://bbs.spark-app.store/ QQ群:712629637 - - + + UpdateSourceProgressDialog - - Updating software sources - 更新软件源 + + Updating software sources + 更新软件源 - - Failed to update the software source. The operation was canceled or you do not have sufficient permissions. - 更新软件源失败。操作已取消或您没有足够的权限。 + + Failed to update the software source. The operation was canceled or you do not have sufficient permissions. + 更新软件源失败。操作已取消或您没有足够的权限。 - + -- Gitee From 5f2377c5032ad8a3ddd38614bccd49b238044d23 Mon Sep 17 00:00:00 2001 From: zeqi Date: Sun, 12 Apr 2026 14:34:48 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=83=8C=E6=99=AF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zeqi --- debian/changelog | 2 +- gxde-hardware-viewer.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 884ad65..3bcb4ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -gxde-hardware-viewer (2.6.1) UNRELEASED; urgency=medium +gxde-hardware-viewer (2.6.1-1) UNRELEASED; urgency=medium [ zeqi ] * 显示页新增显存大小和剩余显存 diff --git a/gxde-hardware-viewer.py b/gxde-hardware-viewer.py index 8223163..8d142b7 100644 --- a/gxde-hardware-viewer.py +++ b/gxde-hardware-viewer.py @@ -19,7 +19,7 @@ from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, from PyQt6.QtCore import Qt, QTimer, QTranslator, QCoreApplication, QLocale, QThread, pyqtSignal, QProcess, QSettings from PyQt6.QtGui import QColor, QIcon, QFont, QPainter, QPalette, QPixmap -version = "2.6.1" +version = "2.6.1-1" uname = platform.uname() @@ -227,9 +227,9 @@ class CentralWidget(QWidget): def update_overlay_color(self): """根据当前主题设置遮罩颜色""" if self.current_theme == 'dark': - self.overlay_color = QColor(0, 0, 0, 80) + self.overlay_color = QColor(0, 0, 0, 100) else: - self.overlay_color = QColor(255, 255, 255, 80) + self.overlay_color = QColor(255, 255, 255, 100) def paintEvent(self, event): super().paintEvent(event) -- Gitee From f92288b3d9b33240a08ebeb36a6311ee0f2f0817 Mon Sep 17 00:00:00 2001 From: zeqi Date: Sun, 12 Apr 2026 14:44:50 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=83=8C=E6=99=AF=E5=A3=81=E7=BA=B8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zeqi --- gxde-hardware-viewer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gxde-hardware-viewer.py b/gxde-hardware-viewer.py index 8d142b7..1df7d2c 100644 --- a/gxde-hardware-viewer.py +++ b/gxde-hardware-viewer.py @@ -227,9 +227,9 @@ class CentralWidget(QWidget): def update_overlay_color(self): """根据当前主题设置遮罩颜色""" if self.current_theme == 'dark': - self.overlay_color = QColor(0, 0, 0, 100) + self.overlay_color = QColor(0, 0, 0, 125) else: - self.overlay_color = QColor(255, 255, 255, 100) + self.overlay_color = QColor(255, 255, 255, 125) def paintEvent(self, event): super().paintEvent(event) -- Gitee From 2c271f165d6725c1049203180a9bf9d986acc523 Mon Sep 17 00:00:00 2001 From: zeqi Date: Mon, 13 Apr 2026 14:18:14 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=83=8C=E6=99=AF=E5=A3=81=E7=BA=B8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zeqi --- debian/changelog | 2 +- gxde-hardware-viewer.py | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3bcb4ea..499977a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -gxde-hardware-viewer (2.6.1-1) UNRELEASED; urgency=medium +gxde-hardware-viewer (2.6.1-2) UNRELEASED; urgency=medium [ zeqi ] * 显示页新增显存大小和剩余显存 diff --git a/gxde-hardware-viewer.py b/gxde-hardware-viewer.py index 1df7d2c..78d1267 100644 --- a/gxde-hardware-viewer.py +++ b/gxde-hardware-viewer.py @@ -19,7 +19,7 @@ from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, from PyQt6.QtCore import Qt, QTimer, QTranslator, QCoreApplication, QLocale, QThread, pyqtSignal, QProcess, QSettings from PyQt6.QtGui import QColor, QIcon, QFont, QPainter, QPalette, QPixmap -version = "2.6.1-1" +version = "2.6.1-2" uname = platform.uname() @@ -238,18 +238,17 @@ class CentralWidget(QWidget): if self.bg_image_path and os.path.exists(self.bg_image_path): # 获取当前控件的逻辑尺寸 target_size = self.size() - + # 获取设备像素比 + dpr = self.devicePixelRatioF() # 检查是否需要重新缩放 if self.cached_scaled_pixmap is None or self.cached_size != target_size: pixmap = QPixmap(self.bg_image_path) if not pixmap.isNull(): - # 获取设备像素比 - dpr = self.devicePixelRatioF() # 按物理像素尺寸缩放,避免模糊 physical_size = target_size * dpr scaled = pixmap.scaled( physical_size, - Qt.AspectRatioMode.IgnoreAspectRatio, + Qt.AspectRatioMode.KeepAspectRatioByExpanding, # 改为保持比例并填满 Qt.TransformationMode.SmoothTransformation ) scaled.setDevicePixelRatio(dpr) @@ -257,8 +256,14 @@ class CentralWidget(QWidget): self.cached_size = target_size if self.cached_scaled_pixmap is not None: - painter.drawPixmap(0, 0, self.cached_scaled_pixmap) - + # 计算居中偏移量,使图片中心与控件中心对齐 + pixmap_size = self.cached_scaled_pixmap.size() + pixmap_width = pixmap_size.width() + pixmap_height = pixmap_size.height() + x = (target_size.width() * dpr - pixmap_width) / 2 + y = (target_size.height() * dpr - pixmap_height) / 2 + painter.drawPixmap(int(x), int(y), self.cached_scaled_pixmap) + # 绘制半透明遮罩层 if self.overlay_enabled: painter.fillRect(self.rect(), self.overlay_color) -- Gitee