2020-04-04 01:17:28 +02:00
|
|
|
|
2021-06-28 00:16:37 +02:00
|
|
|
:unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n, bool pressed)
|
2020-04-04 01:17:28 +02:00
|
|
|
{
|
|
|
|
#define TSZE 25
|
|
|
|
static libimg_image top_icons;
|
2020-04-13 13:51:56 +02:00
|
|
|
static dword semi_white=0, bg_col_light, bg_col_dark;
|
2020-05-05 03:16:36 +02:00
|
|
|
int i;
|
2020-04-04 01:17:28 +02:00
|
|
|
if (!semi_white) {
|
2020-05-24 18:46:26 +02:00
|
|
|
top_icons.load("/sys/icons16.png");
|
2020-04-04 01:17:28 +02:00
|
|
|
|
2020-04-18 01:52:24 +02:00
|
|
|
semi_white = MixColors(sc.work, 0xFFFfff, skin_is_dark()*90 + 96);
|
|
|
|
bg_col_dark = MixColors(sc.work, sc.work_graph, 90);
|
2020-04-13 13:51:56 +02:00
|
|
|
bg_col_light = MixColors(semi_white, 0xFFFfff, skin_is_dark()*90 + 10);
|
2020-04-04 01:17:28 +02:00
|
|
|
|
2020-05-24 18:46:26 +02:00
|
|
|
top_icons.replace_color(0xffFFFfff, semi_white);
|
|
|
|
top_icons.replace_color(0xffCACBD6, MixColors(semi_white, 0, 220));
|
2020-04-04 01:17:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, semi_white);
|
|
|
|
|
|
|
|
DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id);
|
|
|
|
if (_icon_n==-1) {
|
|
|
|
DrawBar(_x+6, _y+5, 16, 16, semi_white);
|
2020-05-05 03:16:36 +02:00
|
|
|
for (i=0; i<=2; i++) DrawBar(_x+6, i*5+_y+7, 15, 3, sc.work_graph);
|
2020-04-04 01:17:28 +02:00
|
|
|
} else {
|
2021-06-10 13:18:19 +02:00
|
|
|
i = TSZE - top_icons.w / 2; //icon pos
|
|
|
|
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);
|
2020-04-04 01:17:28 +02:00
|
|
|
}
|
2020-05-11 09:32:44 +02:00
|
|
|
|
|
|
|
if (!pressed) {
|
|
|
|
DrawOvalBorder(_x, _y, TSZE, TSZE, bg_col_light, bg_col_dark, semi_white, sc.work);
|
|
|
|
} else {
|
|
|
|
DrawOvalBorder(_x, _y, TSZE, TSZE, sc.work_graph, bg_col_light, semi_white, sc.work);
|
|
|
|
PutShadow(_x+1, _y+1, TSZE, TSZE, true, 2);
|
|
|
|
}
|
|
|
|
|
2020-05-05 03:16:36 +02:00
|
|
|
return _x;
|
2020-04-04 01:17:28 +02:00
|
|
|
}
|