-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSS.py
130 lines (107 loc) · 1.84 KB
/
CSS.py
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject, GLib, Gdk
# For ideas and instruction
# https://thegnomejournal.wordpress.com/2011/03/15/styling-gtk-with-css/
def mainStyle():
css = b"""
label
{
color: #002EB3;
background-color: #A8A8A8;
}
box, grid {
color: #002EB3;
background-color: #A8A8A8;
}
button
{
background-image: none;
color: #AA00AA;
background-color: #A8A8A8;
}
treeview
{
background-color: #A0A0A0;
}
treeview:selected
{
background-color: rgba(255,255,0,1.0);
color: rgba(0,0,255,1.0);
}
/*
* {
background-image: none;
background-color: #2998EA;
font: 12px Cantarell;
}
GtkButton,
GtkButton .label {
color: #202020;
background-color: #D8D8D8;
}
GtkButton:hover, GtkLabel:hover
{
background-color: #E7E7E7;
}
GtkLabel {
color: #002EB3;
background-color: #A8A8A8;
}
GtkBox, GtkGrid {
color: #002EB3;
background-color: #A8A8A8;
}
GtkTreeView row:selected {
background-color: #49B8FA;
}
*/
/*
scrolledwindow treeview {
background: #777777;
}
*/
/*
GtkTreeView row{
}
button:first-child {
border-radius: 5px 0 0 5px;
}
button:last-child {
border-radius: 0 5px 5px 0;
border-width: 2px;
}
button:hover {
background-color: #2b5c38;
}
button *:hover {
color: white;
}
button:hover:active,
button:active {
background-color: #993401;
}
label {
color: #569E52;
background-color: #C8C8C8;
}
label:hover {
background-color: #993401;
}
*/
/*
GtkTreeView row:nth-child(odd) {
background-color: #FF00FF;
}
GtkTreeView row:nth-child(even) {
background-color: #00FF00;
}
*/
"""
style_provider = Gtk.CssProvider()
style_provider.load_from_data(css)
Gtk.StyleContext.add_provider_for_screen(
Gdk.Screen.get_default(),
style_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
)