flet icon indicating copy to clipboard operation
flet copied to clipboard

Feature: add Hover to Controls

Open StanMathers opened this issue 3 years ago • 1 comments

Hovering would be good, it can improve UI and give a variety of opportunities to build UIs with Flet

StanMathers avatar Jul 28 '22 19:07 StanMathers

Some implementation thoughts from Discord:

It could be a separate class maybe or just an event added to Container, or Image. The main concern here is latency. In desktop app when everything is on a single machine it won't be visible, but when it's going to be a mobile hovering something will send a message to a python (one hop) and then python will send back an updated control state (second hop).

...it would be good to be separate class, since if we only do that for Container or Image class, there might be cases when someone needs hover for some other controls. More general implementation would be good.

...to fight latency we could do Hoverable control with two children: normal_child and hovered_child.

Draggable has similar approach: https://flet.dev/docs/controls/draggable#content

FeodorFitsner avatar Jul 28 '22 20:07 FeodorFitsner