8
public class AppsInfo : Box {
9
private Separator separator;
11
private Label pkg_name;
12
private Label short_description;
13
private Label description;
15
private Label version;
18
public void set_details (Package pkg, Details details) {
19
pkg_name.label = "<big><b>"+nicer_pkg_name(pkg.get_name())+"</b></big>";
20
short_description.label = "<i>"+pkg.get_summary()+"</i>";
22
description.label = details.description;
24
id.label = "<b>Id:</b> "+pkg.get_name();
25
version.label = "<b>Version:</b> "+pkg.get_version();
26
size.label = "<b>Size:</b> "+details.size.to_string();
29
public void pack_separator () {
30
separator = new Separator(Orientation.HORIZONTAL);
31
separator.margin_left = 1;
32
separator.margin_right = 1;
33
box.pack_start(separator, false, false, 0);
37
orientation = Orientation.VERTICAL;
42
box = new RoundBox(Orientation.VERTICAL, 0);
45
// Summary Box (icon, name/short_description and install button)
46
Box summary_box = new Box(Orientation.HORIZONTAL, 3);
47
Box label_box = new Box(Orientation.VERTICAL, 0);
48
label_box.valign = Align.CENTER;
49
summary_box.border_width = 5;
50
summary_box.pack_start(new Image.from_stock(Stock.INFO, IconSize.DIALOG), false, false, 0);
52
pkg_name = new Label("<big><b>Application name</b></big>");
53
pkg_name.use_markup = true;
54
pkg_name.halign = Align.START;
56
short_description = new Label("<i>Application description</i>");
57
short_description.use_markup = true;
58
short_description.halign = Align.START;
60
label_box.pack_start(pkg_name, false, false, 0);
61
label_box.pack_start(short_description, false, false, 0);
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);
69
Box description_box = new Box(Orientation.VERTICAL, 0);
70
description_box.border_width = 10;
71
description = new Label("Package description");
72
description.wrap_mode = Pango.WrapMode.WORD_CHAR;
73
description.wrap = true;
74
description.halign = Align.CENTER;
75
description_box.pack_start(description, false, false, 0);
77
// Details (version and size)
78
Box details_box = new Box(Orientation.VERTICAL, 0);
79
details_box.border_width = 10;
80
version = new Label("<b>Version:</b>");
81
version.use_markup = true;
82
version.halign = Align.START;
83
size = new Label("<b>Size:</b>");
84
size.use_markup = true;
85
size.halign = Align.START;
86
id = new Label("<b>Id:</b>");
88
id.halign = Align.START;
89
details_box.pack_start(id, false, false, 0);
90
details_box.pack_start(version, false, false, 0);
91
details_box.pack_start(size, false, false, 0);
94
box.pack_start(summary_box, false, false, 0);
96
box.pack_start(description_box, true, true, 0);
98
box.pack_start(details_box, false, false, 0);
100
pack_start(box, true, true, 0);
b'\\ No newline at end of file'