From 298053d7f9fda369e4bb95a4d42cac620dc16cfd Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 27 Jun 2021 12:32:00 +0000 Subject: [PATCH] Eolite: refactoring git-svn-id: svn://kolibrios.org@8951 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 54 +++--- programs/cmm/eolite/include/breadcrumbs.h | 132 ------------- programs/cmm/eolite/include/const.h | 36 ++-- programs/cmm/eolite/include/gui.h | 216 +++++++++++++++++++++- programs/cmm/eolite/include/left_panel.h | 83 +-------- 5 files changed, 255 insertions(+), 266 deletions(-) delete mode 100644 programs/cmm/eolite/include/breadcrumbs.h diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index b24d78c52c..f2d530b4f3 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -3,9 +3,9 @@ // 70.5 - get volume info and label -#define ABOUT_TITLE "EOLITE 5 Beta9" -#define TITLE_EOLITE "Eolite File Manager 5 Beta9" -#define TITLE_KFM "Kolibri File Manager 2 Beta9"; +#define ABOUT_TITLE "EOLITE 5 Beta10" +#define TITLE_EOLITE "Eolite File Manager 5 Beta10" +#define TITLE_KFM "Kolibri File Manager 2 Beta10"; #define MEMSIZE 1024 * 250 #include "../lib/clipboard.h" @@ -110,9 +110,8 @@ edit_box new_file_ed = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x100000 248,#new_element_name,0,ed_focus+ed_always_focus,6,0}; PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; - -#include "include\gui.h" #include "include\settings.h" +#include "include\gui.h" #include "include\progress_dialog.h" #include "include\copy_and_delete.h" #include "include\sorting.h" @@ -121,7 +120,6 @@ PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #t #include "include\menu.h" #include "include\about.h" #include "include\properties.h" -#include "include\breadcrumbs.h" void handle_param() { @@ -648,41 +646,34 @@ void DrawFilePanels() int h2 = Form.cheight-files_y-2 - status_bar_h; if (!efm) { - DrawDeviceAndActionsLeftPanel(); + SystemDiscs.Draw(); files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59 - status_bar_h, files.item_h); DrawButtonsAroundList(); List_ReDraw(); } else { - llist_copy(#files_active, #files); - llist_copy(#files, #files_inactive); - path = location[active_panel^1]; - - if (active_panel==0) - { + if (!active_panel) { files.SetSizes(Form.cwidth/2, files_y, w2-17, h2, files.item_h); - DrawButtonsAroundList(); - Open_Dir(path,WITH_REDRAW); - files_inactive.count = files.count; - llist_copy(#files, #files_active); - path = location[active_panel]; + } else { files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h); - DrawButtonsAroundList(); - Open_Dir(path,WITH_REDRAW); } - if (active_panel==1) - { + + files_inactive.x = files.x; + DrawButtonsAroundList(); + path = location[active_panel^1]; + Open_Dir(location[active_panel^1],WITH_REDRAW); + llist_copy(#files_inactive, #files); + + if (!active_panel) { files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h); - DrawButtonsAroundList(); - Open_Dir(path,WITH_REDRAW); - files_inactive.count = files.count; - llist_copy(#files, #files_active); - path = location[active_panel]; + } else { files.SetSizes(Form.cwidth/2, files_y, w2 -17, h2, files.item_h); - DrawButtonsAroundList(); - Open_Dir(path,WITH_REDRAW); } + + DrawButtonsAroundList(); + path = location[active_panel]; + Open_Dir(location[active_panel],WITH_REDRAW); } } @@ -1208,7 +1199,7 @@ void EventRefreshDisksAndFolders() } else { if (GetRealFileCountInFolder("/")+dir_exists("/kolibrios") != SystemDiscs.dev_num) { SystemDiscs.Get(); - DrawDeviceAndActionsLeftPanel(); + SystemDiscs.Draw(); } } if(GetRealFileCountInFolder(path) != files.count) Open_Dir(path,WITH_REDRAW); @@ -1218,8 +1209,7 @@ void EventManualFolderRefresh() { Tip(56, T_DEVICES, 55, "-"); pause(10); - EventRefreshDisksAndFolders(); - DrawDeviceAndActionsLeftPanel(); + DrawFilePanels(); } void EventSort(dword id) diff --git a/programs/cmm/eolite/include/breadcrumbs.h b/programs/cmm/eolite/include/breadcrumbs.h deleted file mode 100644 index 3abc5d1fbb..0000000000 --- a/programs/cmm/eolite/include/breadcrumbs.h +++ /dev/null @@ -1,132 +0,0 @@ - -//===================================================// -// // -// PATH // -// // -//===================================================// - -char work_area_pointer[1024]; -PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x000000, 0xFFFFCC, NULL, #work_area_pointer, 0}; -void DrawPathBar() -{ - if (efm) { - DrawPathBarKfm(); - return; - } - - if (show_breadcrumb.checked) { - DrawBreadCrumbs(); - return; - } - - PathShow.text_pointer = location[0]; - PathShow.start_x = 250; - PathShow.start_y = 17; - PathShow.area_size_x = Form.cwidth-300; - DrawBar(PathShow.start_x-3, PathShow.start_y-6, PathShow.area_size_x+3, 19, col.odd_line); - DrawRectangle(PathShow.start_x-4,PathShow.start_y-7,PathShow.area_size_x+4,20,sc.work_graph); - DefineHiddenButton(PathShow.start_x-4+1,PathShow.start_y-7+1,PathShow.area_size_x+4-2,20-2,PATH_BTN); - DrawBar(PathShow.start_x-4, PathShow.start_y+14, PathShow.area_size_x+5+18, 1, sc.work_light); - - DrawFlatButtonSmall(PathShow.start_x+PathShow.area_size_x,PathShow.start_y-7,18,20, 61, "\26"); - - PathShow.font_color = col.list_gb_text; - PathShow_prepare stdcall(#PathShow); - PathShow_draw stdcall(#PathShow); -} - -void DrawPathBarKfm() -{ - dword bgc; - int i=0; - if (!Form.cwidth) return; - - if (skin_is_dark()) { - bgc = col.odd_line; - PathShow.font_color = col.list_gb_text; - } else { - bgc = 0xFFFFCC; - PathShow.font_color = 0x222222; - } - PathShow.start_y = Form.cheight - status_bar_h+2; - - PathShow.start_x = 4; - PathShow.area_size_x = Form.cwidth/2-8; - do { - DrawBar(PathShow.start_x-2,PathShow.start_y-3,PathShow.area_size_x+5,14,bgc); - DrawRectangle(PathShow.start_x-3,PathShow.start_y-4,PathShow.area_size_x+6,15,sc.work_graph); - PathShow.text_pointer = location[i]; - PathShow_prepare stdcall(#PathShow); - PathShow_draw stdcall(#PathShow); - - PathShow.start_x = Form.cwidth/2 + 2; - PathShow.area_size_x = Form.cwidth - PathShow.start_x - 5; - i++; - } while (i<2); - - DrawBar(0,PathShow.start_y-2,1,15,sc.work); - DrawBar(Form.cwidth-1,PathShow.start_y-2,1,15,sc.work); - DrawBar(1,PathShow.start_y+12,Form.cwidth-2,1,sc.work_light); -} - -//===================================================// -// // -// BREADCRUMBS // -// // -//===================================================// - -void DrawBreadCrumbs() - collection_int breadCrumb=0; - char PathShow_path[4096]; - block btn; - int i; - unsigned text_line; - { - strcat(#PathShow_path, path); - for (i=0; i<50; i++) DeleteButton(i+BREADCRUMB_ID); - breadCrumb.drop(); - for (i=0; (PathShow_path[i]) && (i