~lubuntu-software-center-team/lubuntu-software-center/vala-port

« back to all changes in this revision

Viewing changes to src/Widgets/Pages/AppsInfo.vala

  • Committer: Stephen Smally
  • Date: 2012-03-18 10:38:53 UTC
  • Revision ID: eco.stefi@fastwebnet.it-20120318103853-v7wg1qfuifjkc3gc
Implemented dynamic category view

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
    public class AppsInfo : Box {
9
9
        private Separator separator;
10
10
        private RoundBox box;
 
11
        public RoundBox reviews_box;
11
12
        private Label pkg_name;
12
13
        private Label short_description;
13
14
        private Label description;
35
36
        
36
37
        public AppsInfo () {
37
38
            orientation = Orientation.VERTICAL;
38
 
            spacing = 0;
39
 
            border_width = 10;
 
39
            spacing = 5;
 
40
            border_width = 5;
40
41
            
41
42
            // Main container
42
43
            box = new RoundBox(Orientation.VERTICAL, 0);
60
61
            label_box.pack_start(pkg_name, false, false, 0);
61
62
            label_box.pack_start(short_description, false, false, 0);
62
63
            
63
 
            summary_box.pack_start(label_box, true, true, 0);
64
 
            Button install_button = new Button.with_label("Install");
65
 
            install_button.relief = ReliefStyle.NONE;
66
 
            summary_box.pack_start(install_button, false, false, 0);
 
64
            summary_box.pack_start(label_box, false, false, 0);
 
65
            
 
66
            // Status box
 
67
            Box status_box = new Box(Orientation.HORIZONTAL, 0);
 
68
            
 
69
            Label status_label = new Label("<i>Installed</i>");
 
70
            status_label.margin_right = 2;
 
71
            status_label.use_markup = true;
 
72
            
 
73
            status_box.pack_start(new Image.from_stock(Stock.YES, IconSize.MENU), false, false, 0);
 
74
            status_box.pack_start(status_label, false, false, 0);
 
75
            
 
76
            summary_box.pack_end(status_box, false, false, 0);
67
77
            
68
78
            // Description
69
79
            Box description_box = new Box(Orientation.VERTICAL, 0);
76
86
            
77
87
            // Details (version and size)
78
88
            Box details_box = new Box(Orientation.VERTICAL, 0);
79
 
            details_box.border_width = 10;
80
 
            version = new Label("<b>Version:</b>");
 
89
            details_box.border_width = 5;
 
90
            version = new Label("<b>Version:</b> 0.0.1");
81
91
            version.use_markup = true;
82
92
            version.halign = Align.START;
83
 
            size = new Label("<b>Size:</b>");
 
93
            size = new Label("<b>Size:</b> 1024 Kb");
84
94
            size.use_markup = true;
85
95
            size.halign = Align.START;
86
 
            id = new Label("<b>Id:</b>");
 
96
            id = new Label("<b>Id:</b> package-id");
87
97
            id.use_markup = true;
88
98
            id.halign = Align.START;
89
99
            details_box.pack_start(id, false, false, 0);
97
107
            pack_separator();
98
108
            box.pack_start(details_box, false, false, 0);
99
109
            
 
110
            // Reviews container
 
111
            reviews_box = new RoundBox(Orientation.VERTICAL, 0);
 
112
            reviews_box.expand = false;
 
113
            
 
114
            Box container = new Box(Orientation.HORIZONTAL, 3);
 
115
            container.border_width = 5;
 
116
            
 
117
            Label reviews_label = new Label("<big><b>Reviews</b></big>");
 
118
            reviews_label.use_markup = true;
 
119
            reviews_label.halign = Align.START;
 
120
            
 
121
            container.pack_start(new Image.from_stock(Stock.HELP, IconSize.DIALOG), false, false, 0);
 
122
            container.pack_start(reviews_label, false, false, 0);
 
123
            
 
124
            reviews_box.pack_start(container, false, false, 0);
 
125
            
100
126
            pack_start(box, true, true, 0);
 
127
            pack_start(reviews_box, false, false, 0);
 
128
            
 
129
            // Buttons box
 
130
            ButtonBox b_container = new ButtonBox(Orientation.HORIZONTAL);
 
131
            b_container.layout_style = ButtonBoxStyle.END;
 
132
            b_container.homogeneous = false;
 
133
            
 
134
            Button bt = new Button.with_label("Check for reviews");
 
135
            
 
136
            b_container.pack_start(bt, false, false, 0);
 
137
            b_container.pack_start(new Button.with_label("Install"), false, false, 0);
 
138
            b_container.foreach((child) => {
 
139
                b_container.set_child_non_homogeneous(child, true);
 
140
            });
 
141
            
 
142
            pack_start(b_container, false, false, 0);
101
143
        }
102
144
    }
103
 
}
 
 
b'\\ No newline at end of file'
 
145
}