/
CustomTitleBar.vala
52 lines (45 loc) · 1.66 KB
/
CustomTitleBar.vala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*-
* Copyright (c) 2011-2012 Scott Ringwelski <sgringwe@mtu.edu>
*
* Originally Written by Scott Ringwelski for Rdio Music Player
* Rdio Music Player: http://www.github.com/sgringwe/rdio
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
using Gtk;
public class Rdio.TopGradient : Gtk.EventBox {
Label placeholder;
public static CssProvider style_provider;
const string STYLESHEET = """
.rdio-custom-placeholder-bar {
background-image: -gtk-gradient (linear, left top, left bottom,
from (shade (@bg_color, 1.0)),
to (shade (#fff, 1.00)));
}
""";
public TopGradient () {
style_provider = new CssProvider();
try {
style_provider.load_from_data (STYLESHEET, -1);
} catch (Error e) {
warning("Couldn't load style provider.\n");
}
get_style_context().add_class("rdio-custom-placeholder-bar");
get_style_context().add_provider(style_provider, STYLE_PROVIDER_PRIORITY_APPLICATION);
placeholder = new Label ("");
add (placeholder);
}
}