aboutsummaryrefslogtreecommitdiff
path: root/src/ui.rs
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-25 13:25:07 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-25 13:25:07 +0200
commitc2126083c928b54f7cd6436ab38d38b20498a18b (patch)
treee0c6ed62754cc37042ae96debb6c5a66af1fa975 /src/ui.rs
parent86044397b8fac9298295cc22b40413d8f37025e3 (diff)
downloadrutikmer-c2126083c928b54f7cd6436ab38d38b20498a18b.tar.gz
rutikmer-c2126083c928b54f7cd6436ab38d38b20498a18b.tar.bz2
rutikmer-c2126083c928b54f7cd6436ab38d38b20498a18b.zip
Removing fancy text/ui, Added basic fixed size layout
Diffstat (limited to 'src/ui.rs')
-rw-r--r--src/ui.rs23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/ui.rs b/src/ui.rs
deleted file mode 100644
index 011e5ed..0000000
--- a/src/ui.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-use sdl2::rect::Rect;
-
-pub struct UI {
- pub history_rect: Rect,
- pub shuffle_rect: Rect,
- pub timer_rect: Rect,
-}
-
-impl UI {
- pub fn new(width: u32, height: u32) -> UI {
- let default = Rect::new(0, 0, 0, 0);
- let mut ret = UI {history_rect: default, shuffle_rect: default, timer_rect:default};
- ret.set_layout(width, height);
- ret
- }
-
- pub fn set_layout(&mut self, width: u32, height: u32) {
- self.history_rect = Rect::new(0, 0, width / 3, height);
- self.shuffle_rect = Rect::new((width / 3) as i32, 0, width - width / 3, height / 4);
- self.timer_rect = Rect::new((width / 3) as i32, (height / 4 + (height - height / 4) / 2) as i32,
- 100, 40);
- }
-}