~popey/+junk/akira

« back to all changes in this revision

Viewing changes to src/Layouts/LeftSideBar.vala

  • Committer: Alan Pope
  • Date: 2019-01-18 13:01:19 UTC
  • Revision ID: alan@popey.com-20190118130119-9opz65bdjx0zixz9
initial attempt to build a snap

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
 
3
*
 
4
* This program is free software; you can redistribute it and/or
 
5
* modify it under the terms of the GNU General Public
 
6
* License as published by the Free Software Foundation; either
 
7
* version 2 of the License, or (at your option) any later version.
 
8
*
 
9
* This program is distributed in the hope that it will be useful,
 
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
* General Public License for more details.
 
13
*
 
14
* You should have received a copy of the GNU General Public
 
15
* License along with this program; if not, write to the
 
16
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
* Boston, MA 02110-1301 USA
 
18
*
 
19
* Authored by: Alessandro "Alecaddd" Castellani <castellani.ale@gmail.com>
 
20
*/
 
21
public class Akira.Layouts.LeftSideBar : Gtk.Grid {
 
22
        public bool toggled {
 
23
                get {
 
24
                        return visible;
 
25
                } set {
 
26
                        visible = value;
 
27
                        no_show_all = !value;
 
28
                }
 
29
        }
 
30
 
 
31
        public LeftSideBar () {
 
32
                Object (
 
33
                        orientation: Gtk.Orientation.HORIZONTAL, 
 
34
                        toggled: true
 
35
                );
 
36
        }
 
37
 
 
38
        construct {
 
39
                get_style_context ().add_class ("sidebar-l");
 
40
                width_request = settings.left_paned;
 
41
                
 
42
                var label = new Gtk.Label ("Sidebar L");
 
43
                label.halign = Gtk.Align.CENTER;
 
44
                label.expand = true;
 
45
                label.margin = 10;
 
46
                label.expand = true;
 
47
 
 
48
                attach (label, 0, 0, 1, 1);
 
49
        }
 
50
 
 
51
        public void toggle () {
 
52
                toggled = !toggled;
 
53
        }
 
54
}
 
 
b'\\ No newline at end of file'