Rev 8952 | Rev 9594 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8952 | Rev 9481 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | inline fastcall replace_2cols(EDI, EDX, ESI, ECX, EBX, EAX) |
|
- | 2 | { |
|
- | 3 | EDX += EDI; //imgsrc + imgsize; |
|
- | 4 | WHILE (EDI < EDX) { |
|
- | 5 | IF (DSDWORD[EDI]==ESI) DSDWORD[EDI] = ECX; |
|
- | 6 | ELSE IF (DSDWORD[EDI]==EBX) DSDWORD[EDI] = EAX; |
|
- | 7 | EDI += 4; |
|
- | 8 | } |
|
- | 9 | } |
|
Line 1... | Line 10... | ||
1 | :unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n, bool pressed) |
10 | |
2 | { |
11 | :unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n, bool pressed) |
3 | #define TSZE 25 |
12 | { |
4 | static libimg_image top_icons; |
- | |
5 | static dword semi_white=0, bg_col_light, bg_col_dark; |
13 | #define TSZE 25 |
6 | int i; |
14 | static dword lightest, i16_mem, old_work_light; |
7 | if (!semi_white) { |
15 | dword i16_size; |
8 | top_icons.load("/sys/icons16.png"); |
16 | if (!lightest) || (old_work_light != sc.work_light) { |
9 | - | ||
10 | semi_white = MixColors(sc.work, 0xFFFfff, skin_is_dark()*90 + 96); |
17 | old_work_light = sc.work_light; |
11 | bg_col_dark = MixColors(sc.work, sc.work_graph, 90); |
18 | lightest = MixColors(sc.work_light, 0xFFFfff, skin_is_dark()*155 + 20); |
- | 19 | if (ESI = memopen("ICONS18", NULL, SHM_READ)) { |
|
12 | bg_col_light = MixColors(semi_white, 0xFFFfff, skin_is_dark()*90 + 10); |
20 | i16_size = EDX; |
13 | - | ||
14 | top_icons.replace_color(0xffFFFfff, semi_white); |
21 | i16_mem = malloc(i16_size); |
15 | top_icons.replace_color(0xffCACBD6, MixColors(semi_white, 0, 220)); |
22 | memmov(i16_mem, ESI, i16_size); |
16 | } |
23 | replace_2cols(i16_mem, i16_size, 0xffFFFfff, sc.work_light, 0xffCACBD6, sc.work_dark); |
17 | 24 | } |
|
18 | DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, semi_white); |
25 | } |
19 | - | ||
20 | DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id); |
26 | DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, sc.work_light); |
21 | if (_icon_n==-1) { |
27 | DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id); |
22 | DrawBar(_x+6, _y+5, 16, 16, semi_white); |
28 | if (_icon_n==-1) { |
23 | for (i=0; i<=2; i++) DrawBar(_x+6, i*5+_y+7, 15, 3, sc.work_graph); |
29 | DrawBar(_x+6, _y+5, 16, 16, sc.work_light); |
- | 30 | DrawBar(_x+6, _y+7, 15, 3, sc.work_graph); |
|
- | 31 | $add ecx,5*65536 |
|
- | 32 | $int 64 |
|
- | 33 | $add ecx,5*65536 |
|
24 | } else { |
34 | $int 64 |
25 | i = TSZE - top_icons.w / 2; //icon pos |
35 | } else { |
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); |
36 | if (i16_mem) PutPaletteImage(18*18*4*_icon_n + i16_mem, |
27 | } |
37 | 18, 18, TSZE/2-9+2+_x, TSZE/2-9+1+_y+pressed, 32, 0); |
Line 28... | Line 38... | ||
28 | 38 | } |
|
29 | if (!pressed) { |
39 | |
30 | DrawOvalBorder(_x, _y, TSZE, TSZE, bg_col_light, bg_col_dark, semi_white, sc.work); |
40 | if (!pressed) { |
31 | } else { |
41 | DrawOvalBorder(_x, _y, TSZE, TSZE, lightest, sc.work_graph, sc.work_light, sc.work); |
32 | DrawOvalBorder(_x, _y, TSZE, TSZE, sc.work_graph, bg_col_light, semi_white, sc.work); |
42 | } else { |
33 | PutShadow(_x+1, _y+1, TSZE, TSZE, true, 2); |
43 | DrawOvalBorder(_x, _y, TSZE, TSZE, sc.work_graph, sc.work_light, sc.work_dark, sc.work); |
Line 34... | Line 44... | ||
34 | } |
44 | PutShadow(_x+1, _y+1, TSZE, TSZE, true, 2); |
35 | 45 | } |
|
36 | return _x; |
46 |