1 module evael.graphics.gui.Theme; 2 3 public 4 { 5 import evael.graphics.gui.Background; 6 import evael.graphics.Font; 7 import evael.utils.Color; 8 } 9 10 import std.typecons; 11 12 import jsonizer; 13 14 class Theme 15 { 16 mixin JsonizeMe; 17 18 /// Border type 19 enum BorderType 20 { 21 Solid, 22 None 23 } 24 25 @jsonize 26 { 27 /// Border type 28 public BorderType borderType = BorderType.Solid; 29 30 /// Radius 31 public float cornerRadius; 32 33 /// Draw drop shadow ? 34 public bool drawDropShadow = true; 35 36 /// Draw text shadow ? 37 public bool drawTextShadow = true; 38 39 /* Fonts */ 40 public Font font; 41 public Font iconFont; 42 43 /* Font size */ 44 public int fontSize; 45 46 /* Colors */ 47 public Color borderColor; 48 public Color dropShadowColor; 49 public Color fontColor; 50 public Color disabledTextColor; 51 52 /// Background 53 public Background background; 54 55 /// Scale 56 public float scale = 1.0f; 57 58 public Color[string] customColors; 59 } 60 61 public Theme parent; 62 public Theme[string] subThemes; 63 64 public string name; 65 66 public Theme copy() 67 { 68 void* data = cast(void *)typeid(this).create(); 69 data[0 .. typeid(this).initializer.length] = (cast(void*)this)[0 .. typeid(this).initializer.length]; 70 71 return cast(Theme)data; 72 } 73 }