~voluntatefaber/slingshot/keyboard-support

« back to all changes in this revision

Viewing changes to src/Widgets/Sidebar.vala

  • Committer: Andrea Basso
  • Date: 2012-06-12 15:38:54 UTC
  • Revision ID: voluntatefaber@gmail.com-20120612153854-l47lf1i240ef621c
No more useless "Category" header

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
        private int cat_size {
31
31
            get {
32
 
                return store.iter_n_children (category_iter);
 
32
                return store.iter_n_children (null);
33
33
            }
34
34
        }
35
35
        
71
71
            cell.wrap_width = 110;
72
72
            cell.xpad = 17;
73
73
 
74
 
            insert_column_with_attributes (-1, "Filters", cell, "markup", Columns.TEXT);;
75
 
 
76
 
            store.append (out category_iter, null);
77
 
            store.set (category_iter, Columns.TEXT, _("<b>Categories</b>"));
 
74
            insert_column_with_attributes (-1, "Filters", cell, "markup", Columns.TEXT);
78
75
 
79
76
            get_selection ().set_mode (SelectionMode.SINGLE);
80
77
            get_selection ().changed.connect (selection_change);
83
80
 
84
81
        public void add_category (string entry_name) {
85
82
 
86
 
            store.append (out entry_iter, category_iter);
 
83
            store.append (out entry_iter, null);
87
84
            store.set (entry_iter, Columns.INT, cat_size - 1, Columns.TEXT, entry_name, -1);
88
85
            
89
86
            expand_all ();
99
96
 
100
97
            if (get_selection ().get_selected (out model, out sel_iter)) {
101
98
                store.get (sel_iter, Columns.INT, out nth, Columns.TEXT, out name);
102
 
                /** 
103
 
                 * Check if sel_iter is category or bookmark entry.
104
 
                 * If it is, select the previous selected entry.
105
 
                 */
106
 
                if (sel_iter == category_iter) {
107
 
                    selected = _selected;
108
 
                } else {
109
 
                    _selected = nth;
110
 
                    selection_changed (name, nth);
111
 
                }
 
99
                _selected = nth;
 
100
                selection_changed (name, nth);
112
101
            }
113
102
 
114
103
        }
118
107
            TreeIter iter;
119
108
 
120
109
            if (nth < cat_size)
121
 
                store.iter_nth_child (out iter, category_iter, nth);
 
110
                store.iter_nth_child (out iter, null, nth);
122
111
            else
123
112
                return false;
124
113
 
128
117
        }
129
118
 
130
119
        protected override bool scroll_event (Gdk.EventScroll event) {
131
 
 
 
120
        
132
121
            switch (event.direction.to_string ()) {
133
122
                case "GDK_SCROLL_UP":
134
123
                case "GDK_SCROLL_LEFT":