74 lines
2.5 KiB
Plaintext
74 lines
2.5 KiB
Plaintext
|
|
(defwidget toggle-grid []
|
|
(box :class "toggle-grid"
|
|
:orientation "vertical"
|
|
(box :orientation "horizontal"
|
|
:class "row"
|
|
(grid-toggle :class "network"
|
|
:icon ""
|
|
:header "Network"
|
|
:active true ; This sets if toggle is enabled or not, put condition check here
|
|
:body "Connected" ; Put state here (e.g.: enabled, disabled)
|
|
:visible true
|
|
:onclick "notify-send 'Network' 'toggle network with nmcli!'"
|
|
)
|
|
(grid-toggle :class "bluetooth"
|
|
:icon ""
|
|
:header "Bluetooth"
|
|
:active false
|
|
:body "Connected"
|
|
:visible true
|
|
:onclick "notify-send 'Network' 'toggle network with nmcli!'"
|
|
)
|
|
(grid-toggle :class "dnd"
|
|
:icon ""
|
|
:header "Do Not Disturb"
|
|
:active false
|
|
:body "Disabled"
|
|
:visible true
|
|
:onclick "notify-send 'Network' 'toggle network with nmcli!'"
|
|
)
|
|
)
|
|
(box :orientation "horizontal"
|
|
:class "row"
|
|
:space-evenly false
|
|
(grid-toggle :class "airplane"
|
|
:icon ""
|
|
:header "Airplane Mode"
|
|
:active false
|
|
:body "Disabled"
|
|
:visible true
|
|
:onclick "notify-send 'Network' 'toggle network with nmcli!'"
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
(defwidget grid-toggle [ class onclick active ?icon header body visible ]
|
|
(eventbox :visible "${visible}"
|
|
:onclick "${onclick}"
|
|
:class "grid-toggle ${class} ${ active == true ? 'active' : '' } button"
|
|
(box :class "toggle"
|
|
:space-evenly false
|
|
:orientation "horizontal"
|
|
:width 142
|
|
:height 52
|
|
|
|
(label :class "icon"
|
|
:visible { icon != "" ? true : false }
|
|
:valign "center"
|
|
:text "${icon}")
|
|
|
|
(box :orientation "vertical"
|
|
:space-evenly false
|
|
(label :class "header"
|
|
:text "${header}"
|
|
:xalign 0)
|
|
(label :class "body"
|
|
:text "${body}"
|
|
:xalign 0)
|
|
)
|
|
)
|
|
)
|
|
)
|