Eolite 3.76:

- Fix file selection issue flush on RMB;
+ Remove menu item "Open" when click several files selected;
+ If click on non selected file the selection flushes.

git-svn-id: svn://kolibrios.org@6973 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2017-09-12 15:32:38 +00:00
parent ec2d075e74
commit e93f3bd431
3 changed files with 31 additions and 27 deletions

View File

@ -16,6 +16,7 @@
#include "..\lib\random.h" #include "..\lib\random.h"
#include "..\lib\kfont.h" #include "..\lib\kfont.h"
#include "..\lib\collection.h" #include "..\lib\collection.h"
#include "..\lib\menu.h"
#include "..\lib\obj\libini.h" #include "..\lib\obj\libini.h"
#include "..\lib\obj\box_lib.h" #include "..\lib\obj\box_lib.h"
#include "..\lib\patterns\history.h" #include "..\lib\patterns\history.h"
@ -229,6 +230,7 @@ void main()
{ {
menu_call_mouse = 1; menu_call_mouse = 1;
if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw(); if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw();
if (getElementSelectedFlag(files.cur_y) == false) selected_count = 0; //on redraw selection would be flashed, see [L001]
menu_stak = malloc(4096); menu_stak = malloc(4096);
CreateThread(#FileMenu,menu_stak+4092); CreateThread(#FileMenu,menu_stak+4092);
break; break;
@ -551,7 +553,7 @@ void draw_window()
llist_copy(#files_active, #files); llist_copy(#files_active, #files);
strcpy(#active_path, #path); strcpy(#active_path, #path);
DrawStatusBar(); DrawStatusBar();
Open_Dir(#path,ONLY_OPEN); if (selected_count==0) Open_Dir(#path,ONLY_OPEN); //if there are no selected files -> refresh folder [L001]
DrawFilePanels(); DrawFilePanels();
if (del_active) Del_Form(); if (del_active) Del_Form();
if (new_element_active) NewElement_Form(new_element_active, #new_element_name); if (new_element_active) NewElement_Form(new_element_active, #new_element_name);

View File

@ -45,7 +45,7 @@ char *file_captions[] = {
0, 0, 0}; 0, 0, 0};
#endif #endif
llist menu; llist rbmenu;
int cur_action_buf; int cur_action_buf;
void FileMenu() void FileMenu()
@ -53,18 +53,19 @@ void FileMenu()
proc_info MenuForm; proc_info MenuForm;
int index; int index;
menu.ClearList(); rbmenu.ClearList();
menu.SetFont(6, 9, 0x80); rbmenu.SetFont(6, 9, 0x80);
menu.SetSizes(0,0,10,0,18); rbmenu.SetSizes(0,0,10,0,18);
for (index=0; file_captions[index]!=0; index+=3) for (index=0; file_captions[index]!=0; index+=3)
{ {
if (itdir) && (file_captions[index+2]>=200) continue; if (itdir) && (file_captions[index+2]>=200) continue;
if (strlen(file_captions[index])>menu.w) menu.w = strlen(file_captions[index]); if (selected_count > 0) && (file_captions[index+2]==100) continue; //do not show "open" for several files
menu.count++; if (strlen(file_captions[index])>rbmenu.w) rbmenu.w = strlen(file_captions[index]);
menu.visible++; rbmenu.count++;
rbmenu.visible++;
} }
menu.w = menu.w + 3 * menu.font_w + 50; rbmenu.w = rbmenu.w + 3 * rbmenu.font_w + 50;
menu.h = menu.count * menu.item_h; rbmenu.h = rbmenu.count * rbmenu.item_h;
SetEventMask(100111b); SetEventMask(100111b);
goto _MENU_DRAW; goto _MENU_DRAW;
@ -73,7 +74,7 @@ void FileMenu()
case evMouse: case evMouse:
mouse.get(); mouse.get();
if (!CheckActiveProcess(MenuForm.ID)){ cmd_free=1; ExitProcess();} if (!CheckActiveProcess(MenuForm.ID)){ cmd_free=1; ExitProcess();}
else if (mouse.move)&&(menu.ProcessMouse(mouse.x, mouse.y)) MenuListRedraw(); else if (mouse.move)&&(rbmenu.ProcessMouse(mouse.x, mouse.y)) MenuListRedraw();
else if (mouse.key&MOUSE_LEFT)&&(mouse.up) {action_buf = cur_action_buf; cmd_free=1; ExitProcess(); } else if (mouse.key&MOUSE_LEFT)&&(mouse.up) {action_buf = cur_action_buf; cmd_free=1; ExitProcess(); }
break; break;
@ -81,16 +82,16 @@ void FileMenu()
GetKeys(); GetKeys();
if (key_scancode == SCAN_CODE_ESC) {cmd_free=1;ExitProcess();} if (key_scancode == SCAN_CODE_ESC) {cmd_free=1;ExitProcess();}
if (key_scancode == SCAN_CODE_ENTER) {action_buf = cur_action_buf; cmd_free=1; ExitProcess(); } if (key_scancode == SCAN_CODE_ENTER) {action_buf = cur_action_buf; cmd_free=1; ExitProcess(); }
if (menu.ProcessKey(key_scancode)) MenuListRedraw(); if (rbmenu.ProcessKey(key_scancode)) MenuListRedraw();
break; break;
case evReDraw: _MENU_DRAW: case evReDraw: _MENU_DRAW:
if (menu_call_mouse) DefineAndDrawWindow(mouse.x+Form.left+5, mouse.y+Form.top+GetSkinHeight(),menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF); if (menu_call_mouse) DefineAndDrawWindow(mouse.x+Form.left+5, mouse.y+Form.top+GetSkinHeight(),rbmenu.w+3,rbmenu.h+6,0x01, 0, 0, 0x01fffFFF);
else DefineAndDrawWindow(Form.left+files.x+15, files.item_h*files.cur_y+files.y+Form.top+30,menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF); else DefineAndDrawWindow(Form.left+files.x+15, files.item_h*files.cur_y+files.y+Form.top+30,rbmenu.w+3,rbmenu.h+6,0x01, 0, 0, 0x01fffFFF);
GetProcessInfo(#MenuForm, SelfInfo); GetProcessInfo(#MenuForm, SelfInfo);
DrawRectangle(0,0,menu.w+1,menu.h+2,col_graph); DrawRectangle(0,0,rbmenu.w+1,rbmenu.h+2,col_graph);
DrawBar(1,1,menu.w,1,0xFFFfff); DrawBar(1,1,rbmenu.w,1,0xFFFfff);
DrawPopupShadow(1,1,menu.w,menu.h,0); DrawPopupShadow(1,1,rbmenu.w,rbmenu.h,0);
MenuListRedraw(); MenuListRedraw();
} }
} }
@ -102,19 +103,20 @@ void MenuListRedraw()
for (index=0; file_captions[index*3]!=0; index++) for (index=0; file_captions[index*3]!=0; index++)
{ {
if ((itdir) && (file_captions[index*3+2]>=200)) continue; if ((itdir) && (file_captions[index*3+2]>=200)) continue;
DrawBar(1,start_y+2,1,menu.item_h,0xFFFfff); if (selected_count > 0) && (file_captions[index+2]==100) continue;
if (start_y/menu.item_h==menu.cur_y) DrawBar(1,start_y+2,1,rbmenu.item_h,0xFFFfff);
if (start_y/rbmenu.item_h==rbmenu.cur_y)
{ {
cur_action_buf = file_captions[index*3+2]; cur_action_buf = file_captions[index*3+2];
DrawBar(2,start_y+2,menu.w-1,menu.item_h,0xFFFfff); DrawBar(2,start_y+2,rbmenu.w-1,rbmenu.item_h,0xFFFfff);
} }
else else
{ {
DrawBar(2,start_y+2,menu.w-1,menu.item_h,col_work); DrawBar(2,start_y+2,rbmenu.w-1,rbmenu.item_h,col_work);
WriteText(8,start_y+menu.text_y+4,menu.font_type,0xf2f2f2,file_captions[index*3]); WriteText(8,start_y+rbmenu.text_y+4,rbmenu.font_type,0xf2f2f2,file_captions[index*3]);
} }
WriteText(7, start_y + menu.text_y + 3, menu.font_type, 0, file_captions[index*3]); WriteText(7, start_y + rbmenu.text_y + 3, rbmenu.font_type, 0, file_captions[index*3]);
WriteText(-strlen(file_captions[index*3+1])-1*menu.font_w + menu.w, start_y + menu.text_y + 3, menu.font_type, 0x888888, file_captions[index*3+1]); WriteText(-strlen(file_captions[index*3+1])-1*rbmenu.font_w + rbmenu.w, start_y + rbmenu.text_y + 3, rbmenu.font_type, 0x888888, file_captions[index*3+1]);
start_y+=menu.item_h; start_y+=rbmenu.item_h;
} }
} }

View File

@ -1,5 +1,5 @@
#define TITLE "Eolite File Manager v3.75" #define TITLE "Eolite File Manager v3.76"
#define ABOUT_TITLE "EOLITE 3.75" #define ABOUT_TITLE "EOLITE 3.76"
#ifdef LANG_RUS #ifdef LANG_RUS
?define T_FILE "” ©«" ?define T_FILE "” ©«"