~markellmtthw/beat-box/fix-920012

« back to all changes in this revision

Viewing changes to src/Views/AlbumView/AlbumListView.vala

  • Committer: sgringwe at gmail
  • Date: 2012-02-01 17:49:01 UTC
  • mfrom: (505.1.4 beat-box)
  • Revision ID: sgringwe@gmail.com-20120201174901-1bl290z1hwk8bvbk
merged new translations as well as victor's changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
using Gee;
24
24
using Gtk;
25
25
 
26
 
/* TODO: Make the entire window draggable */
27
 
 
28
26
public class BeatBox.AlbumListView : Window {
29
27
        LibraryManager lm;
30
28
 
34
32
        MusicTreeView mtv;
35
33
        bool setting_songs;
36
34
 
37
 
         private const string WIDGET_STYLESHEET = """
 
35
        private const string WIDGET_STYLESHEET = """
38
36
                .AlbumListDialogBase {
39
 
                        background-color: none;
40
37
                        background-image: -gtk-gradient (radial, center center, 0,
41
 
                                                                                         center center, 1,
42
 
                                                                                         from (shade (#404040, 1.0)),
43
 
                                                                                         to (shade (#232323, 1.0)));
 
38
                                             center center, 1,
 
39
                                                         from (#404040),
 
40
                                                         color-stop (0.9, alpha (shade (#454545, 1.1), 0.9)),
 
41
                                                         to (#404040));
44
42
                        border-width: 0;
45
43
                        border-style: none;
46
44
                        border-radius: 0;
47
45
                        padding: 0;
48
46
                }
49
47
 
50
 
                *, .label {
51
 
                        color: #ffffff;
 
48
                * {
 
49
                        color: @selected_fg_color;
52
50
                }
53
51
 
54
52
                GtkTreeView {
55
 
                        color: #ffffff;
56
 
                        background-color: #3a3a3a;
 
53
                        background-color: shade (#414141, 1.01);
57
54
                }
58
55
 
59
56
                GtkTreeView row {
60
57
                        border-width: 0;
61
 
                        border-style: none;
62
58
                        border-radius: 0;
63
59
                        padding: 0;
64
60
                }
65
61
 
 
62
                GtkTreeView row:nth-child(even) {
 
63
                        background-color: shade (#3b3b3b, 0.97);
 
64
                }
 
65
 
66
66
                GtkTreeView row:selected {
67
67
                                background-image: -gtk-gradient (linear,
68
 
                                        left top,
69
 
                                        left bottom,
70
 
                                        from (shade (@selected_bg_color, 1.30)),
71
 
                                        to (shade (@selected_bg_color, 0.98)));
72
 
                }
73
 
 
74
 
                GtkTreeView row:nth-child(even) {
75
 
                        background-color: #3a3a3a;
76
 
                }
77
 
 
78
 
                GtkTreeView row:nth-child(odd) {
79
 
                        background-color: #4D4D4D;
80
 
                }
81
 
 
82
 
                .AlbumListDialogClose {
83
 
                        background-image: -gtk-gradient (linear,
84
 
                                left top,
85
 
                                left bottom,
86
 
                                from (shade (@bg_color, 1.15)),
87
 
                                to (shade (@bg_color, 1.03)));
88
 
 
89
 
                        -unico-border-gradient: -gtk-gradient (linear,
90
 
                                left top, left bottom,
91
 
                                from (shade (@bg_color, 0.78)),
92
 
                                to (shade (@bg_color, 0.60)));
93
 
                }
94
 
         """;
 
68
                                                         left top,
 
69
                                                                     left bottom,
 
70
                                                                     from (shade (@selected_bg_color, 1.30)),
 
71
                                                                     to (shade (@selected_bg_color, 0.98)));
 
72
                }
 
73
 
 
74
                .AlbumListDialogClose:hover {
 
75
                        background-image: -gtk-gradient (linear,
 
76
                                                         left top,
 
77
                                                         left bottom,
 
78
                                                         from (shade (#454545, 1.15)),
 
79
                                                         to (shade (#454545, 1.03)));
 
80
 
 
81
                        -unico-border-gradient: -gtk-gradient (linear,
 
82
                                                               left top, left bottom,
 
83
                                                               from (shade (#454545, 0.78)),
 
84
                                                               to (shade (#454545, 0.60)));
 
85
                }
 
86
 
 
87
                .button:active,
 
88
                .button:active:hover {
 
89
                        background-image: -gtk-gradient (linear,
 
90
                                                         left top,
 
91
                                                         left bottom,
 
92
                                                         from (shade (#404040, 0.95)),
 
93
                                                         to (shade (#404040, 1.13)));
 
94
 
 
95
                        -unico-border-gradient: -gtk-gradient (linear,
 
96
                                                               left top, left bottom,
 
97
                                                               from (shade (#404040, 0.78)),
 
98
                                                               to (shade (#454545, 0.60)));
 
99
                }
 
100
        """;
95
101
 
96
102
        public AlbumListView(LibraryManager lm) {
97
103
                this.lm = lm;
98
104
 
99
105
                set_transient_for(lm.lw);
100
106
                window_position = Gtk.WindowPosition.CENTER_ON_PARENT;
101
 
                //set_keep_above(true);
102
107
                set_decorated(false);
103
108
                set_has_resize_grip(false);
104
109
                set_resizable(false);
114
119
                try  {
115
120
                        style_provider.load_from_data (WIDGET_STYLESHEET, -1);
116
121
                } catch (Error e) {
117
 
                        stderr.printf ("\nAlbumListView: Couldn't load style provider.\n");
 
122
                        warning ("AlbumListView: %s", e.message);
118
123
                }
119
124
 
120
125
                get_style_context().add_class("AlbumListDialogBase");
123
128
                // add close button
124
129
                var close = new Gtk.Button ();
125
130
                close.set_image (Icons.render_image ("gtk-close", Gtk.IconSize.MENU));
126
 
                close.get_style_context().add_class("AlbumListDialogClose");
127
131
                close.hexpand = close.vexpand = false;
128
132
                close.halign = Gtk.Align.START;
129
133
                close.set_relief(Gtk.ReliefStyle.NONE);