44 lines
1.2 KiB
QML
44 lines
1.2 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import "." as M
|
|
import "../services" as S
|
|
|
|
M.BarSection {
|
|
id: root
|
|
spacing: S.Theme.moduleSpacing
|
|
tooltip: ""
|
|
|
|
readonly property string state: S.NetworkService.state
|
|
|
|
M.BarIcon {
|
|
icon: {
|
|
if (root.state === "wifi")
|
|
return "\uF1EB";
|
|
if (root.state === "eth")
|
|
return "\uDB80\uDE00";
|
|
if (root.state === "linked")
|
|
return "\uDB85\uDE16";
|
|
return "\uDB82\uDCFD";
|
|
}
|
|
color: root.state === "disconnected" ? S.Theme.base08 : root.accentColor
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
M.BarLabel {
|
|
visible: root.state === "wifi"
|
|
label: S.NetworkService.essid
|
|
color: root.state === "disconnected" ? S.Theme.base08 : root.accentColor
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
|
|
required property var bar
|
|
|
|
readonly property bool _anyHover: root._hovered || networkMenu.panelHovered
|
|
|
|
M.NetworkMenu {
|
|
id: networkMenu
|
|
showPanel: root._anyHover
|
|
screen: QsWindow.window?.screen ?? null
|
|
anchorItem: root
|
|
accentColor: root.accentColor
|
|
}
|
|
}
|