feat(eww): switch buttons to eventbox for cursor change

This commit is contained in:
matt1432 2023-07-23 17:12:32 -04:00
parent e672401907
commit 11b7a12c71
3 changed files with 18 additions and 11 deletions

View file

@ -1,34 +1,34 @@
.osk-toggle { .osk-toggle {
font-size: 28px; font-size: 28px;
min-height: 34px; min-height: 40px;
min-width: 50px; min-width: 50px;
padding: 0px 0px 0px 5px; padding: 0px 0px 0px 5px;
} }
.tablet-toggle { .tablet-toggle {
font-size: 28px; font-size: 28px;
min-height: 34px; min-height: 40px;
min-width: 50px; min-width: 50px;
padding: 0px 0px 0px 5px; padding: 0px 0px 0px 5px;
} }
.heart-toggle { .heart-toggle {
font-size: 28px; font-size: 28px;
min-height: 34px; min-height: 40px;
min-width: 50px; min-width: 50px;
padding: 0px 0px 0px 4px; padding: 0px 0px 0px 4px;
} }
.notif-panel { .notif-panel {
font-size: 20px; font-size: 20px;
min-height: 34px; min-height: 37px;
min-width: 105px; min-width: 105px;
padding: 1px 0px 1px 5px; padding: 1px 0px 1px 5px;
} }
.quick-settings-toggle { .quick-settings-toggle {
font-size: 24px; font-size: 24px;
min-height: 37px; min-height: 40px;
min-width: 40px; min-width: 40px;
padding: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;
} }

View file

@ -1,7 +1,8 @@
(defvar osk-ts false) (defvar osk-ts false)
(defwidget osk-toggle [] (defwidget osk-toggle []
(button :class {osk-ts ? "toggle-on" : "toggle-off"} (eventbox :class {osk-ts ? "toggle-on" : "toggle-off"}
:onclick "$HYPR_PATH/osk-toggle.sh toggle &" :onclick "$HYPR_PATH/osk-toggle.sh toggle &"
:cursor "pointer"
(box :class "osk-toggle" (box :class "osk-toggle"
:orientation "h" :orientation "h"
@ -12,9 +13,11 @@
(defvar tablet-ts false) (defvar tablet-ts false)
(defwidget tablet-toggle [] (defwidget tablet-toggle []
(button :class {tablet-ts ? "toggle-on" : "toggle-off"} (eventbox :class {tablet-ts ? "toggle-on" : "toggle-off"}
:onclick {tablet-ts ? "$HYPR_PATH/laptop-mode.sh &" : :onclick {tablet-ts ? "$HYPR_PATH/laptop-mode.sh &" :
"$HYPR_PATH/tablet-mode.sh &"} "$HYPR_PATH/tablet-mode.sh &"}
:cursor "pointer"
(box :class "tablet-toggle" (box :class "tablet-toggle"
:orientation "h" :orientation "h"
(label :text " 󰦧 ") (label :text " 󰦧 ")
@ -23,8 +26,9 @@
) )
(defwidget heart-toggle [] (defwidget heart-toggle []
(button :class {heart_icon == "󰣐" ? "toggle-on" : "toggle-off"} (eventbox :class {heart_icon == "󰣐" ? "toggle-on" : "toggle-off"}
:onclick "$EWW_PATH/heart.sh" :onclick "$EWW_PATH/heart.sh"
:cursor "pointer"
(box :class "heart-toggle" (box :class "heart-toggle"
:orientation "h" :orientation "h"
@ -60,8 +64,10 @@
(defvar quick-settings-ts false) (defvar quick-settings-ts false)
(defwidget quick-settings-toggle [] (defwidget quick-settings-toggle []
(button :class {quick-settings-ts ? "toggle-on" : "toggle-off"} (eventbox :class {quick-settings-ts ? "toggle-on" : "toggle-off"}
:onclick "" :onclick ""
:cursor "pointer"
(box :class "quick-settings-toggle" (box :class "quick-settings-toggle"
:orientation "h" :orientation "h"
(label :text "  ") (label :text "  ")
@ -83,7 +89,7 @@
(defvar notif-panel-state false) (defvar notif-panel-state false)
(defwidget notif-panel [] (defwidget notif-panel []
(button :class {notif-panel-state ? "toggle-on" : "toggle-off"} (eventbox :class {notif-panel-state ? "toggle-on" : "toggle-off"}
:onclick {notif-panel-state ? "swaync-client -cp; eww update notif-panel-state=false" : :onclick {notif-panel-state ? "swaync-client -cp; eww update notif-panel-state=false" :
"swaync-client -op; eww update notif-panel-state=true"} "swaync-client -op; eww update notif-panel-state=true"}
(box :class "notif-panel" (box :class "notif-panel"

View file

@ -22,7 +22,8 @@ exec-once = bash -c "sleep 6; tutanota-desktop -a"
exec-once = eww daemon exec-once = eww daemon
exec-once = eww open left-bar exec-once = eww open left-bar
exec-once = eww open right-bar exec-once = eww open notif-panel
exec-once = eww open quick-settings-toggle
# TODO: put this in eww configs? # TODO: put this in eww configs?
exec-once = $HYPR_PATH/osk-toggle.sh getState exec-once = $HYPR_PATH/osk-toggle.sh getState