Merge branch 'master' of ssh://69.25.196.28:822/srv/git/moonshot-ui
[moonshot-ui.git] / src / moonshot-custom-vbox.vala
1 using Gtk;
2
3 class CustomVBox : VBox
4 {
5     public IdCardWidget current_idcard { get; set; default = null; }
6
7     public CustomVBox (bool homogeneous, int spacing)
8     {
9         this.set_homogeneous (homogeneous);
10         this.set_spacing (spacing);
11     }
12
13     public void receive_expanded_event (IdCardWidget id_card_widget)
14     {
15         var list = this.get_children ();
16         foreach (Widget id_card in list)
17         {
18             if (id_card != id_card_widget)
19                 ((IdCardWidget) id_card).collapse ();
20         }
21         current_idcard = id_card_widget;
22     }
23
24     public void add_id_card_widget (IdCardWidget id_card_widget)
25     {
26         this.pack_start (id_card_widget, false, false);
27     }
28
29     public void remove_id_card_widget (IdCardWidget id_card_widget)
30     {
31         this.remove (id_card_widget);
32     }
33 }