From 68266202a7dbe78ed0232221d86fea291234ec6b Mon Sep 17 00:00:00 2001
From: Andrew Plaza <andrew.plaza15@gmail.com>
Date: Sat, 1 Apr 2017 15:44:25 -0400
Subject: [PATCH] No need to pass &[] with Window::new()

made a new function in orbtk, Window::new_flags if need to make a
window with flags
---
 src/calculator/main.rs   | 2 +-
 src/editor/main.rs       | 6 +++---
 src/file_manager/main.rs | 2 +-
 src/orblogin/main.rs     | 6 +++++-
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/calculator/main.rs b/src/calculator/main.rs
index e30ea6b..b27dc96 100644
--- a/src/calculator/main.rs
+++ b/src/calculator/main.rs
@@ -278,7 +278,7 @@ fn eval(input: &str) -> String {
 }
 
 fn main(){
-    let mut window = Window::new(Rect::new(-1, -1, 148, 210), "Calculator", &[]);
+    let mut window = Window::new(Rect::new(-1, -1, 148, 210), "Calculator");
 
     {
         let text_box = TextBox::new();
diff --git a/src/editor/main.rs b/src/editor/main.rs
index 64365e3..128528b 100644
--- a/src/editor/main.rs
+++ b/src/editor/main.rs
@@ -22,7 +22,7 @@ fn main(){
     let (display_width, display_height) = orbclient::get_display_size().expect("viewer: failed to get display size");
     let (width, height) = (cmp::min(1024, display_width * 4/5), cmp::min(768, display_height * 4/5));
 
-    let mut window = Window::new(Rect::new(-1, -1, width, height), &title, &[]);
+    let mut window = Window::new(Rect::new(-1, -1, width, height), &title);
 
     let text_box = TextBox::new();
     text_box.position(0, 16)
@@ -49,7 +49,7 @@ fn main(){
     let open_text_box = text_box.clone();
     open_action.on_click(move |_action: &Action, _point: Point| {
         println!("Open");
-        let mut window = Window::new(Rect::new(-1, -1, 220, 32), "Open", &[]);
+        let mut window = Window::new(Rect::new(-1, -1, 220, 32), "Open");
 
         let path_box = TextBox::new();
         path_box.position(0, 0)
@@ -128,7 +128,7 @@ fn main(){
     let save_as_path_option = path_option.clone();
     save_as_action.on_click(move |_action: &Action, _point: Point| {
         println!("Save As");
-        let mut window = Window::new(Rect::new(-1, -1, 320, 32), "Save As", &[]);
+        let mut window = Window::new(Rect::new(-1, -1, 320, 32), "Save As");
 
         let text_box = TextBox::new();
         text_box.position(0, 0)
diff --git a/src/file_manager/main.rs b/src/file_manager/main.rs
index 7ed2c51..d56bb02 100644
--- a/src/file_manager/main.rs
+++ b/src/file_manager/main.rs
@@ -286,7 +286,7 @@ impl FileManager {
             column_labels: Vec::new(),
             sort_predicate: SortPredicate::Name,
             sort_direction: SortDirection::Asc,
-            window: Window::new(Rect::new(-1, -1, 0, 0),  "", &[]),
+            window: Window::new(Rect::new(-1, -1, 0, 0),  ""),
             list_widget_index: None,
             tx: tx,
             rx: rx,
diff --git a/src/orblogin/main.rs b/src/orblogin/main.rs
index fad167b..6f5b68a 100644
--- a/src/orblogin/main.rs
+++ b/src/orblogin/main.rs
@@ -39,7 +39,11 @@ pub fn main() {
             let window_height = 148 + issue_height + if issue_height > 0 { 20 } else { 0 };
 
             let (width, height) = orbclient::get_display_size().expect("launcher: failed to get display size");
-            let mut window = Window::new(Rect::new((width as i32 - 576)/2, (height as i32 - window_height as i32)/2, 576, window_height), "Orbital Login", &[WindowFlag::Exit]);
+            let mut window = Window::new_flags(
+                Rect::new((width as i32 - 576)/2, (height as i32 - window_height as i32)/2, 576, window_height),
+                "Orbital Login",
+                &[WindowFlag::Unclosable]
+                );
 
             let mut y = 8;
 
-- 
GitLab