## Fidget updates: ZLevel's (z-index) support

Notice that the dropdowns go up when too close to the bottom!

This demo shows the results of some tweaking I did yesterday to add z-index 
(ZLevel) support in OpenGL Fidgets. It's limited to only 4 layers due to the 
way it's implemented. Here's the layers:
    
    
    ZLevel* = enum
        ## The z-index for widget interactions
        ZLevelBottom
        ZLevelDefault
        ZLevelRaised
        ZLevelOverlay
    
    
    
    Run

Essentially each z-index layer is rendered in order but only items visible on 
that layer are drawn, though layouts are fully calculated. I haven't run 
benchmarks to test the overhead, but it hasn't noticeably affected rendering 
speed. CPU usage hasn't noticeably changed either.

Furthermore mouse/keyboard interactions follow the ZLevel precedents where 
lower levels are overshadowed. This simplifies making the dropdown code above 
and avoids annoying "overlapping nodes both got a click". It also simplifies 
worrying about the order widgets are drawn, which makes it possible to use 
Horizontal and Vertical blocks without worrying.

Reply via email to