Explorar o código

tui: pass coordinates to Widget::new()

lunar-mining %!s(int64=4) %!d(string=hai) anos
pai
achega
8a672bf19f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/tui/widget.rs

+ 2 - 2
src/tui/widget.rs

@@ -14,8 +14,8 @@ pub struct Widget {
 }
 
 impl Widget {
-    pub fn new(title: String) -> Result<Widget> {
-        Ok(Widget { width: 0, height: 0, x: 0, y: 0, title })
+    pub fn new(width: usize, height: usize, x: usize, y: usize, title: String) -> Result<Widget> {
+        Ok(Widget { width, height, x, y, title })
     }
 
     pub fn print(