36 lines
1.1 KiB
QML
36 lines
1.1 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import "../../../config"
|
|
import "../states/Network"
|
|
|
|
MouseArea {
|
|
id: networkButton
|
|
|
|
width: Math.max(networkText.width + Config.spacing_fun(height)*2, height)
|
|
height: bar.height
|
|
hoverEnabled: true
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: {
|
|
console.log("[Network] Refreshing... current status: " + NetworkState.status)
|
|
NetworkState.networkScript.running = true
|
|
}
|
|
|
|
Rectangle {
|
|
anchors.fill: parent
|
|
color: networkButton.containsMouse ? Colors.tertiary : Qt.alpha(Colors.tertiaryContainer, 0.25)
|
|
radius: Config.radius
|
|
border.width: Config.border_width
|
|
border.color: networkButton.containsMouse ? Colors.tertiaryContainer_fg
|
|
: Colors.secondaryContainer_fg
|
|
|
|
Text {
|
|
id: networkText
|
|
text: NetworkState.status
|
|
anchors.centerIn: parent
|
|
font.pixelSize: Config.iconSize(bar.height)
|
|
font.family: Config.font
|
|
color: networkButton.containsMouse ? Colors.tertiary_fg : networkText.text === " /" ? Colors.error : Colors.primary
|
|
}
|
|
}
|
|
} |