From a25c686ab7707e5c536dd93bdafa2c12a83fe379 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 7 Jun 2021 21:45:46 +0000 Subject: [PATCH] unz: fix password field position eolite: a bit faster open git-svn-id: svn://kolibrios.org@8780 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 37 +++++++++++++++++--------- programs/cmm/eolite/include/menu.h | 16 +++++------ programs/cmm/eolite/include/settings.h | 33 ++++++++++++++--------- programs/cmm/lib/obj/libimg.h | 18 ++++++++++++- programs/fs/unz/unz.asm | 9 ++++--- 5 files changed, 75 insertions(+), 38 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 90e6ad0a9d..0ff0457f69 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -225,9 +225,13 @@ void main() load_libraries(); SetAppColors(); + ESBYTE[0] = NULL; + handle_param(); rand_n = random(80); + ESBYTE[0] = NULL; + SystemDiscs.Get(); Open_Dir(#path,ONLY_OPEN); @@ -531,7 +535,7 @@ void main() DrawStatusBar(); List_ReDraw(); break; - case SCAN_CODE_F2...SCAN_CODE_F10: + case SCAN_CODE_F1...SCAN_CODE_F10: FnProcess(key_scancode-58); break; default: @@ -1122,27 +1126,31 @@ void NewElement_Form(byte crt, dword strng) DrawEditBox(#new_file_ed); } +void EventShowAbout() +{ + if (!active_about) { + about_stak = malloc(4096); + about_thread_id = CreateThread(#about_dialog,about_stak+4092); + } else { + ActivateWindow(GetProcessSlot(about_thread_id)); + } +} + void FnProcess(byte N) { switch(N) { case 1: - if (!active_about) { - about_stak = malloc(4096); - about_thread_id = CreateThread(#about_dialog,about_stak+4092); - break; - } else { - ActivateWindow(GetProcessSlot(about_thread_id)); - } + EventShowProperties(); break; case 2: if (files.count) NewElement_Form(RENAME_ITEM, #file_name); break; case 3: - if (files.count) && (!itdir) RunProgram("/sys/tinypad", #file_path); + if (files.count) && (!itdir) RunProgram("/sys/quark", #file_path); break; case 4: - if (files.count) && (!itdir) RunProgram("/sys/develop/heed", #file_path); + if (files.count) && (!itdir) RunProgram("/sys/develop/cedit", #file_path); break; case 5: //refresh cur dir & devs if (two_panels.checked) @@ -1158,13 +1166,16 @@ void FnProcess(byte N) } break; case 6: - NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER); + //Move break; case 7: - NewElement_Form(CREATE_FILE, T_NEW_FILE); + NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER); break; case 8: - EventShowProperties(); + Del_Form(); + break; + case 9: + NewElement_Form(CREATE_FILE, T_NEW_FILE); break; case 10: //F10 if (!active_settings) diff --git a/programs/cmm/eolite/include/menu.h b/programs/cmm/eolite/include/menu.h index e82770f4bf..8ef980d2e7 100644 --- a/programs/cmm/eolite/include/menu.h +++ b/programs/cmm/eolite/include/menu.h @@ -10,7 +10,7 @@ char file_actions[]= - Переименовать |F2 Удалить |Del -Свойства |F8"; +Свойства |F1"; char folder_actions[]= "Открыть |Enter - @@ -19,7 +19,7 @@ char folder_actions[]= Вставить |Crl+V - Удалить |Del -Свойства |F8"; +Свойства |F1"; char empty_folder_actions[]= "Вставить |Crl+V"; char burger_menu_items[] = @@ -40,7 +40,7 @@ Aseta |Crl+V - Nimeta №mber |F2 Kustuta |Del -Properties |F8"; +Properties |F1"; char folder_actions[]= "Ava |Enter - @@ -49,7 +49,7 @@ L Aseta |Crl+V - Kustuta |Del -Properties |F8"; +Properties |F1"; char empty_folder_actions[]= "Aseta |Crl+V"; char burger_menu_items[] = @@ -70,7 +70,7 @@ Paste |Crl+V - Rename |F2 Delete |Del -Properties |F8"; +Properties |F1"; char folder_actions[]= "Open |Enter - @@ -108,7 +108,7 @@ void EventMenuClick(dword _id) case 5: EventPaste(); break; case 6: FnProcess(2); break; case 7: Del_Form(); break; - case 8: FnProcess(8); break; + case 8: FnProcess(1); break; } if (active_menu == MENU_DIR) switch(_id) { case 1: EventOpen(0); break; @@ -116,14 +116,14 @@ void EventMenuClick(dword _id) case 3: EventCopy(CUT); break; case 4: EventPaste(); break; case 5: Del_Form(); break; - case 6: FnProcess(8); break; + case 6: FnProcess(1); break; } if (active_menu == MENU_BURGER) switch(_id) { case 1: EventOpenNewEolite(); break; case 2: EventOpenConsoleHere(); break; case 3: EventRefreshDisksAndFolders(); break; case 4: FnProcess(10); break; - case 5: FnProcess(1); break; + case 5: EventShowAbout(); break; } active_menu = NULL; } diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index 90805dd4b2..40d88e30de 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -202,22 +202,31 @@ void Write_Error(int error_number) void LoadIcons() { - //ICONS16.PNG - icons16_default.load("/sys/icons16.png"); - icons16_selected.load("/sys/icons16.png"); - icons16_selected.replace_color(0xffFFFfff, col.selec); - icons16_selected.replace_color(0xffCACBD6, MixColors(col.selec, 0, 200)); - if (col.list_bg!=0xFFFfff) { - icons16_default.replace_color(0xffFFFfff, col.list_bg); - icons16_default.replace_color(0xffCACBD6, MixColors(col.list_bg, 0, 200)); - } - //ICONS32.PNG - if (big_icons.checked) { + dword selected_shadow = MixColors(col.selec, 0, 200); + dword non_white_shadow = MixColors(col.list_bg, 0, 200); + if (big_icons.checked) + { icons32_default.load("/sys/icons32.png"); icons32_selected.load("/sys/icons32.png"); + //FUUUUUU... the next ugly code may replace the previous line + //we are copying raw data without loading and unpycking PNG + //memmov(icons32_selected.imgsrc, icons32_default.imgsrc, icons32_default.h*32*4); + //EDI = icons32_selected.image; + //ESDWORD[EDI+04] = 32; + //ESDWORD[EDI+08] = icons32_default.h; + //ESDWORD[EDI+20] = IMAGE_BPP32; + //ESDWORD[EDI+24] = icons32_selected.imgsrc; icons32_default.replace_color(0x00000000, col.list_bg); - icons32_selected.replace_color(0x00000000, col.selec); + icons32_selected.replace_color(0x00000000, col.selec); + } else { + icons16_default.load("/sys/icons16.png"); + icons16_selected.load("/sys/icons16.png"); + icons16_selected.replace_2colors(0xffFFFfff, col.selec, 0xffCACBD6, selected_shadow); + if (col.list_bg!=0xFFFfff) { + icons16_selected.replace_2colors(0xffFFFfff, col.list_bg, 0xffCACBD6, non_white_shadow); + } } + } void SetAppColors() diff --git a/programs/cmm/lib/obj/libimg.h b/programs/cmm/lib/obj/libimg.h index 45ddb55c39..219aae0539 100644 --- a/programs/cmm/lib/obj/libimg.h +++ b/programs/cmm/lib/obj/libimg.h @@ -100,6 +100,7 @@ struct libimg_image void load(); void convert_into(); void replace_color(); + void replace_2colors(); void set_vars(); void draw(); }; @@ -136,7 +137,22 @@ struct libimg_image :void libimg_image::replace_color(dword old_color, new_color) { EDX = w * h * 4 + imgsrc; - for (ESI = imgsrc; ESI < EDX; ESI += 4) if (DSDWORD[ESI]==old_color) DSDWORD[ESI] = new_color; + ESI = old_color; + ECX = new_color; + FOR (EDI = imgsrc; EDI < EDX; EDI += 4) IF (DSDWORD[EDI]==ESI) DSDWORD[EDI] = ECX; +} + +:void libimg_image::replace_2colors(dword old_color1, new_color1, old_color2, new_color2) +{ + EDX = w * h * 4 + imgsrc; + ESI = old_color1; + ECX = new_color1; + EBX = old_color2; + EAX = new_color2; + FOR (EDI = imgsrc; EDI < EDX; EDI += 4) { + IF (DSDWORD[EDI]==ESI) DSDWORD[EDI] = ECX; + ELSE IF (DSDWORD[EDI]==EBX) DSDWORD[EDI] = EAX; + } } :void libimg_image::draw(dword _x, _y, _w, _h, _xoff, _yoff) diff --git a/programs/fs/unz/unz.asm b/programs/fs/unz/unz.asm index f3127ca1da..9dcf645ef7 100644 --- a/programs/fs/unz/unz.asm +++ b/programs/fs/unz/unz.asm @@ -774,11 +774,12 @@ fsRunNotifyOK: edtPack edit_box (WIN_W-100-60),100,10,0FFFFFFh,0xff,0x80ff,0h,0x90000000,\ - 255, fInp, 0,0,0,0 + 1024, fInp, 0,0,0,0 edtUnpPath edit_box (WIN_W-100-60),100,35,0FFFFFFh,0xff,0x80ff,0h,0x90000000,\ - 255, pathOut, 0,0,0,0 -edtPassword edit_box 200,56,70,0FFFFFFh,0xff,0x80ff,0h,0x90000000,255,\ - password, 0,0,0,0 + 1024, pathOut, 0,0,0,0 +edtPassword edit_box 200, 56, 40, 0FFFFFFh,0xff,0x80ff,0h,0x90000000,\ + 255, password, 0, ed_focus+ed_always_focus ;+ed_pass + endEdits: