/programs/cmm/lib/gui/menu.h |
---|
79,6 → 79,10 |
KillProcess(menu_process_id); |
} |
#define MENU_ALIGN_TOP_LEFT 0 |
#define MENU_ALIGN_TOP_RIGHT 1 |
#define MENU_ALIGN_BOT_LEFT 2 |
#define MENU_ALIGN_BOT_RIGHT 3 |
:dword shared_mem = NULL; |
:char shared_name[] = "LMENU"; |
85,23 → 89,24 |
:void open_lmenu(dword _x, _y, _position, _selected, _text) |
{ |
if (!shared_mem) { |
shared_mem = memopen(#shared_name, 20, SHM_CREATE); |
if (EDX) shared_mem = memopen(#shared_name, 20, SHM_WRITE); |
shared_mem = memopen(#shared_name, 16, SHM_CREATE + SHM_WRITE); |
if (EDX) shared_mem = memopen(#shared_name, 16, SHM_WRITE); |
} |
ESDWORD[shared_mem ] = _selected; |
ESDWORD[shared_mem + 4] = _x; |
ESDWORD[shared_mem + 8] = _y; |
ESDWORD[shared_mem + 12] = _position; |
ESDWORD[shared_mem + 16] = _selected; |
RunProgram("/sys/develop/menu", _text); |
menu_process_id = RunProgram("/sys/develop/menu", _text); |
} |
:dword get_menu_click() |
{ |
//dword res = ESDWORD[shared_mem]; |
char res[2]; |
ReadFile(0, 2, #res, "/tmp0/1/menu.tmp"); |
//ESDWORD[shared_mem] = 0; |
return res[0]; |
if (menu_process_id) && (GetProcessSlot(menu_process_id)) { |
return NULL; |
} else { |
menu_process_id = NULL; |
return ESDWORD[shared_mem]; |
} |
} |
#endif |
/programs/cmm/lib/gui.h |
---|
299,10 → 299,17 |
PutPixel(x+w+1, y+h, dark); |
} |
:bool is_the_skin_dark() |
:bool skin_is_dark() |
{ |
dword bg_col = system.color.work; |
if (GrayScaleImage(#bg_col,1,1)<65) { |
dword gray; |
dword color_image = #system.color.work; |
gray = DSBYTE[color_image]*DSBYTE[color_image]; |
gray += DSBYTE[color_image+1]*DSBYTE[color_image+1]; |
gray += DSBYTE[color_image+2]*DSBYTE[color_image+2]; |
gray = sqrt(gray) / 3; |
if (gray < 65) { |
return true; |
} else { |
return false; |
/programs/cmm/lib/patterns/toolbar_button.h |
---|
3,15 → 3,13 |
{ |
#define TSZE 25 |
static libimg_image top_icons; |
static dword semi_white=0, bg_col, bg_col_light, bg_col_dark, bg_dark; |
static dword semi_white=0, bg_col_light, bg_col_dark; |
if (!semi_white) { |
bg_col = system.color.work; |
if (GrayScaleImage(#bg_col,1,1)<65) bg_dark=true; else bg_dark=false; |
Libimg_LoadImage(#top_icons, "/sys/icons16.png"); |
semi_white = MixColors(system.color.work, 0xFFFfff, bg_dark*90 + 96); |
semi_white = MixColors(system.color.work, 0xFFFfff, skin_is_dark()*90 + 96); |
bg_col_dark = MixColors(system.color.work, system.color.work_graph, 90); |
bg_col_light = MixColors(semi_white, 0xFFFfff, bg_dark*90 + 10); |
bg_col_light = MixColors(semi_white, 0xFFFfff, skin_is_dark()*90 + 10); |
Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffFFFfff, semi_white); |
Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffCACBD6, MixColors(semi_white, 0, 220)); |