1 ///
2 module glui.frame;
3 
4 import raylib;
5 
6 import glui.space;
7 import glui.style;
8 
9 @safe:
10 
11 /// Make a new vertical frame
12 GluiFrame vframe(T...)(T args) {
13 
14     return new GluiFrame(args);
15 
16 }
17 
18 /// Make a new horizontal frame
19 GluiFrame hframe(T...)(T args) {
20 
21     auto frame = new GluiFrame(args);
22     frame.directionHorizontal = true;
23 
24     return frame;
25 
26 }
27 
28 /// This is a frame, a stylized container for other nodes.
29 /// Styles: $(UL
30 ///     $(LI `style` = Default style for this node.)
31 /// )
32 class GluiFrame : GluiSpace {
33 
34     mixin DefineStyles;
35     mixin ImplHoveredRect;
36 
37     this(T...)(T args) {
38 
39         super(args);
40 
41     }
42 
43     protected override void drawImpl(Rectangle outer, Rectangle inner) {
44 
45         const style = pickStyle();
46         style.drawBackground(outer);
47 
48         super.drawImpl(outer, inner);
49 
50     }
51 
52     protected override const(Style) pickStyle() const {
53 
54         return style;
55 
56     }
57 
58 }