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

« back to all changes in this revision

Viewing changes to src/Widgets/LscCategories.vala

  • Committer: Stephen Smally
  • Date: 2012-03-04 12:59:13 UTC
  • Revision ID: eco.stefi@fastwebnet.it-20120304125913-bk1iutifwoeoyo0i
Worked a lot!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//  Stephen Smally © 2012
2
 
//      This program is free software; you can redistribute it and/or modify
3
 
//      it under the terms of the GNU General Public License as published by
4
 
//      the Free Software Foundation; either version 2 of the License, or
5
 
//      (at your option) any later version.
6
 
//      
7
 
//      This program is distributed in the hope that it will be useful,
8
 
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 
//      GNU General Public License for more details.
11
 
//      
12
 
//      You should have received a copy of the GNU General Public License
13
 
//      along with this program; if not, write to the Free Software
14
 
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
15
 
//      MA 02110-1301, USA.
16
 
//      
17
 
 
18
 
using Gtk;
19
 
using Lsc.Backend;
20
 
 
21
 
namespace Lsc.Widgets {
22
 
    public class LscCategoryButton : Button {
23
 
        public string id { get; private set; }
24
 
        public string cat_name { get; private set; }
25
 
        public string comment { get; private set; }
26
 
        public string icon_name { get; private set; }
27
 
        
28
 
        public LscCategoryButton (LscCategory to_implement) {
29
 
            cat_name = to_implement.name;
30
 
            comment = to_implement.comment;
31
 
            icon_name = to_implement.icon;
32
 
            id = to_implement.id;
33
 
            
34
 
            Box main_container = new Box(Orientation.HORIZONTAL, 5);
35
 
            Image image = new Image.from_icon_name(icon_name, IconSize.DIALOG);
36
 
            Label label = new Label(cat_name+"\n<i>"+comment+"</i>");
37
 
            
38
 
            main_container.pack_start(image, false, false, 0);
39
 
            main_container.pack_start(label, true, true, 0);
40
 
            
41
 
            add(main_container);
42
 
        }
43
 
    }
44
 
    
45
 
    public class LscCategoriesGrid : Box {
46
 
    }
47
 
}
 
 
b'\\ No newline at end of file'