Subversion Repositories Kolibri OS

Rev

Rev 7977 | Rev 8952 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7977 Rev 8789
1
unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n, bool pressed)
1
unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n, bool pressed)
2
{
2
{
3
	#define TSZE 25
3
	#define TSZE 25
4
	static libimg_image top_icons;
4
	static libimg_image top_icons;
5
	static dword semi_white=0, bg_col_light, bg_col_dark;
5
	static dword semi_white=0, bg_col_light, bg_col_dark;
6
	int i;
6
	int i;
7
	if (!semi_white) {
7
	if (!semi_white) {
8
		top_icons.load("/sys/icons16.png");
8
		top_icons.load("/sys/icons16.png");
9
 
9
 
10
		semi_white = MixColors(sc.work, 0xFFFfff, skin_is_dark()*90 + 96);
10
		semi_white = MixColors(sc.work, 0xFFFfff, skin_is_dark()*90 + 96);
11
		bg_col_dark = MixColors(sc.work, sc.work_graph, 90);
11
		bg_col_dark = MixColors(sc.work, sc.work_graph, 90);
12
		bg_col_light = MixColors(semi_white, 0xFFFfff, skin_is_dark()*90 + 10);
12
		bg_col_light = MixColors(semi_white, 0xFFFfff, skin_is_dark()*90 + 10);
13
 
13
 
14
		top_icons.replace_color(0xffFFFfff, semi_white);
14
		top_icons.replace_color(0xffFFFfff, semi_white);
15
		top_icons.replace_color(0xffCACBD6, MixColors(semi_white, 0, 220));
15
		top_icons.replace_color(0xffCACBD6, MixColors(semi_white, 0, 220));
16
	}
16
	}
17
 
17
 
18
	DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, semi_white);
18
	DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, semi_white);
19
 
19
 
20
	DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id);
20
	DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id);
21
	if (_icon_n==-1) {
21
	if (_icon_n==-1) {
22
		DrawBar(_x+6, _y+5, 16, 16, semi_white);
22
		DrawBar(_x+6, _y+5, 16, 16, semi_white);
23
		for (i=0; i<=2; i++) DrawBar(_x+6, i*5+_y+7, 15, 3, sc.work_graph);
23
		for (i=0; i<=2; i++) DrawBar(_x+6, i*5+_y+7, 15, 3, sc.work_graph);
24
	} else {
24
	} else {
25
		img_draw stdcall(top_icons.image, _x+6, _y+5+pressed, 16, 16, 0, _icon_n*16);
25
		i = TSZE - top_icons.w / 2; //icon pos
-
 
26
		img_draw stdcall(top_icons.image, _x+i+2, _y+i+1+pressed, top_icons.w, top_icons.w, 0, _icon_n*top_icons.w);
26
	}
27
	}
27
 
28
 
28
	if (!pressed) {
29
	if (!pressed) {
29
		DrawOvalBorder(_x, _y, TSZE, TSZE, bg_col_light, bg_col_dark, semi_white, sc.work);
30
		DrawOvalBorder(_x, _y, TSZE, TSZE, bg_col_light, bg_col_dark, semi_white, sc.work);
30
	} else {
31
	} else {
31
		DrawOvalBorder(_x, _y, TSZE, TSZE, sc.work_graph, bg_col_light, semi_white, sc.work);
32
		DrawOvalBorder(_x, _y, TSZE, TSZE, sc.work_graph, bg_col_light, semi_white, sc.work);
32
		PutShadow(_x+1, _y+1, TSZE, TSZE, true, 2);
33
		PutShadow(_x+1, _y+1, TSZE, TSZE, true, 2);
33
	}
34
	}
34
 
35
 
35
	return _x;
36
	return _x;
36
}
37
}