mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2025-09-08 03:18:25 -04:00
Eolite 5.32: Search fix (#191)
- LMB to open file, RMB to show in folder - fix: correctly open folders - fix UI: better list alignment - Eolite: optimize OpenDir - SelectList_ProcessMouse() better react on click Reviewed-on: https://git.kolibrios.org/KolibriOS/kolibrios/pulls/191 Reviewed-by: Max Logaev <maxlogaev@proton.me> Co-authored-by: leency <lipatov.kiril@gmail.com> Co-committed-by: leency <lipatov.kiril@gmail.com>
This commit is contained in:
parent
5abc319817
commit
8da45bab3e
@ -10,9 +10,9 @@ TODO:
|
|||||||
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
|
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ABOUT_TITLE "Eolite 5.31"
|
#define ABOUT_TITLE "Eolite 5.32"
|
||||||
#define TITLE_EOLITE "Eolite File Manager 5.31"
|
#define TITLE_EOLITE "Eolite File Manager 5.32"
|
||||||
#define TITLE_KFM "Kolibri File Manager 2.31";
|
#define TITLE_KFM "Kolibri File Manager 2.32";
|
||||||
|
|
||||||
#define MEMSIZE 1024 * 250
|
#define MEMSIZE 1024 * 250
|
||||||
#include "../lib/clipboard.h"
|
#include "../lib/clipboard.h"
|
||||||
@ -718,7 +718,7 @@ void DrawFilePanels()
|
|||||||
DrawButtonsAroundList();
|
DrawButtonsAroundList();
|
||||||
path = location[active_panel^1];
|
path = location[active_panel^1];
|
||||||
active_panel ^= 1;
|
active_panel ^= 1;
|
||||||
OpenDir2(WITH_REDRAW);
|
OpenDir_without_unselect(WITH_REDRAW);
|
||||||
active_panel ^= 1;
|
active_panel ^= 1;
|
||||||
if (!getSelectedCount()) files_inactive.count = files.count;
|
if (!getSelectedCount()) files_inactive.count = files.count;
|
||||||
llist_copy(#files, #files_active);
|
llist_copy(#files, #files_active);
|
||||||
@ -731,38 +731,22 @@ void DrawFilePanels()
|
|||||||
|
|
||||||
DrawButtonsAroundList();
|
DrawButtonsAroundList();
|
||||||
path = location[active_panel];
|
path = location[active_panel];
|
||||||
OpenDir2(WITH_REDRAW);
|
OpenDir_without_unselect(WITH_REDRAW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenDir2(char redraw){
|
void OpenDir(char redraw) {
|
||||||
if (buf) free(buf);
|
|
||||||
if (GetDir(#buf, #files.count, path, DIRS_NOROOT)) {
|
|
||||||
Write_Error(EAX);
|
|
||||||
history.add(path);
|
|
||||||
EventHistoryGoBack();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SetCurDir(path);
|
|
||||||
if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
|
|
||||||
files.visible = math.min(files.h / files.item_h, files.count);
|
|
||||||
if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4))
|
|
||||||
dir_at_fat16 = true; else dir_at_fat16 = false;
|
|
||||||
Sorting();
|
|
||||||
SystemDiscs.Draw();
|
|
||||||
list_full_redraw = true;
|
|
||||||
List_ReDraw();
|
|
||||||
DrawPathBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void OpenDir(char redraw){
|
|
||||||
int errornum;
|
|
||||||
unselectAll();
|
unselectAll();
|
||||||
|
OpenDir_without_unselect(redraw);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void OpenDir_without_unselect(char redraw) {
|
||||||
|
int errornum;
|
||||||
|
|
||||||
if (buf) free(buf);
|
if (buf) free(buf);
|
||||||
if (errornum = GetDir(#buf, #files.count, path, DIRS_NOROOT)) {
|
if (errornum = GetDir(#buf, #files.count, path, DIRS_NOROOT)) {
|
||||||
history.add(path);
|
history.add(path);
|
||||||
//EventHistoryGoBack();
|
|
||||||
Dir_Up();
|
Dir_Up();
|
||||||
Write_Error(errornum);
|
Write_Error(errornum);
|
||||||
return;
|
return;
|
||||||
|
@ -50,10 +50,6 @@ opendialog open_folder_dialog =
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TOOLBAR_H 100
|
|
||||||
#define LISTX 0
|
|
||||||
#define LISTY TOOLBAR_H
|
|
||||||
|
|
||||||
//===================================================//
|
//===================================================//
|
||||||
// //
|
// //
|
||||||
// RESULTS //
|
// RESULTS //
|
||||||
@ -95,9 +91,7 @@ void SearchThread()
|
|||||||
{
|
{
|
||||||
int prev_first, prev_cur_y;
|
int prev_first, prev_cur_y;
|
||||||
|
|
||||||
#ifndef __COFF__
|
|
||||||
load_dll(Proc_lib, #OpenDialog_init,0);
|
load_dll(Proc_lib, #OpenDialog_init,0);
|
||||||
#endif
|
|
||||||
OpenDialog_init stdcall (#open_folder_dialog);
|
OpenDialog_init stdcall (#open_folder_dialog);
|
||||||
|
|
||||||
if (!ESBYTE[path]) strcpy(path, "/sys");
|
if (!ESBYTE[path]) strcpy(path, "/sys");
|
||||||
@ -107,28 +101,43 @@ void SearchThread()
|
|||||||
loop() switch(@WaitEvent())
|
loop() switch(@WaitEvent())
|
||||||
{
|
{
|
||||||
case evMouse:
|
case evMouse:
|
||||||
|
|
||||||
edit_box_mouse stdcall (#edit_name);
|
edit_box_mouse stdcall (#edit_name);
|
||||||
edit_box_mouse stdcall (#edit_path);
|
edit_box_mouse stdcall (#edit_path);
|
||||||
|
|
||||||
|
|
||||||
|
prev_cur_y = select_list.cur_y;
|
||||||
|
|
||||||
if (SelectList_ProcessMouse()) {
|
if (SelectList_ProcessMouse()) {
|
||||||
SelectList_Draw();
|
SelectList_Draw();
|
||||||
} else {
|
} else {
|
||||||
SelectList_DrawLine(select_list.cur_y);
|
SelectList_DrawLine(select_list.cur_y);
|
||||||
}
|
|
||||||
if (mouse.key&MOUSE_RIGHT) && (mouse.up) && (select_list.MouseOver()) EventOpenFile(false);
|
if (select_list.MouseOver(mouse.x, mouse.y))
|
||||||
break;
|
{
|
||||||
|
if (mouse.key&MOUSE_LEFT) && (mouse.up) {
|
||||||
|
if (prev_cur_y == select_list.cur_y) EventRunFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mouse.key&MOUSE_RIGHT) && (mouse.up) {
|
||||||
|
EventShowFileInFolder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
case evButton:
|
case evButton:
|
||||||
switch (@GetButtonID()) {
|
switch (@GetButtonID()) {
|
||||||
case 1: @ExitProcess(); break;
|
case 1: @ExitProcess(); break;
|
||||||
case BTN_SEARCH: EventSearch(); break;
|
case BTN_SEARCH: EventSearch(); break;
|
||||||
case BTN_CHOOSE_PATH: EventChooseSearchInPath();
|
case BTN_CHOOSE_PATH: EventChooseSearchInPath();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
break;
|
||||||
case evKey:
|
case evKey:
|
||||||
@GetKeys();
|
GetKeys();
|
||||||
edit_box_key stdcall (#edit_name);
|
edit_box_key_c stdcall (#edit_name, key_editbox);
|
||||||
edit_box_key stdcall (#edit_path);
|
edit_box_key_c stdcall (#edit_path, key_editbox);
|
||||||
if (key_scancode == SCAN_CODE_TAB) {
|
if (key_scancode == SCAN_CODE_TAB) {
|
||||||
if (edit_name.flags & ed_focus) {
|
if (edit_name.flags & ed_focus) {
|
||||||
edit_name.flags >< edit_path.flags;
|
edit_name.flags >< edit_path.flags;
|
||||||
@ -143,7 +152,7 @@ void SearchThread()
|
|||||||
if (edit_name.flags & ed_focus) || (edit_path.flags & ed_focus) {
|
if (edit_name.flags & ed_focus) || (edit_path.flags & ed_focus) {
|
||||||
if (SCAN_CODE_ENTER == key_scancode) EventSearch();
|
if (SCAN_CODE_ENTER == key_scancode) EventSearch();
|
||||||
} else {
|
} else {
|
||||||
if (SCAN_CODE_ENTER == key_scancode) EventOpenFile(true);
|
if (SCAN_CODE_ENTER == key_scancode) EventRunFile();
|
||||||
prev_first = select_list.first;
|
prev_first = select_list.first;
|
||||||
prev_cur_y = select_list.cur_y;
|
prev_cur_y = select_list.cur_y;
|
||||||
if (select_list.ProcessKey(key_scancode)) {
|
if (select_list.ProcessKey(key_scancode)) {
|
||||||
@ -169,17 +178,24 @@ void SearchThread()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define TOOLBAR_H 100
|
||||||
|
#define PAD 10
|
||||||
|
#define LISTX PAD
|
||||||
|
#define LISTY TOOLBAR_H
|
||||||
|
|
||||||
void draw_window_search()
|
void draw_window_search()
|
||||||
{
|
{
|
||||||
SelectList_Init(LISTX, LISTY, Form.cwidth-scroll1.size_x-1, Form.cheight-TOOLBAR_H-1);
|
SelectList_Init(LISTX, LISTY, Form.cwidth-scroll1.size_x-LISTX-LISTX, Form.cheight-TOOLBAR_H-PAD);
|
||||||
SelectList_Draw();
|
SelectList_Draw();
|
||||||
DrawBar(0, TOOLBAR_H-1, Form.cwidth, 1, sc.line);
|
DrawWideRectangle(0, LISTY-PAD-1, Form.cwidth, Form.cheight-TOOLBAR_H+PAD+1, 9, sc.work);
|
||||||
|
DrawRectangle(PAD-1, LISTY-1, select_list.w+1, select_list.h+1, sc.line);
|
||||||
|
|
||||||
DrawBar(0, 0, Form.cwidth, TOOLBAR_H-1, sc.work);
|
DrawBar(0, 0, Form.cwidth, TOOLBAR_H-1, sc.work);
|
||||||
DrawEditBox(#edit_name);
|
DrawEditBox(#edit_name);
|
||||||
WriteText(edit_name.left-2, edit_name.top-20, 0x90, sc.work_text, T_SEARCH_NAME);
|
WriteText(edit_name.left-2, edit_name.top-20, 0x90, sc.work_text, T_SEARCH_NAME);
|
||||||
edit_path.width = Form.cwidth - 314;
|
edit_path.width = Form.cwidth - 314;
|
||||||
|
DrawStandartCaptButton(PAD, 63, BTN_SEARCH, T_BUTTON_SEARCH);
|
||||||
DrawFileBox(#edit_path, T_SEARCH_PATH, BTN_CHOOSE_PATH);
|
DrawFileBox(#edit_path, T_SEARCH_PATH, BTN_CHOOSE_PATH);
|
||||||
DrawStandartCaptButton(10, 63, BTN_SEARCH, T_BUTTON_SEARCH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectList_DrawLine(dword i)
|
void SelectList_DrawLine(dword i)
|
||||||
@ -224,6 +240,12 @@ void SelectList_LineChanged()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void getfullpath(dword to, path, name) {
|
||||||
|
strcpy(to, path);
|
||||||
|
chrcat(to, '/');
|
||||||
|
strcat(to, name);
|
||||||
|
}
|
||||||
|
|
||||||
//===================================================//
|
//===================================================//
|
||||||
// //
|
// //
|
||||||
// EVENTS //
|
// EVENTS //
|
||||||
@ -238,22 +260,21 @@ void EventChooseSearchInPath()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void getfullpath(dword to, path, name) {
|
void EventShowFileInFolder()
|
||||||
strcpy(to, path);
|
|
||||||
chrcat(to, '/');
|
|
||||||
strcat(to, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
void EventOpenFile(int run_file_not_show_in_folder)
|
|
||||||
{
|
{
|
||||||
char full_path[4096];
|
char full_path[4096];
|
||||||
int pos = select_list.cur_y;
|
int pos = select_list.cur_y;
|
||||||
getfullpath(#full_path, results.path.get(pos), results.name.get(pos));
|
getfullpath(#full_path, results.path.get(pos), results.name.get(pos));
|
||||||
if (run_file_not_show_in_folder) {
|
RunProgram(#program_path, #full_path);
|
||||||
RunProgram("/sys/@open", #full_path);
|
}
|
||||||
} else {
|
|
||||||
RunProgram("/sys/file managers/eolite", #full_path);
|
void EventRunFile()
|
||||||
}
|
{
|
||||||
|
char full_path[4096];
|
||||||
|
int pos = select_list.cur_y;
|
||||||
|
getfullpath(#full_path, results.path.get(pos), results.name.get(pos));
|
||||||
|
if (dir_exists(#full_path)) chrcat(#full_path, '/');
|
||||||
|
RunProgram("/sys/@open", #full_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventSearch()
|
void EventSearch()
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#pragma option -CPA
|
#pragma option -CPA
|
||||||
#initallvar 0
|
#initallvar 0
|
||||||
|
|
||||||
#ifndef __COFF__
|
|
||||||
#jumptomain FALSE
|
#jumptomain FALSE
|
||||||
|
|
||||||
#startaddress 0
|
#startaddress 0
|
||||||
@ -30,17 +29,6 @@ dword I_Param = #param;
|
|||||||
dword I_Path = #program_path;
|
dword I_Path = #program_path;
|
||||||
char param[4096];
|
char param[4096];
|
||||||
char program_path[4096];
|
char program_path[4096];
|
||||||
#else
|
|
||||||
extern dword __argv;
|
|
||||||
extern dword __path;
|
|
||||||
|
|
||||||
dword I_Param = #__argv;
|
|
||||||
dword I_Path = #__path;
|
|
||||||
|
|
||||||
#define param __argv
|
|
||||||
#define program_path __path
|
|
||||||
#define ______INIT______ start
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define bool int
|
#define bool int
|
||||||
|
|
||||||
@ -403,6 +391,7 @@ inline fastcall int TestBit( EAX, CL)
|
|||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#define MINIMIZED 0x02
|
||||||
#define ROLLED_UP 0x04
|
#define ROLLED_UP 0x04
|
||||||
:void DefineAndDrawWindow(dword _x, _y, _w, _h, _window_type, _bgcolor, _title, _flags)
|
:void DefineAndDrawWindow(dword _x, _y, _w, _h, _window_type, _bgcolor, _title, _flags)
|
||||||
{
|
{
|
||||||
|
@ -116,17 +116,10 @@
|
|||||||
EAX = 37;
|
EAX = 37;
|
||||||
EBX = 2;
|
EBX = 2;
|
||||||
$int 64
|
$int 64
|
||||||
$mov ebx, eax
|
|
||||||
$mov ecx, eax
|
|
||||||
key = EAX;
|
key = EAX;
|
||||||
$and eax, 0x00000001
|
lkm = EAX&MOUSE_LEFT;
|
||||||
$shr ebx, 1
|
pkm = EAX&MOUSE_RIGHT;
|
||||||
$and ebx, 0x00000001
|
mkm = EAX&MOUSE_MIDDLE;
|
||||||
$shr ecx, 2
|
|
||||||
$and ecx, 0x00000001
|
|
||||||
lkm = EAX;
|
|
||||||
pkm = EBX;
|
|
||||||
mkm = ECX;
|
|
||||||
|
|
||||||
//when you release the MOUSE button
|
//when you release the MOUSE button
|
||||||
// Mouse Move Event
|
// Mouse Move Event
|
||||||
|
@ -44,15 +44,14 @@ signed SelectList_ProcessMouse()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouse.up) && (mouse.click)
|
if (mouse.up) && (select_list.ProcessMouse(mouse.x, mouse.y)) {
|
||||||
if (select_list.ProcessMouse(mouse.x, mouse.y)) {
|
SelectList_LineChanged();
|
||||||
SelectList_LineChanged();
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectList_DrawBorder() {
|
:void SelectList_DrawBorder() {
|
||||||
DrawRectangle3D(select_list.x-2, select_list.y-2,
|
DrawRectangle3D(select_list.x-2, select_list.y-2,
|
||||||
select_list.w+3+scroll1.size_x, select_list.h+3,
|
select_list.w+3+scroll1.size_x, select_list.h+3,
|
||||||
sc.dark, sc.light);
|
sc.dark, sc.light);
|
||||||
@ -61,8 +60,8 @@ void SelectList_DrawBorder() {
|
|||||||
|
|
||||||
void SelectList_DrawScroller()
|
void SelectList_DrawScroller()
|
||||||
{
|
{
|
||||||
scroll1.bckg_col = MixColors(sc.work, 0xBBBbbb, 80);
|
scroll1.bckg_col = sc.dark; // MixColors(sc.work, 0xBBBbbb, 80);
|
||||||
scroll1.frnt_col = MixColors(sc.work,0xFFFfff,120);
|
scroll1.frnt_col = sc.light; // MixColors(sc.work,0xFFFfff,120);
|
||||||
scroll1.line_col = sc.line;
|
scroll1.line_col = sc.line;
|
||||||
|
|
||||||
scroll1.max_area = select_list.count;
|
scroll1.max_area = select_list.count;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user