Skip to content
Snippets Groups Projects
Commit 68266202 authored by Andrew Plaza's avatar Andrew Plaza
Browse files

No need to pass &[] with Window::new()

made a new function in orbtk, Window::new_flags if need to make a
window with flags
parent 2240daa7
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
......@@ -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)
......
......@@ -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,
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment