ソースを参照

tui: pass coordinates to Widget::new()

lunar-mining 4 年 前
コミット
8a672bf19f
1 ファイル変更2 行追加2 行削除
  1. 2 2
      src/tui/widget.rs

+ 2 - 2
src/tui/widget.rs

@@ -14,8 +14,8 @@ pub struct Widget {
 }
 }
 
 
 impl 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(
     pub fn print(