Eolite 1.63: fix scrollbar look when files count in folder ==0

git-svn-id: svn://kolibrios.org@3399 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2013-03-20 22:35:57 +00:00
parent 5aca7b692e
commit bb4381f81b
4 changed files with 26 additions and 12 deletions

View File

@ -25,7 +25,7 @@ int BUTTON_HEIGHT=18;
#define ONLY_OPEN 2
//ïåðåìåííûå
#define title "Eolite File Manager v1.62"
#define title "Eolite File Manager v1.63"
dword col_work = 0xE4DFE1;
dword col_border = 0x819FC5;
dword col_padding = 0xC8C9C9;

View File

@ -1,4 +1,4 @@
//Leency - 2008-2013
//Leency 2008-2013
#define EDITOR_PATH "/sys/tinypad"
#define BROWSER_PATH "/sys/htmlv"
@ -25,7 +25,7 @@ void about_dialog()
DefineAndDrawWindow(600,150,181,232+GetSkinHeight(),0x34,col_work,"About Eolite");
DrawBar(0,0,172,50,0x8494C4);
PutPaletteImage(#logo,85,85,43,7,8,#logo_pal);
WriteTextB(46,100,0x90,0xBF40BF,"Eolite v1.62");
WriteTextB(46,100,0x90,0xBF40BF,"Eolite v1.63");
WriteText(55,120,0x80,0,"Developers:");
WriteText(39,130,0x80,0,"Leency & Veliant");
WriteText(45,140,0x80,0,"KolibriOS Team");

View File

@ -1,3 +1,5 @@
//Leency 2008-2013
void Tip(int y, dword caption, id, arrow)
{
int i;
@ -10,7 +12,7 @@ void Tip(int y, dword caption, id, arrow)
}
path_string disk_list[20];
path_string disk_list[30];
int disc_num;
dword devbuf;
@ -21,7 +23,7 @@ void GetSystemDiscs()
disc_num=0;
if (devbuf) free(devbuf);
devbuf = malloc(3112); //áóôåð ãäå-òî íà 10 äåâàéñîâ â ëåâîé ïàíåëè
devbuf = malloc(10000); //áóôĺđ ăäĺ-ňî íŕ 10 äĺâŕéńîâ â ëĺâîé ďŕíĺëč
ReadDir(19, devbuf, "/");
dev_num = EBX;
for (i1=0; i1<dev_num; i1++)
@ -64,7 +66,7 @@ void DrawSystemDiscs()
{
case 'r':
dev_icon=0;
strcpy(#disc_name, "RAM disk ");
strcpy(#disc_name, "SYS disk ");
break;
case 'c':
dev_icon=1;
@ -79,6 +81,10 @@ void DrawSystemDiscs()
dev_icon=3;
strcpy(#disc_name, "Hard disk ");
break;
case 's':
dev_icon=3;
strcpy(#disc_name, "SATA disk ");
break;
case 'u':
dev_icon=5;
strcpy(#disc_name, "USB flash ");

View File

@ -1,4 +1,5 @@
//Leency - 2012
//Leency 2008-2013
dword onLeft(dword right,left) {EAX=Form.width-right-left;}
dword onTop(dword down,up) {EAX=Form.height-GetSkinHeight()-down-up;}
@ -31,11 +32,18 @@ dword col_palette[14] = {0xD2D3D3,0xD4D4D4,0xD6D5D6,0xD8D7D8,0xDAD8D9,0xDCDADB,
inline fastcall void TVScroll() { //Ïðîêðóòêà
dword on_y, i;
if (count<=0) {DrawFlatButton(onLeft(27,0),57,16,onTop(22,58),0,col_work,""); return;}
on_y = za_kadrom * onTop(22,57) / count +57;
scroll_size=onTop(22,57) * f_visible - f_visible / count;
if (scroll_size<20) scroll_size = 20; //óñòàíàâëèâàåì ìèíèìàëüíûé ðàçìåð ñêðîëëà
if (scroll_size>onTop(22,57)-on_y+56) || (za_kadrom+f_visible>=count) on_y=onTop(23+scroll_size,0); //äëÿ áîëüøîãî ñïèñêà
if (count<=0)
{
on_y = 57;
scroll_size = onTop(22,58);
}
else
{
on_y = za_kadrom * onTop(22,57) / count +57;
scroll_size=onTop(22,57) * f_visible - f_visible / count;
if (scroll_size<20) scroll_size = 20; //óñòàíàâëèâàåì ìèíèìàëüíûé ðàçìåð ñêðîëëà
if (scroll_size>onTop(22,57)-on_y+56) || (za_kadrom+f_visible>=count) on_y=onTop(23+scroll_size,0); //äëÿ áîëüøîãî ñïèñêà
}
DrawFlatButton(onLeft(27,0),on_y,16,scroll_size,0,-1,"");//ïîëçóíîê
if (!scroll_used) for (i=0; i<13; i++) DrawBar(onLeft(25-i,0), on_y+2, 1, scroll_size-3, col_palette[13-i]);
if (scroll_used) for (i=0; i<13; i++) DrawBar(onLeft(25-i,0), on_y+2, 1, scroll_size-3, col_palette[i]);