Skip to content

Have widget appear in the place of another when hovered #862

Discussion options

You must be logged in to vote

Thanks to @oldwomanjosiah and @viandoxdev, I have managed to get it working the way I want it to.
Here is a minimal example:

(defvar media-hover false)
(defwidget media-player []
  (eventbox
    :onhover "eww update media-hover=true"
    :onhoverlost "eww update media-hover=false"
    (overlay
      :class "media-player"
      :space-evenly false
      (revealer
        :reveal { media-hover == false }
        ; label with track title
      )
      (centerbox
        (box) ; this is to center the controls
        (revealer
          :reveal { media-hover == true }
          (box
            :class "media-controls"
            :space-evenly false
            ; playerctl media buttons)
    …

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@parmjotsinghrobot
Comment options

Comment options

You must be logged in to vote
3 replies
@parmjotsinghrobot
Comment options

@viandoxdev
Comment options

@parmjotsinghrobot
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by parmjotsinghrobot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants