mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Rename module vec2 -> vec
Margins may be moved to vec::Vec4 some day
This commit is contained in:
parent
b8b7638667
commit
1fcca9b3a9
@ -25,7 +25,7 @@ extern crate ncurses;
|
||||
pub mod event;
|
||||
pub mod view;
|
||||
pub mod printer;
|
||||
pub mod vec2;
|
||||
pub mod vec;
|
||||
|
||||
mod div;
|
||||
mod margins;
|
||||
@ -36,7 +36,7 @@ use std::any::Any;
|
||||
use std::rc::Rc;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use vec2::Vec2;
|
||||
use vec::Vec2;
|
||||
use view::View;
|
||||
use printer::Printer;
|
||||
use view::{StackView,ViewPath};
|
||||
|
@ -1,3 +1,5 @@
|
||||
use vec::Vec2;
|
||||
|
||||
/// Fixed margins around a rectangular view.
|
||||
pub struct Margins {
|
||||
/// Left margin
|
||||
@ -20,4 +22,16 @@ impl Margins {
|
||||
bottom: bottom,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn horizontal(&self) -> u32 {
|
||||
self.left + self.right
|
||||
}
|
||||
|
||||
pub fn vertical(&self) -> u32 {
|
||||
self.top + self.bottom
|
||||
}
|
||||
|
||||
pub fn combined(&self) -> Vec2 {
|
||||
Vec2::new(self.horizontal(), self.vertical())
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Makes drawing on ncurses windows easier.
|
||||
|
||||
use ncurses;
|
||||
use vec2::{Vec2,ToVec2};
|
||||
use vec::{Vec2,ToVec2};
|
||||
|
||||
/// Wrapper around a subset of a ncurses window.
|
||||
pub struct Printer {
|
||||
|
@ -1,5 +1,5 @@
|
||||
use event::EventResult;
|
||||
use vec2::{Vec2,ToVec2};
|
||||
use vec::{Vec2,ToVec2};
|
||||
use super::{View,SizeRequest};
|
||||
use printer::Printer;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use ::Cursive;
|
||||
use view::{View,ViewPath,SizeRequest,DimensionRequest};
|
||||
use vec2::{Vec2};
|
||||
use vec::{Vec2};
|
||||
use printer::Printer;
|
||||
|
||||
enum Focus {
|
||||
|
@ -3,7 +3,7 @@ use std::rc::Rc;
|
||||
|
||||
use ::Cursive;
|
||||
use event::{EventResult,Callback};
|
||||
use vec2::{Vec2};
|
||||
use vec::{Vec2};
|
||||
use super::{View,SizeRequest,ViewPath};
|
||||
use printer::Printer;
|
||||
|
||||
|
@ -17,7 +17,7 @@ pub use self::text_view::TextView;
|
||||
pub use self::dialog::Dialog;
|
||||
|
||||
use event::EventResult;
|
||||
use vec2::Vec2;
|
||||
use vec::Vec2;
|
||||
use printer::Printer;
|
||||
|
||||
/// Describe constraints on a view layout in one dimension.
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::cmp::max;
|
||||
|
||||
use vec2::Vec2;
|
||||
use vec::Vec2;
|
||||
use view::{View,SizeRequest,DimensionRequest};
|
||||
use event::EventResult;
|
||||
use printer::Printer;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::cmp;
|
||||
|
||||
use vec2::Vec2;
|
||||
use vec::Vec2;
|
||||
use view::{View,DimensionRequest,SizeRequest};
|
||||
use div::*;
|
||||
use printer::Printer;
|
||||
|
Loading…
Reference in New Issue
Block a user