this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add new alignment widgets (#96)

* Add new alignment widgets

* width and height now ?u16. (The limit does not exist!)

authored by

Justin Braben and committed by
GitHub
7df8ca61 207103e6

+44
+44
src/widgets/alignment.zig
··· 10 10 .height = rows, 11 11 }); 12 12 } 13 + 14 + pub fn topLeft(parent: Window, cols: u16, rows: u16) Window { 15 + const y_off: u16 = 0; 16 + const x_off: u16 = 0; 17 + return parent.child(.{ 18 + .x_off = x_off, 19 + .y_off = y_off, 20 + .width = cols, 21 + .height = rows 22 + }); 23 + } 24 + 25 + pub fn topRight(parent: Window, cols: u16, rows: u16) Window { 26 + const y_off: u16 = 0; 27 + const x_off = parent.width -| cols; 28 + return parent.child(.{ 29 + .x_off = x_off, 30 + .y_off = y_off, 31 + .width = cols, 32 + .height = rows 33 + }); 34 + } 35 + 36 + pub fn bottomLeft(parent: Window, cols: u16, rows: u16) Window { 37 + const y_off = parent.height -| rows; 38 + const x_off: u16 = 0; 39 + return parent.child(.{ 40 + .x_off = x_off, 41 + .y_off = y_off, 42 + .width = cols, 43 + .height = rows 44 + }); 45 + } 46 + 47 + pub fn bottomRight(parent: Window, cols: u16, rows: u16) Window { 48 + const y_off = parent.height -| rows; 49 + const x_off = parent.width -| cols; 50 + return parent.child(.{ 51 + .x_off = x_off, 52 + .y_off = y_off, 53 + .width = cols, 54 + .height = rows 55 + }); 56 + }