Files
colorshell/eww/widgets/control-center/toggle-grid.yuck
T
2024-12-07 16:43:37 -03:00

38 lines
1.2 KiB
Plaintext

(defwidget toggle-grid []
(box :class "toggle-grid"
(grid-toggle :class "network"
:icon "󰈀"
:header "Network"
:active true ; This sets if toggle is enabled or not, put condition check here
:body "Connected" ; Generally put state here
:visible true
:max-width 128
:max-height 48
:onclick "notify-send 'Network' 'toggle network with nmcli!'"
)
)
)
(defwidget grid-toggle [ class onclick active ?icon header body visible max-width max-height ]
(eventbox :visible "${visible}"
:onclick "${onclick}"
:class "${class} ${ active ? 'active' : '' }"
(box :class "toggle"
:space-evenly false
:orientation "horizontal"
(label :class "icon"
:visible { icon != "" ? true : false }
:valign "center"
"${icon}")
(box :orientation "vertical"
(label :class "header"
"${header}")
(label :class "body"
"${body}")
)
)
)
)