Subversion Repositories Kolibri OS

Rev

Rev 7491 | Rev 7658 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7491 Rev 7647
Line 67... Line 67...
67
{
67
{
68
	dword tx = -strlen(text)*8+w/2+x;
68
	dword tx = -strlen(text)*8+w/2+x;
69
	dword ty = h/2-7+y;
69
	dword ty = h/2-7+y;
Line 70... Line 70...
70
 
70
 
71
	if (id>0) DefineButton(x,y,w,h,id,color_b);
71
	if (id>0) DefineButton(x,y,w,h,id,color_b);
72
	WriteText(tx+1,ty+1,0x90,MixColors(color_b,0,230),text);
72
	WriteText(tx+1,ty+1,0x90,LightenDarkenColor(color_b, -40),text);
73
	WriteText(tx,ty,0x90,color_t,text);
73
	WriteText(tx,ty,0x90,color_t,text);
Line 74... Line 74...
74
}
74
}
75
 
75
 
Line 82... Line 82...
82
	#define h padding_v + padding_v + 16 //16 font height
82
	#define h padding_v + padding_v + 16 //16 font height
83
	int tx = x + padding_h;
83
	int tx = x + padding_h;
84
	int ty = y + padding_v+1;
84
	int ty = y + padding_v+1;
85
	int tw = strlen(text)*8;
85
	int tw = strlen(text)*8;
86
	int w = tw + padding_h + padding_h;
86
	int w = tw + padding_h + padding_h;
-
 
87
	unsigned darker_color = LightenDarkenColor(system.color.work_button, -40);
Line 87... Line 88...
87
 
88
 
Line 88... Line 89...
88
 
89
 
89
	if (id>0) DefineButton(x,y,w,h,id,system.color.work_button);
90
	if (id>0) DefineButton(x,y,w,h,id,system.color.work_button);
Line 90... Line 91...
90
 
91
 
91
	WriteText(tx+1,ty+1,0x90,MixColors(system.color.work_button,0,230),text);
92
	WriteText(tx+1,ty+1,0x90,darker_color,text);
92
	WriteText(tx,ty,0x90,system.color.work_button_text,text);
93
	WriteText(tx,ty,0x90,system.color.work_button_text,text);
93
 
94
 
Line 94... Line 95...
94
	if (active_button_id==id) {
95
	if (active_button_id==id) {
95
		DrawBar(tx,ty+15,tw,1, MixColors(system.color.work_button,0,230));
96
		DrawBar(tx,ty+15,tw,1, darker_color);
Line -... Line 97...
-
 
97
		DrawBar(tx,ty+14,tw,1, system.color.work_button_text);
-
 
98
	}
-
 
99
 
-
 
100
	return w + right_margin;
-
 
101
}
-
 
102
 
-
 
103
:unsigned LightenDarkenColor(dword color, amt) {
96
		DrawBar(tx,ty+14,tw,1, system.color.work_button_text);
104
	dword r = color >> 16 + amt << 16;
97
	}
105
	dword b = color >> 8 & 0x00FF + amt << 8;
98
 
106
	dword g = color & 0x0000FF + amt;
99
	return w + right_margin;
107
	return g | b | r ;
100
}
108
}