diff --git a/shell/applets/BatteryApplet.qml b/shell/applets/BatteryApplet.qml index da0fe2a..f71e3c2 100644 --- a/shell/applets/BatteryApplet.qml +++ b/shell/applets/BatteryApplet.qml @@ -201,13 +201,7 @@ Column { } } - // Separator - Rectangle { - width: parent.width - 16 - height: 1 - anchors.horizontalCenter: parent.horizontalCenter - color: S.Theme.base03 - } + Separator {} // Rate row InfoRow { diff --git a/shell/applets/CpuApplet.qml b/shell/applets/CpuApplet.qml index d6e590a..ca14fc5 100644 --- a/shell/applets/CpuApplet.qml +++ b/shell/applets/CpuApplet.qml @@ -149,13 +149,7 @@ Column { } } - // Process list separator - Rectangle { - width: root.width - 16 - height: 1 - anchors.horizontalCenter: parent.horizontalCenter - color: S.Theme.base03 - } + Separator {} Item { width: root.width diff --git a/shell/applets/GpuApplet.qml b/shell/applets/GpuApplet.qml index 29fb82e..cf5b739 100644 --- a/shell/applets/GpuApplet.qml +++ b/shell/applets/GpuApplet.qml @@ -113,12 +113,7 @@ Column { } // VRAM section - Rectangle { - width: parent.width - 16 - height: 1 - anchors.horizontalCenter: parent.horizontalCenter - color: S.Theme.base03 - } + Separator {} Item { width: parent.width diff --git a/shell/applets/MemoryApplet.qml b/shell/applets/MemoryApplet.qml index d62add2..61bca81 100644 --- a/shell/applets/MemoryApplet.qml +++ b/shell/applets/MemoryApplet.qml @@ -115,13 +115,7 @@ Column { InfoRow { label: "Available"; value: root._fmt(root.availGb) } InfoRow { label: "Total"; value: root._fmt(root.totalGb) } - // Process list separator - Rectangle { - width: root.width - 16 - height: 1 - anchors.horizontalCenter: parent.horizontalCenter - color: S.Theme.base03 - } + Separator {} Item { width: root.width diff --git a/shell/applets/Separator.qml b/shell/applets/Separator.qml new file mode 100644 index 0000000..365b9fc --- /dev/null +++ b/shell/applets/Separator.qml @@ -0,0 +1,9 @@ +import QtQuick +import "../services" as S + +Rectangle { + width: (parent?.width ?? 16) - 16 + height: 1 + anchors.horizontalCenter: parent?.horizontalCenter + color: S.Theme.base03 +} diff --git a/shell/applets/TemperatureApplet.qml b/shell/applets/TemperatureApplet.qml index 7ff7e44..5216580 100644 --- a/shell/applets/TemperatureApplet.qml +++ b/shell/applets/TemperatureApplet.qml @@ -200,11 +200,7 @@ Column { } // Per-device breakdown - Rectangle { - width: root.width - 16 - height: 1 - anchors.horizontalCenter: parent.horizontalCenter - color: S.Theme.base03 + Separator { visible: root.devices.length > 0 } diff --git a/shell/applets/VolumeApplet.qml b/shell/applets/VolumeApplet.qml index 739f9d8..3448216 100644 --- a/shell/applets/VolumeApplet.qml +++ b/shell/applets/VolumeApplet.qml @@ -105,12 +105,7 @@ Column { visible: root.sinkList.length > 1 width: parent.width - Rectangle { - width: parent.width - 16 - height: 1 - anchors.horizontalCenter: parent.horizontalCenter - color: S.Theme.base03 - } + Separator {} Text { width: parent.width @@ -169,12 +164,8 @@ Column { } // Streams section - Rectangle { + Separator { visible: root.streamList.length > 0 - width: parent.width - 16 - height: visible ? 1 : 0 - anchors.horizontalCenter: parent.horizontalCenter - color: S.Theme.base03 } Text { diff --git a/shell/applets/qmldir b/shell/applets/qmldir index 17b1759..bbce44d 100644 --- a/shell/applets/qmldir +++ b/shell/applets/qmldir @@ -11,6 +11,7 @@ InfoRow 1.0 InfoRow.qml MemoryApplet 1.0 MemoryApplet.qml MprisApplet 1.0 MprisApplet.qml NetworkApplet 1.0 NetworkApplet.qml +Separator 1.0 Separator.qml NotifApplet 1.0 NotifApplet.qml TemperatureApplet 1.0 TemperatureApplet.qml VolumeApplet 1.0 VolumeApplet.qml