move stuff into components
This commit is contained in:
parent
6370732e4e
commit
14292e6683
17 changed files with 81 additions and 149 deletions
|
|
@ -1,11 +1,16 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell.Io
|
||||
import "." as M
|
||||
|
||||
Row {
|
||||
M.BarSection {
|
||||
id: root
|
||||
spacing: 4
|
||||
tooltip: {
|
||||
if (root.state === "wifi") return "WiFi: " + root.essid + (root.ifname ? "\nInterface: " + root.ifname : "");
|
||||
if (root.state === "eth") return "Ethernet: " + root.ifname;
|
||||
if (root.state === "linked") return "Linked: " + root.ifname;
|
||||
return "Disconnected";
|
||||
}
|
||||
|
||||
property string ifname: ""
|
||||
property string essid: ""
|
||||
|
|
@ -45,12 +50,9 @@ Row {
|
|||
|
||||
M.BarIcon {
|
||||
icon: {
|
||||
if (root.state === "wifi")
|
||||
return "\uF1EB";
|
||||
if (root.state === "eth")
|
||||
return "\uDB80\uDE00";
|
||||
if (root.state === "linked")
|
||||
return "\uDB85\uDE16";
|
||||
if (root.state === "wifi") return "\uF1EB";
|
||||
if (root.state === "eth") return "\uDB80\uDE00";
|
||||
if (root.state === "linked") return "\uDB85\uDE16";
|
||||
return "\uDB82\uDCFD";
|
||||
}
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
|
@ -63,15 +65,4 @@ Row {
|
|||
font.family: M.Theme.fontFamily
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: {
|
||||
if (root.state === "wifi") return "WiFi: " + root.essid + (root.ifname ? "\nInterface: " + root.ifname : "");
|
||||
if (root.state === "eth") return "Ethernet: " + root.ifname;
|
||||
if (root.state === "linked") return "Linked: " + root.ifname;
|
||||
return "Disconnected";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue