Subversion Repositories Kolibri OS

Rev

Rev 9594 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9594 Rev 9602
Line 12... Line 12...
12
:unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n, bool pressed)
12
:unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n, bool pressed)
13
{
13
{
14
	#define TSZE 25
14
	#define TSZE 25
15
	static dword lightest, i16_mem, old_work_light;
15
	static dword lightest, i16_mem, old_work_light;
16
	dword i16_size;
16
	dword i16_size;
17
	if (!lightest) || (old_work_light != sc.work_light) {
17
	if (!lightest) || (old_work_light != sc.light) {
18
		old_work_light = sc.work_light;
18
		old_work_light = sc.light;
19
		lightest = MixColors(sc.work_light, 0xFFFfff, skin_is_dark()*155 + 20);
19
		lightest = MixColors(sc.light, 0xFFFfff, skin_is_dark()*155 + 20);
20
		if (ESI = memopen("ICONS18", NULL, SHM_READ)) {
20
		if (ESI = memopen("ICONS18", NULL, SHM_READ)) {
21
			i16_size = EDX;
21
			i16_size = EDX;
22
			i16_mem = malloc(i16_size);
22
			i16_mem = malloc(i16_size);
23
			memmov(i16_mem, ESI, i16_size);
23
			memmov(i16_mem, ESI, i16_size);
24
			replace_2cols(i16_mem, i16_size, 0xffFFFfff, sc.work_light, 0xffCACBD6, sc.work_dark);			
24
			replace_2cols(i16_mem, i16_size, 0xffFFFfff, sc.light, 0xffCACBD6, sc.dark);			
25
		}
25
		}
26
	}
26
	}
27
	DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, sc.work_light);
27
	DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, sc.light);
28
	DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id);
28
	DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id);
29
	if (_icon_n==-1) {
29
	if (_icon_n==-1) {
30
		DrawBar(_x+6, _y+5, 16, 16, sc.work_light);
30
		DrawBar(_x+6, _y+5, 16, 16, sc.light);
31
		DrawBar(_x+6, _y+7, 15, 3, sc.work_graph);
31
		DrawBar(_x+6, _y+7, 15, 3, sc.line);
32
		$add ecx,5*65536
32
		$add ecx,5*65536
33
		$int 64
33
		$int 64
34
		$add ecx,5*65536
34
		$add ecx,5*65536
35
		$int 64
35
		$int 64
36
	} else {
36
	} else {
37
		if (i16_mem) PutPaletteImage(18*18*4*_icon_n + i16_mem, 
37
		if (i16_mem) PutPaletteImage(18*18*4*_icon_n + i16_mem, 
38
			18, 18, TSZE/2-9+2+_x, TSZE/2-9+1+_y+pressed, 32, 0);
38
			18, 18, TSZE/2-9+2+_x, TSZE/2-9+1+_y+pressed, 32, 0);
39
	}
39
	}
Line 40... Line 40...
40
 
40
 
41
	if (!pressed) {
41
	if (!pressed) {
42
		DrawOvalBorder(_x, _y, TSZE, TSZE, lightest, sc.work_graph, sc.work_light, sc.work);
42
		DrawOvalBorder(_x, _y, TSZE, TSZE, lightest, sc.line, sc.light, sc.work);
43
	} else {
43
	} else {
44
		DrawOvalBorder(_x, _y, TSZE, TSZE, sc.work_graph, sc.work_light, sc.work_dark, sc.work);
44
		DrawOvalBorder(_x, _y, TSZE, TSZE, sc.line, sc.light, sc.dark, sc.work);
45
		PutShadow(_x+1, _y+1, TSZE, TSZE, true, 2);
45
		PutShadow(_x+1, _y+1, TSZE, TSZE, true, 2);
Line 46... Line 46...
46
	}
46
	}
47
 
47
 
48
	return _x;
48
	return _x;