Eolite 5.12: show disk names if available, replace hardcoded numbers of the left sidebar by constants

git-svn-id: svn://kolibrios.org@9349 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-12-01 13:48:58 +00:00
parent dd931d8400
commit f0b73bb5f3
5 changed files with 53 additions and 30 deletions

View File

@ -10,13 +10,13 @@ X ;
oc ; опримизация по размеру кода oc ; опримизация по размеру кода
w ; выдавать предупреждения ;w ; выдавать предупреждения
wf=warning.txt ; предупреждения выводить в файл warning ;wf=warning.txt ; предупреждения выводить в файл warning
nw=1 ; не показывать кое-какие ошибки в warning.txt ;nw=1 ; не показывать кое-какие ошибки в warning.txt
nw=2 ; не показывать кое-какие ошибки в warning.txt ;nw=2 ; не показывать кое-какие ошибки в warning.txt
;de ; использовать временное расширение типа при делении ;de ; использовать временное расширение типа при делении

View File

@ -9,9 +9,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.11" #define ABOUT_TITLE "EOLITE 5.12"
#define TITLE_EOLITE "Eolite File Manager 5.11" #define TITLE_EOLITE "Eolite File Manager 5.12"
#define TITLE_KFM "Kolibri File Manager 2.11"; #define TITLE_KFM "Kolibri File Manager 2.12";
#define MEMSIZE 1024 * 250 #define MEMSIZE 1024 * 250
#include "../lib/clipboard.h" #include "../lib/clipboard.h"
@ -662,7 +662,7 @@ void DrawFilePanels()
if (!efm) if (!efm)
{ {
SystemDiscs.Draw(); SystemDiscs.Draw();
files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59 - status_bar_h, files.item_h); files.SetSizes(SIDEBAR_W, 57, Form.cwidth - SIDEBAR_W-18, Form.cheight - 59 - status_bar_h, files.item_h);
DrawButtonsAroundList(); DrawButtonsAroundList();
List_ReDraw(); List_ReDraw();
DrawPathBar(); DrawPathBar();
@ -1128,7 +1128,7 @@ void ShowPopinForm(byte _popin_type)
strcat(#param, "...?"); strcat(#param, "...?");
} }
} }
WriteTextCenter(popinx, 192, POPIN_W, sc.work_text, #param); WriteTextCenter(popinx, SIDEBAR_W, POPIN_W, sc.work_text, #param);
break; break;
case POPIN_DISK: case POPIN_DISK:
DefineHiddenButton(0,0,5000,3000,POPUP_BTN2+BT_NOFRAME); DefineHiddenButton(0,0,5000,3000,POPUP_BTN2+BT_NOFRAME);

View File

@ -256,5 +256,12 @@ char *devinfo = {
#define KFM2_DEVH 20 #define KFM2_DEVH 20
#define SELECTY 10 #define SELECTY 10
#define POPIN_W 260 #define POPIN_W 260
//Sidebar width
#define SIDEBAR_W 192
//Sidebar padding
#define SBPAD 15
//Block width inside Sidebar
#define SB_BLOCKX SBPAD+2
#define SB_BLOCKW SIDEBAR_W-SBPAD-SB_BLOCKX
int toolbar_buttons_x[7]={9,46,85,134,167,203}; int toolbar_buttons_x[7]={9,46,85,134,167,203};

View File

@ -114,11 +114,11 @@ void DrawFuncButton(dword x,y,width,id,number,text)
void Tip(int y, dword caption, id, arrow) void Tip(int y, dword caption, id, arrow)
{ {
DrawBar(17,y,160,1,col.list_bg); DrawBar(SB_BLOCKX,y,SB_BLOCKW,1,col.list_bg);
DrawBar(17,y+1,1,16,sc.work_light); DrawBar(SB_BLOCKX,y+1,1,16,sc.work_light);
DrawFilledBar(18, y+1, 160-1, 16); DrawFilledBar(SB_BLOCKX+1, y+1, SB_BLOCKW-1, 16);
DrawBar(17,y+17,160,1,sc.work_graph); DrawBar(SB_BLOCKX,y+SB_BLOCKX,SB_BLOCKW,1,sc.work_graph);
WriteText(25,y+5,0x80,col.list_gb_text,caption); WriteText(SB_BLOCKX+8,y+5,0x80,col.list_gb_text,caption);
if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button
WriteText(165,y+5,0x80,col.list_gb_text,arrow); //arrow WriteText(165,y+5,0x80,col.list_gb_text,arrow); //arrow
} }
@ -129,10 +129,10 @@ void ActionsDraw(int actions_y)
Tip(actions_y-18, T_ACTIONS, 77, ""); Tip(actions_y-18, T_ACTIONS, 77, "");
for (i=0; actions[i*3]!=0; i++, actions_y+=DEV_H) for (i=0; actions[i*3]!=0; i++, actions_y+=DEV_H)
{ {
DrawBar(17,actions_y,160,DEV_H,0xFFFFFF); //áåëîå DrawBar(SB_BLOCKX,actions_y,SB_BLOCKW,DEV_H,0xFFFFFF); //áåëîå
DefineButton(17,actions_y,159,DEV_H,actions[i*3]+BT_HIDE,0xE4DFE1); DefineButton(SB_BLOCKX,actions_y,SB_BLOCKW-1,DEV_H,actions[i*3]+BT_HIDE,0xE4DFE1);
WriteText(45,actions_y+4,0x80,0,actions[i*3+1]); WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]); WriteText(-strlen(actions[i*3+2])*6+SIDEBAR_W-SBPAD-7,actions_y+4,0x80,0x999999,actions[i*3+2]);
_PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions); _PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
} }
} }
@ -141,21 +141,21 @@ void DrawLeftPanelBg(int actions_y)
{ {
int start_y = actions_y+159; int start_y = actions_y+159;
int area_h; int area_h;
DrawBar(2,41,190,15,waves_pal[0]); //above devices block DrawBar(2,41,SIDEBAR_W-2,SBPAD,waves_pal[0]); //above devices block
DrawBar(17,actions_y+75,160,15,EDX); //below devices block DrawBar(SB_BLOCKX,actions_y+75,SB_BLOCKW,SBPAD,EDX); //below devices block
DrawBar(2,56,15,actions_y+103,EDX); //on the left DrawBar(2,56,SBPAD,actions_y+103,EDX); //on the left
DrawBar(177,56,15,actions_y+103,EDX); //on the right DrawBar(SIDEBAR_W-SBPAD,56,SBPAD,actions_y+103,EDX); //on the right
area_h = Form.cheight-start_y-2 - status_bar_h; area_h = Form.cheight-start_y-2 - status_bar_h;
if (area_h < 268){ if (area_h < 268){
PutPaletteImage(#blue_hl, 190, area_h, 2, start_y, 8, #waves_pal); PutPaletteImage(#blue_hl, 190, area_h, 2, start_y, 8, #waves_pal);
} else { } else {
DrawBar(2,start_y,190, area_h-268, waves_pal[0]); DrawBar(2,start_y,SIDEBAR_W-2, area_h-268, waves_pal[0]);
PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270-status_bar_h, 8, #waves_pal); PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270-status_bar_h, 8, #waves_pal);
} }
PutShadow(17,actions_y+75,160,1,1,3); PutShadow(SB_BLOCKX,actions_y+75,SB_BLOCKW,1,1,3);
PutShadow(18,actions_y+75+1,158,1,1,1); PutShadow(SB_BLOCKX+1,actions_y+75+1,SB_BLOCKW-2,1,1,1);
PutShadow(17,start_y,160,1,1,3); PutShadow(SB_BLOCKX,start_y,SB_BLOCKW,1,1,3);
PutShadow(18,start_y+1,158,1,1,1); PutShadow(SB_BLOCKX+1,start_y+1,SB_BLOCKW-2,1,1,1);
} }
//===================================================// //===================================================//

View File

@ -49,17 +49,27 @@ void _SystemDiscs::Get()
free(diskbuf); free(diskbuf);
} }
void GetDiskIconAndName(dword dev_name, dev_icon, disc_name) void GetDiskIconAndName(dword dev_name, icon, disc_name)
{ {
int i; int i;
dword volume_label;
for (i=0; devinfo[i]!=0; i+=3) { for (i=0; devinfo[i]!=0; i+=3) {
if (!strncmp(dev_name+1, devinfo[i], 2)) { if (!strncmp(dev_name+1, devinfo[i], 2)) {
ESBYTE[dev_icon] = devinfo[i+1]; ESBYTE[icon] = devinfo[i+1];
if (volume_label = GetVolumeLabel(dev_name))
{
//show label only for hard disk drives
if (ESBYTE[icon]==4) {
strncpy(disc_name, volume_label, 15);
chrcat(disc_name, ' ');
return;
}
}
strcpy(disc_name, devinfo[i+2]); strcpy(disc_name, devinfo[i+2]);
return; return;
} }
} }
ESBYTE[dev_icon]=5; ESBYTE[icon]=4;
strcpy(disc_name, T_UNC); strcpy(disc_name, T_UNC);
} }
@ -89,7 +99,13 @@ void _SystemDiscs::Draw()
DefineHiddenButton(draw_x,draw_y,159,16,100+i); DefineHiddenButton(draw_x,draw_y,159,16,100+i);
if (show_dev_name.checked) if (show_dev_name.checked)
{ {
if (dev_name[1]=='t') {
chrcat(#disc_name, dev_name[4]);
} else if (dev_name[1]=='f') {
//
} else {
strcat(#disc_name, #dev_name); strcat(#disc_name, #dev_name);
}
if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name); if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name);
WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name); WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name);
//if (is_active) kfont.bold = true; //if (is_active) kfont.bold = true;