feat: eww style changes

This commit is contained in:
hesam-init 2024-07-03 01:52:27 +03:30
parent e78c4d3c1d
commit caf64be4bf
8 changed files with 106 additions and 86 deletions

View file

@ -1,17 +1,23 @@
.reveal-on-hover { .reveal-on-hover {
padding: 6px 0px; padding: 12px 0px;
} }
.reveal-on-click { .reveal-on-click {
@extend .widget;
label {
@extend .icon;
color: $surface2; color: $surface2;
padding: 4px 0px; padding: 4px 0px;
}
} }
.separator { .separator {
padding: get-token(padding, small); padding: get-token(padding, small);
.dot { .dot {
padding: 3px; padding: 2px;
border-radius: 100%; border-radius: 100%;

View file

@ -4,8 +4,8 @@
.widget { .widget {
padding: get-token(padding, small); padding: get-token(padding, small);
margin: get-token(margin, small); margin: get-token(margin);
border-radius: get-token(border-radius); border-radius: get-token(border-radius, small);
background-color: $surface0; background-color: $surface0;
} }

View file

@ -1,15 +1,19 @@
.clock { .clock {
@extend .widget; @extend .widget;
label {
font-size: get-token(font-sizes, large); font-size: get-token(font-sizes, large);
font-weight: bolder; font-weight: bold;
}
} }
.language { .language {
@extend .widget; @extend .widget;
font-size: get-token(font-sizes, small); label {
font-weight: bolder; font-size: get-token(font-sizes);
font-weight: bold;
}
} }
.logo { .logo {
@ -33,18 +37,26 @@
.workspace { .workspace {
@extend .animation; @extend .animation;
border-radius: get-token(border-radius);
min-height: 16px; min-height: 16px;
background-color: $surface2; background-color: $surface2;
border-radius: get-token(border-radius);
&.current { &.current {
min-height: 48px; min-height: 42px;
background-color: $accent; background-color: $accent;
} }
} }
} }
.bar-media-player {
@extend .widget;
label {
font-size: get-token(font-sizes, large);
}
}
.media-player { .media-player {
@extend .panel-widget; @extend .panel-widget;

View file

@ -16,8 +16,8 @@ $design-tokens: (
large: 6px, large: 6px,
), ),
border-radius: ( border-radius: (
small: 6px, small: 8px,
default: 8px, default: 10px,
large: 16px, large: 16px,
), ),
); );

View file

@ -32,13 +32,14 @@
:orientation "v" :orientation "v"
:class "widget" :class "widget"
:space-evenly false :space-evenly false
:class "reveal-on-click"
(eventbox (eventbox
:cursor "pointer" :cursor "pointer"
:visible {direction == "up"} :visible {direction == "up"}
:onclick `${EWW_CMD} update ${varname}=${!var}` :onclick `${EWW_CMD} update ${varname}=${!var}`
(label :angle {direction == "up" ? (var ? 270 : 90) : (var ? 90 : 270)} :class "reveal-on-click" :tooltip "touch control" :text "")) (label :angle {direction == "up" ? (var ? 270 : 90) : (var ? 90 : 270)} :tooltip "touch control" :text ""))
(revealer (revealer
:reveal var :reveal var
@ -52,6 +53,6 @@
:visible {direction == "down"} :visible {direction == "down"}
:onclick `${EWW_CMD} update ${varname}=${!var}` :onclick `${EWW_CMD} update ${varname}=${!var}`
(label :angle {direction == "up" ? (var ? 270 : 90) : (var ? 90 : 270)} :class "reveal-on-click" :tooltip "touch control" :text "")) (label :angle {direction == "up" ? (var ? 270 : 90) : (var ? 90 : 270)} :tooltip "touch control" :text ""))
)) ))

View file

@ -1,16 +1,18 @@
(defwidget PlayerCtl [?cover] (defwidget BarMediaPlayer [?cover]
(eventbox (eventbox
:cursor "pointer" :cursor "pointer"
(box (box
:class "widget player-ctl" :class "bar-media-player"
:orientation "v" :orientation "v"
:spacing spacing-default
:space-evenly false :space-evenly false
:spacing spacing-default
(eventbox (eventbox
:onclick "${EWW_CMD} open MusicPlayerPopup --toggle" :onclick "${EWW_CMD} open MusicPlayerPopup --toggle"
:visible cover :visible cover
(image :path { pcover == "" ? "./assets/image/emptympd.png" : pcover } :image-width 20 :image-height 20)) (image :path { pcover == "" ? "./assets/image/emptympd.png" : pcover } :image-width 20 :image-height 20))
(button :onclick "playerctl previous" (button :onclick "playerctl previous"
@ -21,9 +23,9 @@
(label :class "icon" :text "󰒭"))))) (label :class "icon" :text "󰒭")))))
(defwidget MediaPlayer [h permashow] (defwidget MediaPlayer [h permashow]
(box (box
:class "media-player" :class "media-player"
(overlay (overlay
(box (box
:orientation "v" :orientation "v"
:halign "fill" :halign "fill"
@ -50,7 +52,7 @@
:class "player-info" :class "player-info"
:spacing spacing-small :spacing spacing-small
(box (box
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
:visible true :visible true
@ -64,7 +66,7 @@
:hscroll true :hscroll true
:vscroll false :vscroll false
(label :text partist)) (label :text partist))
) )
(box (box
:orientation "h" :orientation "h"
@ -75,7 +77,7 @@
(label :text { pstatus == "Playing" ? "" : ""} )) (label :text { pstatus == "Playing" ? "" : ""} ))
(button :onclick "playerctl next" (button :onclick "playerctl next"
(label :text "󰒭")))))) (label :text "󰒭"))))))
) )
) )

View file

@ -6,7 +6,7 @@
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
:class "clock" :class "clock"
:spacing spacing-small
(label :text thour) (label :text thour)
(label :text tmin)))) (label :text tmin))))
@ -20,6 +20,7 @@
(box (box
:class "popup" :class "popup"
(box (box
:class "widget" :class "widget"
(calendar :day calendar_day :year calendar_year)))) (calendar :day calendar_day :year calendar_year))))

View file

@ -48,7 +48,7 @@
(Separator :orientation "h" :dots "[1, 2, 3]" :visible true) (Separator :orientation "h" :dots "[1, 2, 3]" :visible true)
(PlayerCtl :cover false) (BarMediaPlayer :cover false)
)) ))
(defwidget BarBottom [] (defwidget BarBottom []
@ -57,7 +57,6 @@
:space-evenly false :space-evenly false
:valign "end" :valign "end"
(Sliders) (Sliders)
(Language) (Language)
)) ))
@ -86,7 +85,6 @@
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
:spacing spacing-default :spacing spacing-default
:valign "end"
(RevealOnHover (RevealOnHover
:var {revealWifiEssid} :var {revealWifiEssid}