CMM: checkbox and morelessbox convex

Eolite: use system colors for some cases, better code for list click
TinyGl better icons

git-svn-id: svn://kolibrios.org@6191 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2016-02-11 01:07:04 +00:00
parent ef2476cf2f
commit 29cc7502e3
13 changed files with 66 additions and 56 deletions

View File

@ -30,7 +30,7 @@
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
enum {CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement
dword col_padding, col_selec, col_lpanel;
dword col_padding, col_selec, col_lpanel, col_work, col_graph;
int toolbar_buttons_x[7]={9,46,85,134,167,203};
@ -191,29 +191,25 @@ void main()
}
}
}
if (files.MouseOver(mouse.x, mouse.y))&&((mouse.down|mouse.dblclick|mouse.up))
if (files.MouseOver(mouse.x, mouse.y))
{
//select/open file {
if (mouse.key&MOUSE_LEFT)&&((mouse.down)||(mouse.dblclick))
//open
if (mouse.key&MOUSE_LEFT)&&(mouse.dblclick)
{
if (mouse.y>=files.y)//&&(mouse.click)
if (mouse.y - files.y / files.item_h + files.first < files.count)
{
id = mouse.y - files.y / files.item_h + files.first;
if (files.cur_y!=id)
{
mouse.clearTime();
if(!mouse.up)&&(id-files.first<files.visible) {
files.cur_y = id;
files.ProcessMouse(mouse.x, mouse.y);
List_ReDraw();
Open(0);
}
}
else IF(mouse.dblclick)Open(0);
//select file
else if (mouse.key&MOUSE_LEFT)&&((mouse.down)
{
if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw();
}
}
// } select/open file
else
//file menu {
if (mouse.key&MOUSE_RIGHT)&&(mouse.up)
//file menu
else if (mouse.key&MOUSE_RIGHT)&&(mouse.up)
{
menu_call_mouse = 1;
@ -226,7 +222,6 @@ void main()
}
break;
}
// } file menu
}
if (mouse.vert)
@ -538,23 +533,23 @@ void main()
void draw_window()
{
DefineAndDrawWindow(WinX+rand_n,WinY+rand_n,WinW,WinH,0x73,system.color.work,TITLE,0);
DefineAndDrawWindow(WinX+rand_n,WinY+rand_n,WinW,WinH,0x73,NULL,TITLE,0);
GetProcessInfo(#Form, SelfInfo);
if (Form.status_window>2) return;
if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; }
if (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; }
GetProcessInfo(#Form, SelfInfo); //if win_size changed
PutPaletteImage(#toolbar,246,34,0,0,8,#toolbar_pal);
DrawBar(127, 8, 1, 25, system.color.work_graph);
for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,system.color.work);
for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,system.color.work);
DrawBar(246,0,Form.cwidth - 297,12, system.color.work); //upper editbox
DrawBar(246,29,Form.cwidth - 297,5,system.color.work); //under editbox
DrawRectangle(246,12,Form.cwidth - 303,16,system.color.work_graph);
DrawBar(127, 8, 1, 25, col_graph);
for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,NULL);
for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,NULL);
DrawBar(246,0, Form.cwidth - 297,12, col_work); //upper editbox
DrawBar(246,29,Form.cwidth - 297,5, col_work); //lower editbox
DrawRectangle(246,12,Form.cwidth - 303,16,col_graph);
DefineButton(Form.cwidth - 32,6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
//main rectangles
DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42,system.color.work_graph);
DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42,col_graph);
DrawRectangle(0,39,Form.cwidth-1,Form.cheight - 40,col_palette[4]); //bg
for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);
llist_copy(#files_active, #files);
@ -575,9 +570,9 @@ void DrawList()
if (sort_num==1) sorting_arrow_x = files.w - 141 / 2 + files.x + 18;
if (sort_num==2) sorting_arrow_x = files.x + files.w - 90;
if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
WriteText(sorting_arrow_x,files.y-12,0x80,system.color.work_graph,"\x19");
DrawBar(files.x+files.w,files.y,1,files.h,system.color.work_graph);
if (two_panels) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,system.color.work_graph);
WriteText(sorting_arrow_x,files.y-12,0x80,col_graph,"\x19");
DrawBar(files.x+files.w,files.y,1,files.h,col_graph);
if (two_panels) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,col_graph);
}
void DrawFilePanels()
@ -1112,7 +1107,7 @@ void NewElement_Form(byte crt, dword strng)
new_file_ed.left = dform_x+24;
edit_box_draw stdcall (#new_file_ed);
DrawRectangle(new_file_ed.left-1, new_file_ed.top-1, new_file_ed.width+2, 16, 0xFFFfff);
DrawRectangle(new_file_ed.left-2, new_file_ed.top-2, new_file_ed.width+4, 18, system.color.work_graph);
DrawRectangle(new_file_ed.left-2, new_file_ed.top-2, new_file_ed.width+4, 18, col_graph);
}
void FnProcess(byte N)

View File

@ -1,5 +1,4 @@
unsigned char blue_hl[sizeof(file "imgs\blue_hl8.raw")]= FROM "imgs\blue_hl8.raw";
dword blue_hl_pal[]= {0x0001699C,0x0000699C,0x00026A9C,0x0002699C,
0x00036A9C,0x00046B9C,0x00046A9C,0x00056B9D,0x00046B9D,0x00066C9D,
0x00066C9E,0x00056C9D,0x00076D9E,0x00086E9F,0x00066D9E,0x00086D9E,
@ -23,3 +22,13 @@ unsigned char devices[18*204]= FROM "imgs\dev.raw";
unsigned char factions[14*39] = FROM "imgs\actions.raw";
unsigned char logo[] = FROM "imgs\logo.raw";
dword logo_pal = {0x0000FF00,0x007C047C,0x00940494,0x00903490,0x00B092AE,
0x00D43CD4,0x008B0C8B,0x00AE75AE,0x00DF6CDF,0x00AC14AC,0x00976993,
0x00CB47C8,0x00C434C4,0x00D444D4,0x00D44CD4,0x00DC58DC,0x00AA2CA9,
0x00840484,0x0095128D,0x00AA50AA,0x009C869C,0x00B41CB4,0x00A40CA4,
0x00B424B4,0x00CC3CCC,0x00925191,0x00BC2CBC,0x00C499C4,0x009C049C,
0x00C441B7,0x00967995,0x008C048C,0x007C1C7C,0x008A2689,0x00B72567,
0x00E96A1B,0x00B72491,0x00EC9404,0x00F69C04,0x00FCA404,0x00FCB404,
0x00FCB80A,0x00FCAC04,0x00AB1BAB,0x00940C94,0x009C0494,0x00770777,
0x00F4A404,0x00FCBD10,0x00FBBC17,0x00FCC417,0x00FCC628,0x00FCBE17,
0x00FBBD1F,0x00FCCC34,0x00FBB618,0x00B9A8B8};

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -43,7 +43,8 @@ void about_dialog()
DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,440,200+GetSkinHeight(),0x34,system.color.work,0);
GetProcessInfo(#about_form, SelfInfo);
if (about_form.status_window>2) break;
_PutImage(10, 23, 86, 86, #logo);
logo_pal[0] = system.color.work;
PutPaletteImage(#logo,86,86,10,23,8,#logo_pal);
WriteTextB(112,16,0x82,0xD49CD2,ABOUT_TITLE);
WriteTextB(110,14,0x82,0xBF40BF,ABOUT_TITLE);
WriteTextLines(110,53,10010000b,0,DEVELOPERS_TEXT,21);

View File

@ -23,7 +23,7 @@ void Scroll() {
if (sc_slider_h > sc_h-sc_slider_y+56) || (files.first+files.visible>=files.count) sc_slider_y= Form.cheight - 19 - sc_slider_h; //äëÿ áîëüøîãî ñïèñêà
}
//slider
DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,system.color.work_graph);
DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,col_graph);
DrawRectangle3D(sc_x+1,sc_slider_y+1,14,sc_slider_h-2,0xFEFEFE,col_padding);
if (!scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col_palette[13-i]);
if (scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col_palette[i]);
@ -45,7 +45,7 @@ void Scroll() {
void DrawFlatButton(dword x,y,width,height,id,text)
{
DrawRectangle(x,y,width,height,system.color.work_graph);
DrawRectangle(x,y,width,height,col_graph);
DrawRectangle3D(x+1,y+1,width-2,height-2,0xFEFEFE,col_padding);
PutPixel(x+width-1, y+1, col_padding);
DrawFilledBar(x+2, y+2, width-3, height-3);
@ -54,7 +54,7 @@ void DrawFlatButton(dword x,y,width,height,id,text)
WriteText(-strlen(text)*6+width/2+x+1,height/2+y-3,0x80,MixColors(system.color.work_text,0xFFFfff,210),text);
}
else {
DrawRectangle3D(x-1,y-1,width+2,height+2,system.color.work,MixColors(system.color.work,system.color.work_graph,200));
DrawRectangle3D(x-1,y-1,width+2,height+2,system.color.work,MixColors(system.color.work,col_graph,200));
WriteText(-strlen(text)*8+width/2+x+1,height/2+y-6,0x90,MixColors(system.color.work_text,0xFFFfff,210),text);
}
}
@ -76,7 +76,7 @@ void DrawEolitePopup(dword b1_text, b2_text)
int button_margin = form_w - b1_len - b2_len / 3;
int b1_x = dform_x + button_margin;
int b2_x = dform_x + button_margin + b1_len + button_margin;
DrawPopup(dform_x, 160, form_w, 90, 1, system.color.work, system.color.work_graph);
DrawPopup(dform_x, 160, form_w, 90, 1, system.color.work, col_graph);
DrawFlatButton(b1_x, 210, b1_len, 24, 301, b1_text);
DrawFlatButton(b2_x, 210, b2_len, 24, 302, b2_text);
}

View File

@ -201,10 +201,10 @@ void Tip(int y, dword caption, id, arrow)
{
DrawBar(17,y,160,1,0xEFEDEE);
DrawFilledBar(17, y+1, 160, 16);
WriteText(25,y+5,0x80,system.color.work_text,caption);
WriteText(25,y+5,0x80,0x000000,caption);
if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button
WriteText(165,y+5,0x80,system.color.work_text,arrow); //arrow
DrawBar(17,y+17,160,1,system.color.work_graph);
WriteText(165,y+5,0x80,0x000000,arrow); //arrow
DrawBar(17,y+17,160,1,col_graph);
}
void ActionsDraw()

View File

@ -88,7 +88,7 @@ void FileMenu()
if (menu_call_mouse) DefineAndDrawWindow(mouse.x+Form.left+5, mouse.y+Form.top+GetSkinHeight(),menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF);
else DefineAndDrawWindow(Form.left+files.x+15, files.item_h*files.cur_y+files.y+Form.top+30,menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF);
GetProcessInfo(#MenuForm, SelfInfo);
DrawRectangle(0,0,menu.w+1,menu.h+2,system.color.work_graph);
DrawRectangle(0,0,menu.w+1,menu.h+2,col_graph);
DrawBar(1,1,menu.w,1,0xFFFfff);
DrawPopupShadow(1,1,menu.w,menu.h,0);
MenuListRedraw();
@ -110,10 +110,10 @@ void MenuListRedraw()
}
else
{
DrawBar(2,start_y+2,menu.w-1,menu.item_h,system.color.work);
DrawBar(2,start_y+2,menu.w-1,menu.item_h,col_work);
WriteText(8,start_y+menu.text_y+4,menu.font_type,0xf2f2f2,file_captions[index*3]);
}
WriteText(7, start_y + menu.text_y + 3, menu.font_type, system.color.work_text, file_captions[index*3]);
WriteText(7, start_y + menu.text_y + 3, menu.font_type, 0, file_captions[index*3]);
WriteText(-strlen(file_captions[index*3+1])-1*menu.font_w + menu.w, start_y + menu.text_y + 3, menu.font_type, 0x888888, file_captions[index*3+1]);
start_y+=menu.item_h;
}

View File

@ -145,14 +145,17 @@ void Write_Error(int error_number)
void SetAppColors()
{
system.color.work = 0xE4DFE1;
system.color.work_text = 0;
system.color.work_graph = 0x7E87A3; //A0A0B8;
system.color.work_button = 0x7E87A3;
system.color.work_button_text = 0x000000;
system.color.get();
//system.color.work = 0xE4DFE1;
//system.color.work_text = 0;
//system.color.work_graph = 0x7E87A3; //A0A0B8;
//system.color.work_button = 0x7E87A3;
//system.color.work_button_text = 0x000000
col_work = 0xE4DFE1;
col_padding = 0xC8C9C9;
col_selec = 0x94AECE;
col_lpanel = 0x00699C;
col_graph = 0x7E87A3;
}

View File

@ -1,5 +1,5 @@
#define TITLE "Eolite File Manager v3.39"
#define ABOUT_TITLE "EOLITE 3.39"
#define TITLE "Eolite File Manager v3.4"
#define ABOUT_TITLE "EOLITE 3.4"
#ifdef LANG_RUS
?define T_FILE "” ©«"

View File

@ -81,13 +81,14 @@
else if (is_checked == 1)
{
DrawWideRectangle(x+1, y+1, w-1, h-1, 2, 0xffffff);
DrawBar(x+3, y+3, w-5, h-5, system.color.work_button); //0x13A113
DrawBar(x+3, y+3, w-5, h-5, 0x00C000); //0x13A113
}
else if (is_checked == 2) //not active
{
DrawWideRectangle(x+1, y+1, w-1, h-1, 2, 0xffffff);
DrawBar(x+3, y+3, w-5, h-5, 0x888888);
}
DrawRectangle3D(x-1,y-1,w+2,h+2,system.color.work_dark,system.color.work_light);
}
:void MoreLessBox(dword x,y, bt_id_more, bt_id_less, value, text)
@ -100,9 +101,10 @@
DrawBar(x+2, y+2, VALUE_FIELD_W-3, SIZE-3, 0xffffff);
WriteText(x+6, SIZE / 2 + y -3, 0x80, 0x000000, itoa(value));
DrawCaptButton(VALUE_FIELD_W + x + 1, y, SIZE, SIZE, bt_id_more, system.color.work_button, system.color.work_button_text, "+");
DrawCaptButton(VALUE_FIELD_W + x + SIZE + 2, y, SIZE, SIZE, bt_id_less, system.color.work_button, system.color.work_button_text, "-");
DrawCaptButton(VALUE_FIELD_W + x, y, SIZE, SIZE, bt_id_more, system.color.work_button, system.color.work_button_text, "+");
DrawCaptButton(VALUE_FIELD_W + x + SIZE, y, SIZE, SIZE, bt_id_less, system.color.work_button, system.color.work_button_text, "-");
WriteText(x+VALUE_FIELD_W+SIZE+SIZE+10, SIZE / 2 + y -3, 0x80, system.color.work_text, text);
DrawRectangle3D(x-1,y-1,VALUE_FIELD_W+SIZE+SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light);
}
:void DrawProgressBar(dword st_x, st_y, st_w, st_h, col_fon, col_border, col_fill, col_text, progress_percent)

View File

@ -6,8 +6,8 @@
dword
nonset1,
nonset2,
work_light,
work_dark,
work_light,
nonset3,
work,
work_button,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1011 B

After

Width:  |  Height:  |  Size: 1.3 KiB