forked from notsecure/uTox
-
Notifications
You must be signed in to change notification settings - Fork 1
/
theme.c
174 lines (160 loc) · 9.25 KB
/
theme.c
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#include "main.h"
#define COLOR_PROC(a_ulColor) RGB((a_ulColor >> 16) & 0x0000FF, (a_ulColor >> 8) & 0x0000FF, a_ulColor & 0x0000FF)
void theme_load(char loadtheme)
{
// Update the settings dropdown UI
dropdown_theme.selected = loadtheme;
// ==== Default theme ====
//---- Main chat area ----
COLOR_MAIN_BACKGROUND = COLOR_PROC(0xFFFFFF);
COLOR_MAIN_TEXT = COLOR_PROC(0x333333);
COLOR_MAIN_CHATTEXT = COLOR_PROC(0x000000);
COLOR_MAIN_SUBTEXT = COLOR_PROC(0x414141);
COLOR_MAIN_ACTIONTEXT = COLOR_PROC(0x4e4ec8);
COLOR_MAIN_QUOTETEXT = COLOR_PROC(0x008000);
COLOR_MAIN_URLTEXT = COLOR_PROC(0x0000ff);
COLOR_MAIN_HINTTEXT = COLOR_PROC(0x969696);
//---- Top & bottom menu colours ----
COLOR_MENU_BACKGROUND = COLOR_PROC(0x1c1c1c);
COLOR_MENU_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_MENU_HOVER_BACKGROUND = COLOR_PROC(0x282828);
COLOR_MENU_ACTIVE_BACKGROUND = COLOR_PROC(0x414141);
COLOR_MENU_ACTIVE_TEXT = COLOR_MAIN_BACKGROUND;
//---- Friend list ----
COLOR_LIST_BACKGROUND = COLOR_PROC(0x414141);
COLOR_LIST_HOVER_BACKGROUND = COLOR_PROC(0x505050);
COLOR_LIST_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_LIST_SUBTEXT = COLOR_PROC(0xBaBaBa);
//---- Text selection ----
COLOR_SELECTION_BACKGROUND = COLOR_MAIN_TEXT;
COLOR_SELECTION_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_GROUP_UNUSUAL = COLOR_MAIN_URLTEXT;
//---- Inputs, dropdowns & tooltips ----
COLOR_EDGE_NORMAL = COLOR_PROC(0xC0C0C0);
COLOR_EDGE_HOVER = COLOR_PROC(0x969696);
COLOR_EDGE_ACTIVE = COLOR_PROC(0x4ea6ea);
COLOR_ACTIVEOPTION_BACKGROUND = COLOR_PROC(0xd1d1d1);
COLOR_ACTIVEOPTION_TEXT = COLOR_MAIN_TEXT;
//---- Status circles ----
COLOR_STATUS_ONLINE = COLOR_PROC(0x6bc260);
COLOR_STATUS_AWAY = COLOR_PROC(0xcebf45);
COLOR_STATUS_BUSY = COLOR_PROC(0xc84e4e);
//---- Buttons ---
COLOR_BUTTON_SUCCESS_BACKGROUND = COLOR_STATUS_ONLINE;
COLOR_BUTTON_SUCCESS_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_SUCCESS_HOVER_BACKGROUND = COLOR_PROC(0x76d56a);
COLOR_BUTTON_SUCCESS_HOVER_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_WARNING_BACKGROUND = COLOR_STATUS_AWAY;
COLOR_BUTTON_WARNING_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_WARNING_HOVER_BACKGROUND = COLOR_PROC(0xe3d24c);
COLOR_BUTTON_WARNING_HOVER_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_DANGER_BACKGROUND = COLOR_STATUS_BUSY;
COLOR_BUTTON_DANGER_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_DANGER_HOVER_BACKGROUND = COLOR_PROC(0xdc5656);
COLOR_BUTTON_DANGER_HOVER_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_DISABLED_BACKGROUND = COLOR_PROC(0xd1d1d1);
COLOR_BUTTON_DISABLED_TEXT = COLOR_MAIN_BACKGROUND;
switch (loadtheme) {
case THEME_DARK:
COLOR_MAIN_BACKGROUND = COLOR_PROC(0x333333);
COLOR_MAIN_TEXT = COLOR_PROC(0xdfdfdf);
COLOR_MAIN_CHATTEXT = COLOR_PROC(0xFFFFFF);
COLOR_MAIN_SUBTEXT = COLOR_PROC(0xbbbbbb);
COLOR_MAIN_ACTIONTEXT = COLOR_PROC(0x27a9bc);
COLOR_MAIN_URLTEXT = COLOR_MAIN_ACTIONTEXT;
COLOR_MAIN_QUOTETEXT = COLOR_PROC(0x55b317);
COLOR_LIST_BACKGROUND = COLOR_PROC(0x222222);
COLOR_LIST_HOVER_BACKGROUND = COLOR_PROC(0x151515);
COLOR_MENU_BACKGROUND = COLOR_LIST_BACKGROUND;
COLOR_MENU_HOVER_BACKGROUND = COLOR_LIST_HOVER_BACKGROUND;
COLOR_MENU_ACTIVE_BACKGROUND = COLOR_MAIN_TEXT;
COLOR_SELECTION_BACKGROUND = COLOR_MAIN_TEXT;
COLOR_SELECTION_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_GROUP_UNUSUAL = COLOR_MAIN_URLTEXT;
COLOR_EDGE_NORMAL = COLOR_PROC(0x555555);
COLOR_EDGE_ACTIVE = COLOR_PROC(0x228888);
COLOR_EDGE_HOVER = COLOR_PROC(0x999999);
COLOR_ACTIVEOPTION_BACKGROUND = COLOR_PROC(0x228888);
COLOR_ACTIVEOPTION_TEXT = COLOR_MAIN_TEXT;
COLOR_MENU_ACTIVE_TEXT = COLOR_PROC(0x151515);
COLOR_BUTTON_SUCCESS_BACKGROUND = COLOR_PROC(0x414141);
COLOR_BUTTON_SUCCESS_TEXT = COLOR_PROC(0x33a63d);
COLOR_BUTTON_SUCCESS_HOVER_BACKGROUND = COLOR_PROC(0x455147);
COLOR_BUTTON_SUCCESS_HOVER_TEXT = COLOR_PROC(0x6eff3a);
COLOR_BUTTON_WARNING_BACKGROUND = COLOR_PROC(0x414141);
COLOR_BUTTON_WARNING_TEXT = COLOR_PROC(0xbd9e22);
COLOR_BUTTON_WARNING_HOVER_BACKGROUND = COLOR_PROC(0x4c493c);
COLOR_BUTTON_WARNING_HOVER_TEXT = COLOR_PROC(0xff8d2a);
COLOR_BUTTON_DANGER_BACKGROUND = COLOR_PROC(0x414141);
COLOR_BUTTON_DANGER_TEXT = COLOR_PROC(0xbd2525);
COLOR_BUTTON_DANGER_HOVER_BACKGROUND = COLOR_PROC(0x513939);
COLOR_BUTTON_DANGER_HOVER_TEXT = COLOR_PROC(0xfa2626);
COLOR_BUTTON_DISABLED_BACKGROUND = COLOR_PROC(0x414141);
COLOR_BUTTON_DISABLED_TEXT = COLOR_MAIN_BACKGROUND;
break;
case THEME_LIGHT:
COLOR_LIST_BACKGROUND = COLOR_PROC(0xF0F0F0);
COLOR_LIST_HOVER_BACKGROUND = COLOR_PROC(0xE0E0E0);
COLOR_LIST_TEXT = COLOR_MAIN_TEXT;
COLOR_LIST_SUBTEXT = COLOR_MAIN_SUBTEXT;
COLOR_MENU_BACKGROUND = COLOR_PROC(0xF0F0F0);
COLOR_MENU_HOVER_BACKGROUND = COLOR_PROC(0xE0E0E0);
COLOR_MENU_ACTIVE_BACKGROUND = COLOR_PROC(0x555555);
COLOR_MENU_TEXT = COLOR_PROC(0x555555);
COLOR_MENU_ACTIVE_TEXT = COLOR_PROC(0xffffff);
COLOR_EDGE_NORMAL = COLOR_PROC(0xC0C0C0);
COLOR_EDGE_ACTIVE = COLOR_MAIN_URLTEXT;
COLOR_EDGE_HOVER = COLOR_PROC(0x707070);
COLOR_ACTIVEOPTION_BACKGROUND = COLOR_PROC(0xDDEEFF);
COLOR_ACTIVEOPTION_TEXT = COLOR_MAIN_TEXT;
break;
case THEME_HIGHCONTRAST:
COLOR_MAIN_BACKGROUND = COLOR_PROC(0xFFFFFF);
COLOR_MAIN_TEXT = COLOR_PROC(0x000001);
COLOR_MAIN_CHATTEXT = COLOR_MAIN_TEXT;
COLOR_MAIN_SUBTEXT = COLOR_MAIN_TEXT;
COLOR_MAIN_ACTIONTEXT = COLOR_PROC(0x000033);
COLOR_MAIN_QUOTETEXT = COLOR_PROC(0x003300);
COLOR_MAIN_URLTEXT = COLOR_MAIN_ACTIONTEXT;
COLOR_MAIN_HINTTEXT = COLOR_MAIN_TEXT;
COLOR_MENU_BACKGROUND = COLOR_MAIN_BACKGROUND;
COLOR_MENU_TEXT = COLOR_MAIN_TEXT;
COLOR_MENU_HOVER_BACKGROUND = COLOR_MAIN_BACKGROUND;
COLOR_MENU_ACTIVE_BACKGROUND = COLOR_MAIN_TEXT;
COLOR_MENU_ACTIVE_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_LIST_BACKGROUND = COLOR_PROC(0x444444);
COLOR_LIST_HOVER_BACKGROUND = COLOR_MAIN_TEXT;
COLOR_LIST_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_LIST_SUBTEXT = COLOR_MAIN_BACKGROUND;
COLOR_SELECTION_BACKGROUND = COLOR_MAIN_TEXT;
COLOR_SELECTION_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_GROUP_UNUSUAL = COLOR_MAIN_URLTEXT;
COLOR_EDGE_NORMAL = COLOR_MAIN_TEXT;
COLOR_EDGE_ACTIVE = COLOR_MAIN_TEXT;
COLOR_EDGE_HOVER = COLOR_MAIN_TEXT;
COLOR_ACTIVEOPTION_BACKGROUND = COLOR_MAIN_TEXT;
COLOR_ACTIVEOPTION_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_STATUS_ONLINE = COLOR_PROC(0x00ff00);
COLOR_STATUS_AWAY = COLOR_PROC(0xffff00);
COLOR_STATUS_BUSY = COLOR_PROC(0xff0000);
COLOR_BUTTON_SUCCESS_BACKGROUND = COLOR_PROC(0x00ff00);
COLOR_BUTTON_SUCCESS_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_SUCCESS_HOVER_BACKGROUND = COLOR_PROC(0x00ff00);
COLOR_BUTTON_SUCCESS_HOVER_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_WARNING_BACKGROUND = COLOR_PROC(0xffff00);
COLOR_BUTTON_WARNING_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_WARNING_HOVER_BACKGROUND = COLOR_PROC(0xffff00);
COLOR_BUTTON_WARNING_HOVER_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_DANGER_BACKGROUND = COLOR_PROC(0xff0000);
COLOR_BUTTON_DANGER_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_DANGER_HOVER_BACKGROUND = COLOR_PROC(0xff0000);
COLOR_BUTTON_DANGER_HOVER_TEXT = COLOR_MAIN_BACKGROUND;
COLOR_BUTTON_DISABLED_BACKGROUND = COLOR_PROC(0x444444);
COLOR_BUTTON_DISABLED_TEXT = COLOR_MAIN_TEXT;
break;
}
status_color[0] = COLOR_STATUS_ONLINE;
status_color[1] = COLOR_STATUS_AWAY;
status_color[2] = COLOR_STATUS_BUSY;
status_color[3] = COLOR_STATUS_BUSY;
}