feat: 新增流量波动图窗口,展示活动接口最近 5 分钟网速趋势
- C++ 后端增加 SpeedSample 采样结构与每接口环形缓冲(MAX_HISTORY_SAMPLES=300, 即 5 分钟/1Hz),通过 speedHistoryDownload/speedHistoryUpload 暴露为 QVariantList of QPointF 供 QML 绘制;接口切换/消失时同步清理历史避免泄漏 - 新增 package/components/TrafficChartWindow.qml:纯 QML Canvas 绘制下载/上传 双折线,无外部依赖;支持 hover 辅助线、置顶图钉、空状态兜底 - networkview.qml 右键菜单增加"流量波动图"入口,弹出屏幕居中独立窗口
This commit is contained in:
@@ -662,6 +662,16 @@ AppletItem {
|
||||
}
|
||||
}
|
||||
|
||||
// 流量波动图:屏幕居中独立窗口,展示活动接口最近 30 分钟网速趋势
|
||||
Platform.MenuItem {
|
||||
text: qsTr("流量波动图")
|
||||
onTriggered: {
|
||||
trafficChartWindow.show()
|
||||
trafficChartWindow.raise()
|
||||
trafficChartWindow.requestActivate()
|
||||
}
|
||||
}
|
||||
|
||||
Platform.MenuSeparator {}
|
||||
|
||||
Platform.MenuItem {
|
||||
@@ -682,6 +692,14 @@ AppletItem {
|
||||
version: root.applet ? root.applet.version : "1.0"
|
||||
}
|
||||
|
||||
// 流量波动图窗口:屏幕居中独立窗口,展示活动接口最近 30 分钟网速趋势
|
||||
// 依赖通过属性传入:accentColor = root.accentRed,applet = root.applet
|
||||
TrafficChartWindow {
|
||||
id: trafficChartWindow
|
||||
accentColor: root.accentRed
|
||||
applet: root.applet
|
||||
}
|
||||
|
||||
// 设置窗口:独立顶层窗口,在桌面中间弹出
|
||||
// 设计原因:Dialog 使用父窗口(dock layer-surface)的 overlay,仅覆盖任务栏区域,
|
||||
// 无法在桌面中间显示。改用 Window 创建独立顶层窗口,可在桌面任意位置弹出。
|
||||
|
||||
Reference in New Issue
Block a user