Dawoodoz / DFPSR

Fast realtime softare rendering library for C++14 using SSE/AVX/NEON. 2D, 3D and isometric rendering with minimal system dependencies.
https://dawoodoz.com/dfpsr.html
81 stars 6 forks source link

Show the focus and hover states in components #73

Open Dawoodoz opened 1 year ago

Dawoodoz commented 1 year ago

There are now state flags for direct and indirect hovering over components, which has both getters and state update notifications. There is however no integration with how components are rendered using the information, which needs to be done do that the interface gives instant feedback on which component would respond if clicked.

One can display hover using:

The menu expansion might also want to display that a menu is opened using something else than a hardcoded color change. An "enabled" property might be okay to implement using only color changes, because it is rarely used.

Dawoodoz commented 11 months ago

To generate all combinations without having to draw an exponential number of images by hand, the media machine needs conditional jumps to make some draw operations optional.

Dawoodoz commented 11 months ago

Menus now have focus and hover effects. https://github.com/Dawoodoz/DFPSR/pull/94

Dawoodoz commented 3 months ago

If adding hover effects for buttons, it will look strange without reacting to leave events, because the cursor may go from hovering a button along the side to going outside, leaving the button in a hovering state when the mouse is outside. Implementing enter and leave events would however further complicate integration and testing on each platform where mouse input is used. Having enter and leave events optional would leave applications that depend on them broken. Maybe just implement leave without enter in the back-end and detect enter events automatically in DsrWindow on the first move event after leave.

Dawoodoz commented 3 months ago

Focus for components might also need events for getting and losing window focus. One would need to implement both focus events because a window can be activated without interacting with the canvas, but it could be entirely optional to implement by simply telling components not to show focus when not supported. When textboxes are used however, it is a helpful cue to know when you can type into something.