fix: 包统计行从接口信息区移到累计流量区下方
包统计与流量统计同属累计数据,放一起信息归属清晰;移除接口信息区的 包统计行,在总计行下方新增居中显示;标签加 qsTr 支持国际化
This commit is contained in:
@@ -300,38 +300,6 @@ Control {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 包统计:收发包 + 错误/丢包(累计值,自开机起)
|
|
||||||
// 设计原因:包总数始终显示;错误/丢包仅在存在时显示,避免正常网卡信息过载;
|
|
||||||
// 箭头遵循应用惯例:↓=接收(rx)、↑=发送(tx),与弹窗速度区/累计区一致
|
|
||||||
RowLayout {
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
spacing: 6
|
|
||||||
visible: popup.ready
|
|
||||||
|
|
||||||
// 收发包总数:始终显示,格式 "包 {rx}↓ {tx}↑"
|
|
||||||
Text {
|
|
||||||
text: "包 " + popup.rxPackets.toFixed(0) + "↓ " + popup.txPackets.toFixed(0) + "↑"
|
|
||||||
font.pixelSize: Math.round(12 * popup.fontScale)
|
|
||||||
color: popup.tertiaryText
|
|
||||||
}
|
|
||||||
|
|
||||||
// 错误数:仅在存在错误或丢包时显示,格式 "错误 {rxE}/{txE}"
|
|
||||||
Text {
|
|
||||||
text: "错误 " + popup.rxErrors.toFixed(0) + "/" + popup.txErrors.toFixed(0)
|
|
||||||
font.pixelSize: Math.round(12 * popup.fontScale)
|
|
||||||
color: popup.tertiaryText
|
|
||||||
visible: popup.rxErrors > 0 || popup.txErrors > 0 || popup.rxDropped > 0 || popup.txDropped > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// 丢包数:仅在存在错误或丢包时显示,格式 "丢包 {rxD}/{txD}"
|
|
||||||
Text {
|
|
||||||
text: "丢包 " + popup.rxDropped.toFixed(0) + "/" + popup.txDropped.toFixed(0)
|
|
||||||
font.pixelSize: Math.round(12 * popup.fontScale)
|
|
||||||
color: popup.tertiaryText
|
|
||||||
visible: popup.rxErrors > 0 || popup.txErrors > 0 || popup.rxDropped > 0 || popup.txDropped > 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分隔线1
|
// 分隔线1
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -498,6 +466,43 @@ Control {
|
|||||||
Item { Layout.fillWidth: true }
|
Item { Layout.fillWidth: true }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 包统计:收发包 + 错误/丢包(累计值,自开机起),紧接累计流量下方
|
||||||
|
// 设计原因:包统计与流量统计同属"累计数据",放一起信息归属清晰;
|
||||||
|
// 包总数始终显示;错误/丢包仅在存在时显示,避免正常网卡信息过载;
|
||||||
|
// 箭头遵循应用惯例:↓=接收(rx)、↑=发送(tx),与总计行一致
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: 6
|
||||||
|
visible: popup.ready
|
||||||
|
|
||||||
|
Item { Layout.fillWidth: true }
|
||||||
|
|
||||||
|
// 收发包总数:始终显示,格式 "包 {rx}↓ {tx}↑"
|
||||||
|
Text {
|
||||||
|
text: qsTr("Packets") + " " + popup.rxPackets.toFixed(0) + "↓ " + popup.txPackets.toFixed(0) + "↑"
|
||||||
|
font.pixelSize: Math.round(12 * popup.fontScale)
|
||||||
|
color: popup.tertiaryText
|
||||||
|
}
|
||||||
|
|
||||||
|
// 错误数:仅在存在错误或丢包时显示,格式 "错误 {rxE}/{txE}"
|
||||||
|
Text {
|
||||||
|
text: qsTr("Errors") + " " + popup.rxErrors.toFixed(0) + "/" + popup.txErrors.toFixed(0)
|
||||||
|
font.pixelSize: Math.round(12 * popup.fontScale)
|
||||||
|
color: popup.tertiaryText
|
||||||
|
visible: popup.rxErrors > 0 || popup.txErrors > 0 || popup.rxDropped > 0 || popup.txDropped > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// 丢包数:仅在存在错误或丢包时显示,格式 "丢包 {rxD}/{txD}"
|
||||||
|
Text {
|
||||||
|
text: qsTr("Dropped") + " " + popup.rxDropped.toFixed(0) + "/" + popup.txDropped.toFixed(0)
|
||||||
|
font.pixelSize: Math.round(12 * popup.fontScale)
|
||||||
|
color: popup.tertiaryText
|
||||||
|
visible: popup.rxErrors > 0 || popup.txErrors > 0 || popup.rxDropped > 0 || popup.txDropped > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Item { Layout.fillWidth: true }
|
||||||
|
}
|
||||||
|
|
||||||
// 分隔线3
|
// 分隔线3
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|||||||
@@ -81,6 +81,21 @@
|
|||||||
<source>Total</source>
|
<source>Total</source>
|
||||||
<translation>总计</translation>
|
<translation>总计</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../package/components/NetworkPopup.qml" line="474"/>
|
||||||
|
<source>Packets</source>
|
||||||
|
<translation>包</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../package/components/NetworkPopup.qml" line="483"/>
|
||||||
|
<source>Errors</source>
|
||||||
|
<translation>错误</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../package/components/NetworkPopup.qml" line="494"/>
|
||||||
|
<source>Dropped</source>
|
||||||
|
<translation>丢包</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>NetCommon</name>
|
<name>NetCommon</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user