Fix warnings

This commit is contained in:
Alexandre Bury 2015-05-23 17:11:58 -07:00
parent 081b7545b9
commit a2b4273589
4 changed files with 8 additions and 21 deletions

View File

@ -5,7 +5,7 @@ use ncurses;
use color;
use ::{Cursive,Margins};
use event::EventResult;
use view::{View,ViewPath,SizeRequest,DimensionRequest};
use view::{View,SizeRequest,DimensionRequest};
use view::{Button,SizedView};
use vec::Vec2;
use printer::Printer;

View File

@ -3,7 +3,7 @@ use std::rc::Rc;
use ::Cursive;
use event::{EventResult,Callback};
use super::{View,ViewPath,ViewWrapper};
use super::{View,ViewWrapper};
/// A simple wrapper view that catches some ignored event from its child.
///

View File

@ -29,15 +29,12 @@ impl <T: View> ViewWrapper for ShadowView<T> {
fn wrap_draw(&mut self, printer: &Printer, focused: bool) {
{
printer.with_style(color::PRIMARY, |printer| {
// Draw the view background
for y in 1..printer.size.y-1 {
printer.print_hline((1,y), printer.size.x-2, ' ' as u64);
}
});
}
printer.with_style(color::PRIMARY, |printer| {
// Draw the view background
for y in 1..printer.size.y-1 {
printer.print_hline((1,y), printer.size.x-2, ' ' as u64);
}
});
self.view.draw(&printer.sub_printer(Vec2::new(1,1), printer.size - (2,2)), focused);

View File

@ -1,7 +1,6 @@
use std::cmp::max;
use std::any::Any;
use color;
use vec::Vec2;
use view::{View,SizeRequest,DimensionRequest,Selector,ShadowView};
use event::EventResult;
@ -47,10 +46,6 @@ impl View for StackView {
let size = v.size;
let offset = (printer.size - size) / 2;
v.view.draw(&printer.sub_printer(offset, size), focused);
// v.view.draw(&printer.sub_printer(offset, v.size), focused);
}
}
@ -69,11 +64,6 @@ impl View for StackView {
for layer in self.layers.iter_mut() {
layer.size = Vec2::min(size, layer.view.get_min_size(req));
layer.view.layout(layer.size);
let h = layer.size.y as i32;
let w = layer.size.x as i32;
let x = (size.x as i32 - w) / 2;
let y = (size.y as i32 - h) / 2;
}
}