KFM2 beta 7: add path line, colored functional buttons

git-svn-id: svn://kolibrios.org@8901 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-06-21 09:16:45 +00:00
parent 23f728b028
commit 13168e73dc
2 changed files with 72 additions and 18 deletions

View File

@ -3,9 +3,9 @@
// 70.5 - get volume info and label // 70.5 - get volume info and label
#define ABOUT_TITLE "EOLITE 5 Beta6" #define ABOUT_TITLE "EOLITE 5 Beta7"
#define TITLE_EOLITE "Eolite File Manager 5 Beta6" #define TITLE_EOLITE "Eolite File Manager 5 Beta7"
#define TITLE_KFM "Kolibri File Manager 2 Beta6"; #define TITLE_KFM "Kolibri File Manager 2 Beta7";
#define MEMSIZE 1024 * 250 #define MEMSIZE 1024 * 250
#include "../lib/clipboard.h" #include "../lib/clipboard.h"
@ -575,7 +575,7 @@ void draw_window()
dword title; dword title;
if (show_status_bar.checked) { if (show_status_bar.checked) {
#define STBAR_EOLITE_H 16; #define STBAR_EOLITE_H 16;
#define STBAR_KFM_H 21; #define STBAR_KFM_H 21+16;
if (efm) status_bar_h = STBAR_KFM_H; if (efm) status_bar_h = STBAR_KFM_H;
else status_bar_h = STBAR_EOLITE_H; else status_bar_h = STBAR_EOLITE_H;
} else { } else {
@ -659,7 +659,7 @@ void DrawFuncButtonsInKfm()
for (i=0; i<10; i++) { for (i=0; i<10; i++) {
len = strlen(kfm_func[i])*6 + padding; len = strlen(kfm_func[i])*6 + padding;
if (i==9) len = Form.cwidth - x - 3; if (i==9) len = Form.cwidth - x - 3;
DrawFlatButtonSmall(x+1, Form.cheight - 19, len, 16, i+KFM_FUNC_ID+1, kfm_func[i]); DrawFuncButton(x+1, Form.cheight - 19, len, i+KFM_FUNC_ID+1, kfm_func[i]);
x += len + 2; x += len + 2;
} }
} }
@ -670,8 +670,9 @@ void DrawStatusBar()
int go_up_folder_exists=0; int go_up_folder_exists=0;
if (efm) { if (efm) {
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work); DrawBar(0, Form.cheight - status_bar_h+15, Form.cwidth, status_bar_h-15, sc.work);
DrawFuncButtonsInKfm(); DrawFuncButtonsInKfm();
DrawPathBar();
return; return;
} }

View File

@ -1,20 +1,26 @@
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0}; //===================================================//
// //
// PATH //
// //
//===================================================//
char work_area_pointer[1024];
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x000000, 0xFFFFCC, #path, #work_area_pointer, 0};
void DrawPathBar() void DrawPathBar()
{ {
if (efm) { if (efm) {
DrawPathBarKfm();
return; return;
PathShow.start_x = 10; }
PathShow.start_y = Form.cheight - status_bar_h;
} else {
PathShow.start_x = 250;
PathShow.start_y = 17;
if (show_breadcrumb.checked) { if (show_breadcrumb.checked) {
DrawBreadCrumbs(); DrawBreadCrumbs();
return; return;
} }
}
PathShow.start_x = 250;
PathShow.start_y = 17;
PathShow.area_size_x = Form.cwidth-300; 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); 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); DrawRectangle(PathShow.start_x-4,PathShow.start_y-7,PathShow.area_size_x+4,20,sc.work_graph);
@ -23,12 +29,59 @@ void DrawPathBar()
DrawFlatButtonSmall(PathShow.start_x+PathShow.area_size_x,PathShow.start_y-7,18,20, 61, "\26"); DrawFlatButtonSmall(PathShow.start_x+PathShow.area_size_x,PathShow.start_y-7,18,20, 61, "\26");
PathShow.background_color = col.odd_line;
PathShow.font_color = col.list_gb_text; PathShow.font_color = col.list_gb_text;
PathShow_prepare stdcall(#PathShow); PathShow_prepare stdcall(#PathShow);
PathShow_draw 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;
}
if (active_panel==1) PathShow.text_pointer = #path; else PathShow.text_pointer = #inactive_path;
PathShow.start_x = 4;
PathShow.area_size_x = Form.cwidth/2-8;
PathShow.start_y = Form.cheight - status_bar_h+2;
_DRAW_BAR:
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_prepare stdcall(#PathShow);
PathShow_draw stdcall(#PathShow);
i++;
if (i<2) {
if (active_panel==1) PathShow.text_pointer = #inactive_path; else PathShow.text_pointer = #path;
PathShow.start_x = Form.cwidth/2 + 2;
PathShow.area_size_x = Form.cwidth - PathShow.start_x - 5;
goto _DRAW_BAR;
}
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);
}
void DrawPathBarKfm_Line()
{
}
//===================================================//
// //
// BREADCRUMBS //
// //
//===================================================//
void DrawBreadCrumbs() void DrawBreadCrumbs()
collection_int breadCrumb=0; collection_int breadCrumb=0;
char PathShow_path[4096]; char PathShow_path[4096];
@ -39,7 +92,7 @@ void DrawBreadCrumbs()
strcat(#PathShow_path, #path); strcat(#PathShow_path, #path);
for (i=0; i<50; i++) DeleteButton(i+BREADCRUMB_ID); for (i=0; i<50; i++) DeleteButton(i+BREADCRUMB_ID);
breadCrumb.drop(); breadCrumb.drop();
for (i=0; PathShow_path[i]; i++) for (i=0; (PathShow_path[i]) && (i<sizeof(PathShow_path)-1); i++)
{ {
if (PathShow_path[i]=='/') { if (PathShow_path[i]=='/') {
PathShow_path[i] = NULL; PathShow_path[i] = NULL;