flo/menu/
adjust.rs

1use super::controls;
2
3use ui::*;
4use binding::*;
5
6///
7/// The menu controller for the adjust tool
8/// 
9pub struct AdjustMenuController {
10    ui: BindRef<Control>
11}
12
13impl AdjustMenuController {
14    ///
15    /// Creates a new adjust menu controller
16    /// 
17    pub fn new() -> AdjustMenuController {
18        let ui = Self::ui();
19
20        AdjustMenuController {
21            ui: ui
22        }
23    }
24
25    ///
26    /// Creates the UI for the adjust menu controller
27    /// 
28    fn ui() -> BindRef<Control> {
29        let ui = bind(Control::container()
30                    .with(Bounds::fill_all())
31                    .with(ControlAttribute::Padding((0, 3), (0, 3)))
32                    .with(vec![
33                        controls::divider(),
34
35                        Control::label()
36                            .with("Adjust:")
37                            .with(FontWeight::Light)
38                            .with(TextAlign::Right)
39                            .with(Font::Size(14.0))
40                            .with(Bounds::next_horiz(48.0))
41                    ])
42            );
43
44        BindRef::from(ui)
45    }
46}
47
48impl Controller for AdjustMenuController {
49    fn ui(&self) -> BindRef<Control> {
50        self.ui.clone()
51    }
52}