elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.31k stars 382 forks source link

[WIDGET] Rotation-Box #563

Open EvysGarden opened 2 years ago

EvysGarden commented 2 years ago

Description of the widget

Rotation-Box

The rotation box can contain an arbitrary number of widgets but only ever displays one.

Properties

Example

(defvar varIndex 0)

(eventbox
  :onhover "eww update varIndex=1"
  :onhoverlost "eww update varIndex=0"
  (rotationbox
    :index varIndex
    :transition "slideright"
    :transitionback "slideleft"
    "0"
    "1"))

slide items

Implementation proposal

No response

Example usage

I've got the idea when i was implementing a clock/date widget. I wanted the numbers to slide from time to date on hover and back. Something like this:

active      onhover
______      ______
| %H | <--> | %d |
---
| %M | <--> | %m |
---
| %S | <--> | %y |

I first tried to implement it with to revealers, where one reveals when the other hides but couldn't quite get it to work because they were both taking their own space while I wanted them to use the same space. (Hope that makes sense)

Additional context

If there is another way of doing this I'll gladly use it. I'm new to eww and couldn't find an easy way.

elkowar commented 2 years ago

hmmmmmmm this would be really cool to have, although implementation wouldn't be all that trivial, and it's definitely a niche usecase. I'm pretty sure it should be possible to do something like this with revealers currently, although I'm painfully aware of how weird the revealer spacing issues are -- GTK really doesn't like us ^^'

rice7th commented 1 year ago

I think that cycle widget might be a more appropriate name