KFM2: better functional buttons

git-svn-id: svn://kolibrios.org@8927 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-06-22 20:16:57 +00:00
parent 744dc6bcc8
commit 6f2937256a
3 changed files with 37 additions and 32 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 RC2" #define ABOUT_TITLE "EOLITE 5 RC3"
#define TITLE_EOLITE "Eolite File Manager 5 RC2" #define TITLE_EOLITE "Eolite File Manager 5 RC3"
#define TITLE_KFM "Kolibri File Manager 2 RC2"; #define TITLE_KFM "Kolibri File Manager 2 RC3";
#define MEMSIZE 1024 * 250 #define MEMSIZE 1024 * 250
#include "../lib/clipboard.h" #include "../lib/clipboard.h"
@ -654,12 +654,12 @@ void DrawButtonsAroundList()
void DrawFuncButtonsInKfm() void DrawFuncButtonsInKfm()
{ {
int i, x=0, len, min_w=0, padding; int i, x=0, len, min_w=0, padding;
for (i=0; i<10; i++) min_w += strlen(kfm_func[i])*6 + 2; for (i=0; i<10; i++) min_w += strlen(kfm_func[i])+2*6 + 2;
padding = Form.cwidth - min_w + 4 / 10; padding = Form.cwidth - min_w + 4 / 10;
for (i=0; i<10; i++) { for (i=0; i<10; i++) {
len = strlen(kfm_func[i])*6 + padding; len = strlen(kfm_func[i])+2*6 + padding;
if (i==9) len = Form.cwidth - x - 3; if (i==9) len = Form.cwidth - x - 3;
DrawFuncButton(x+1, Form.cheight - 19, len, i+KFM_FUNC_ID+1, kfm_func[i]); DrawFuncButton(x+1, Form.cheight - 19, len, i+KFM_FUNC_ID+1, i+1, kfm_func[i]);
x += len + 2; x += len + 2;
} }
} }

View File

@ -63,21 +63,26 @@ void DrawFlatButtonSmall(dword x,y,width,height,id,text)
WriteText(-strlen(text)*6+width/2+x+1,height/2+y-3,0x80,sc.work_text,text); WriteText(-strlen(text)*6+width/2+x+1,height/2+y-3,0x80,sc.work_text,text);
} }
void DrawFuncButton(dword x,y,width,id,text) void DrawFuncButton(dword x,y,width,id,number,text)
{ {
#define FW 17 #define FW 12
#define FH 16 #define FH 16
int numw = calc(number/10)*6+FW;
if (skin_is_dark()) { if (skin_is_dark()) {
DrawFlatButtonSmall(x,y,width,FH,id,text); DrawFlatButtonSmall(x,y,width,FH,id,text);
return; return;
} }
DrawRectangle(x,y,width,FH,sc.work_graph); DrawRectangle(x,y,width,FH,sc.work_graph);
DrawRectangle3D(x+1,y+1,width-2,FH-2, sc.work_light, sc.work_dark); DrawRectangle3D(x+1,y+1,width-2,FH-2, 0x97D194, 0x00A100);
PutPixel(x+width-1, y+1, sc.work_dark); PutPixel(x+width-1, y+1, sc.work_dark);
DrawBar(x+2, y+2, FW, FH-3, 0x6060FF); DrawBar(x+2, y+2, numw, FH-2, 0x6060FF);
DrawBar(x+2+FW, y+2, width-3-FW, FH-3, 0x00AA00); WriteText(x+6,FH/2+y-2,0x80,0x444444,itoa(number));
$sub ebx, 1 <<16 + 1
$add ecx, 0xFFFfff-0x444444
$int 64
DrawBar(x+2+numw, y+2, width-3-numw, FH-3, 0x00AA00);
DefineHiddenButton(x+1,y+1,width-2,FH-2,id); DefineHiddenButton(x+1,y+1,width-2,FH-2,id);
WriteText(-strlen(text)*6+width/2+x+2,FH/2+y-2,0x80,0x444444,text); WriteText(-strlen(text)*6+width/2+x+8,FH/2+y-2,0x80,0x444444,text);
$sub ebx, 1 <<16 + 1 $sub ebx, 1 <<16 + 1
$add ecx, 0xFFFfff-0x444444 $add ecx, 0xFFFfff-0x444444
$int 64 $int 64

View File

@ -27,16 +27,16 @@
?define T_ABOUT "Ž ¯à®£à ¬¬¥" ?define T_ABOUT "Ž ¯à®£à ¬¬¥"
?define T_USE_SHIFT_ENTER "'ˆá¯®«ì§ã©â¥ Shift+Enter çâ®¡ë ®âªàëâì ¢á¥ ¢ë¤¥«¥­­ë¥ ä ©«ë.' -I" ?define T_USE_SHIFT_ENTER "'ˆá¯®«ì§ã©â¥ Shift+Enter çâ®¡ë ®âªàëâì ¢á¥ ¢ë¤¥«¥­­ë¥ ä ©«ë.' -I"
char *kfm_func = { char *kfm_func = {
"F1 ˆ­ä®", "ˆ­ä®",
"F2 <EFBFBD>¥à¥¨¬.", "<EFBFBD>¥à¥¨¬¥­.",
"F3 <20>à®á¬.", "<EFBFBD>à®á¬®âà",
"F4 <EFBFBD>¥¤ ªâ.", "<EFBFBD>¥¤ ªâ.",
"F5 Š®¯¨à®¢ âì", "Š®¯¨à®¢ âì",
"F6 <EFBFBD>¥à¥¬¥áâ¨âì", "<EFBFBD>¥à¥¬¥áâ¨âì",
"F7 <EFBFBD> ¯ª ", "<EFBFBD> ¯ª ",
"F8 “¤ «¨âì", "“¤ «¨âì",
"F9 ” ©«", "” ©«",
"F0 <20> áâனª¨" " <20> áâனª¨"
} }
#else #else
?define T_FILE "File" ?define T_FILE "File"
@ -68,16 +68,16 @@ char *kfm_func = {
?define T_ABOUT "About" ?define T_ABOUT "About"
?define T_USE_SHIFT_ENTER "'Use Shift+Enter to open all selected files.' -I" ?define T_USE_SHIFT_ENTER "'Use Shift+Enter to open all selected files.' -I"
char *kfm_func = { char *kfm_func = {
"F1 Info", "Info",
"F2 Rename", "Rename",
"F3 View", "View",
"F4 Edit", "Edit",
"F5 Copy", "Copy",
"F6 Move", "Move",
"F7 Folder", "Folder",
"F8 Delete", "Delete",
"F9 File", "File",
"F0 Settings" " Settings"
} }
#endif #endif