From e672401907d83a73ee47354fc8673d2201a6fa4a Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 23 Jul 2023 13:40:45 -0400 Subject: [PATCH] feat: separate button from notif pane --- config/eww/traybuttons/traybuttons.scss | 21 ++++--- config/eww/traybuttons/traybuttons.yuck | 75 +++++++++++++++---------- 2 files changed, 58 insertions(+), 38 deletions(-) diff --git a/config/eww/traybuttons/traybuttons.scss b/config/eww/traybuttons/traybuttons.scss index bfb7b449..cbca9237 100644 --- a/config/eww/traybuttons/traybuttons.scss +++ b/config/eww/traybuttons/traybuttons.scss @@ -1,20 +1,20 @@ .osk-toggle { - font-size: 30px; - min-height: 38px; + font-size: 28px; + min-height: 34px; min-width: 50px; padding: 0px 0px 0px 5px; } .tablet-toggle { - font-size: 26px; - min-height: 38px; + font-size: 28px; + min-height: 34px; min-width: 50px; padding: 0px 0px 0px 5px; } .heart-toggle { - font-size: 24px; - min-height: 38px; + font-size: 28px; + min-height: 34px; min-width: 50px; padding: 0px 0px 0px 4px; } @@ -23,7 +23,14 @@ font-size: 20px; min-height: 34px; min-width: 105px; - padding: 0px 0px 0px 5px; + padding: 1px 0px 1px 5px; +} + +.quick-settings-toggle { + font-size: 24px; + min-height: 37px; + min-width: 40px; + padding: 0px 0px 0px 0px; } .toggle-off { diff --git a/config/eww/traybuttons/traybuttons.yuck b/config/eww/traybuttons/traybuttons.yuck index fcf84c1a..02dab685 100644 --- a/config/eww/traybuttons/traybuttons.yuck +++ b/config/eww/traybuttons/traybuttons.yuck @@ -1,7 +1,8 @@ (defvar osk-ts false) (defwidget osk-toggle [] - (eventbox :class {osk-ts ? "toggle-on" : "toggle-off"} - :onclick "$HYPR_PATH/osk-toggle.sh toggle &" + (button :class {osk-ts ? "toggle-on" : "toggle-off"} + :onclick "$HYPR_PATH/osk-toggle.sh toggle &" + (box :class "osk-toggle" :orientation "h" (label :text " 󰌌 ") @@ -11,21 +12,22 @@ (defvar tablet-ts false) (defwidget tablet-toggle [] - (eventbox :class {tablet-ts ? "toggle-on" : "toggle-off"} - :onclick {tablet-ts ? "$HYPR_PATH/laptop-mode.sh &" : - "$HYPR_PATH/tablet-mode.sh &"} - (box :class "tablet-toggle" - :orientation "h" + (button :class {tablet-ts ? "toggle-on" : "toggle-off"} + :onclick {tablet-ts ? "$HYPR_PATH/laptop-mode.sh &" : + "$HYPR_PATH/tablet-mode.sh &"} + (box :class "tablet-toggle" + :orientation "h" (label :text " 󰦧 ") ) ) ) (defwidget heart-toggle [] - (eventbox :class {heart_icon == "󰣐" ? "toggle-on" : "toggle-off"} - :onclick "$EWW_PATH/heart.sh" - (box :class "heart-toggle" - :orientation "h" + (button :class {heart_icon == "󰣐" ? "toggle-on" : "toggle-off"} + :onclick "$EWW_PATH/heart.sh" + + (box :class "heart-toggle" + :orientation "h" (label :text " ${heart_icon} ") ) ) @@ -34,7 +36,7 @@ (defwidget left-bar [] (box :class "transparent" :space-evenly true - :spacing 14 + :spacing 12 :orientation "h" (osk-toggle) (tablet-toggle) @@ -45,8 +47,8 @@ :monitor 0 :stacking "overlay" :exclusive "ignore" - :geometry (geometry :x "10px" - :y "11px" + :geometry (geometry :x "5px" + :y "10px" :width "0px" :height "0px" :anchor "top left" @@ -56,38 +58,49 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;  - +(defvar quick-settings-ts false) +(defwidget quick-settings-toggle [] + (button :class {quick-settings-ts ? "toggle-on" : "toggle-off"} + :onclick "" + (box :class "quick-settings-toggle" + :orientation "h" + (label :text "  ") + ) + ) +) +(defwindow quick-settings-toggle + :monitor 0 + :stacking "overlay" + :exclusive "ignore" + :geometry (geometry :x "5px" + :y "10px" + :width "0px" + :height "0px" + :anchor "top right" + ) + (quick-settings-toggle) +) (defvar notif-panel-state false) (defwidget notif-panel [] (button :class {notif-panel-state ? "toggle-on" : "toggle-off"} :onclick {notif-panel-state ? "swaync-client -cp; eww update notif-panel-state=false" : "swaync-client -op; eww update notif-panel-state=true"} - (box :class "notif-panel" - :orientation "h" + (box :class "notif-panel" + :orientation "h" (label :text " ${notif_icon} ") ) ) ) - -(defwidget right-bar [] - (box :class "transparent" - :space-evenly true - :spacing 14 - :orientation "h" - (notif-panel) - ) -) -(defwindow right-bar +(defwindow notif-panel :monitor 0 :stacking "overlay" :exclusive "ignore" - :geometry (geometry :x "50px" - :y "11px" + :geometry (geometry :x "60px" + :y "10px" :width "0px" :height "0px" :anchor "top right" ) - (right-bar) + (notif-panel) )