decoration.cc (1039B)
1 #include "decoration.hh" 2 3 using namespace winsys; 4 5 const ColorScheme ColorScheme::DEFAULT_COLOR_SCHEME = ColorScheme { 6 .focused = 0x8181A6, 7 .fdisowned = 0xc1c1c1, 8 .fsticky = 0x5F8787, 9 .unfocused = 0x333333, 10 .udisowned = 0x999999, 11 .usticky = 0x444444, 12 .urgent = 0x87875F 13 }; 14 15 const Decoration Decoration::NO_DECORATION = Decoration { 16 std::nullopt, 17 std::nullopt 18 }; 19 20 const Decoration Decoration::FREE_DECORATION = Decoration { 21 std::nullopt, 22 Frame { 23 Extents { 3, 1, 1, 1 }, 24 ColorScheme::DEFAULT_COLOR_SCHEME 25 } 26 }; 27 28 29 const Extents 30 Decoration::extents() const 31 { 32 Extents extents = Extents { 0, 0, 0, 0 }; 33 34 if (border) { 35 extents.left += 1; 36 extents.right += 1; 37 extents.top += 1; 38 extents.bottom += 1; 39 } 40 41 if (frame) { 42 extents.left += frame->extents.left; 43 extents.right += frame->extents.right; 44 extents.top += frame->extents.top; 45 extents.bottom += frame->extents.bottom; 46 } 47 48 return extents; 49 }