From 59530bcfc44a01a667e1a6f18121fc5c64b06aff Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 17 Apr 2019 12:11:31 +0000 Subject: [PATCH] Eolite 4.2: dark skins support git-svn-id: svn://kolibrios.org@7634 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 97 ++++++++++++++-------- programs/cmm/eolite/include/breadcrumbs.h | 21 +++-- programs/cmm/eolite/include/gui.h | 40 ++++----- programs/cmm/eolite/include/icons.h | 2 +- programs/cmm/eolite/include/left_panel.h | 23 ++--- programs/cmm/eolite/include/menu.h | 4 +- programs/cmm/eolite/include/settings.h | 54 ++++++++---- programs/cmm/eolite/include/translations.h | 4 +- 8 files changed, 150 insertions(+), 95 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index f5dbb91558..f0cacb4cf1 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -50,7 +50,24 @@ enum { ONLY_OPEN }; -dword col_selec, col_lpanel, col_work, col_graph, col_list_line=0xDDD7CF; +struct Eolite_colors +{ + dword lpanel; + dword list_vert_line; //vertical line between columns in list + dword selec; + dword selec_active; + dword selec_inactive; + dword selec_text; + dword work; + dword graph; + dword list_bg; + dword list_gb_text; + dword list_text_hidden; + dword work_gradient[24]; + dword slider_bg_big; + dword slider_bg_left; + dword odd_line; +} col; int toolbar_buttons_x[7]={9,46,85,134,167,203}; @@ -150,8 +167,12 @@ void main() Libimg_LoadImage(#icons16_default, "/sys/icons16.png"); Libimg_LoadImage(#icons16_selected, "/sys/icons16.png"); - Libimg_ReplaceColor(icons16_selected.image, icons16_selected.w, icons16_selected.h, 0xffFFFfff, col_selec); - Libimg_ReplaceColor(icons16_selected.image, icons16_selected.w, icons16_selected.h, 0xffCACBD6, MixColors(col_selec, 0, 200)); + Libimg_ReplaceColor(icons16_selected.image, icons16_selected.w, icons16_selected.h, 0xffFFFfff, col.selec); + Libimg_ReplaceColor(icons16_selected.image, icons16_selected.w, icons16_selected.h, 0xffCACBD6, MixColors(col.selec, 0, 200)); + if (col.list_bg!=0xFFFfff) { + Libimg_ReplaceColor(icons16_default.image, icons16_selected.w, icons16_selected.h, 0xffFFFfff, col.list_bg); + Libimg_ReplaceColor(icons16_default.image, icons16_selected.w, icons16_selected.h, 0xffCACBD6, MixColors(col.list_bg, 0, 200)); + } //-p just show file/folder properties dialog if (param) && (param[0]=='-') && (param[1]=='p') @@ -552,7 +573,7 @@ void main() void draw_window() { - int i; + dword i; if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0; DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,TITLE,0); GetProcessInfo(#Form, SelfInfo); @@ -561,21 +582,21 @@ void draw_window() if (!two_panels.checked) && (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; } if ( two_panels.checked) && (Form.width < 573) { MoveSize(OLD,OLD,573,OLD); return; } GetProcessInfo(#Form, SelfInfo); - ESDWORD[#toolbar_pal] = col_work; - ESDWORD[#toolbar_pal+4] = MixColors(0, col_work, 35); + ESDWORD[#toolbar_pal] = col.work; + ESDWORD[#toolbar_pal+4] = MixColors(0, col.work, 35); PutPaletteImage(#toolbar, 246, 34, 0, 0, 8, #toolbar_pal); - DrawBar(127, 8, 1, 25, col_graph); + DrawBar(127, 8, 1, 25, col.graph); for (i=0; i<3; i++) DefineHiddenButton(toolbar_buttons_x[i]+2,7,31-5,29-5,21+i); for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i], 5,31, 29, 21+i); - DrawBar(246,0, Form.cwidth - 246, 34, col_work); + DrawBar(246,0, Form.cwidth - 246, 34, col.work); DrawDot(Form.cwidth-17,12); DrawDot(Form.cwidth-17,12+6); DrawDot(Form.cwidth-17,12+12); DefineHiddenButton(Form.cwidth-24,7,20,25,51+BT_NOFRAME); //dots //main rectangles - DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,col_graph); - DrawRectangle(0,39,Form.cwidth-1,-show_status_bar.checked*status_bar_h + Form.cheight - 40,col_work_gradient[4]); //bg - for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_work_gradient[11-i]); + DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,col.graph); + DrawRectangle(0,39,Form.cwidth-1,-show_status_bar.checked*status_bar_h + Form.cheight - 40,col.work_gradient[4]); //bg + for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col.work_gradient[11-i]); llist_copy(#files_active, #files); strcpy(#active_path, #path); DrawStatusBar(); @@ -597,8 +618,8 @@ void DrawList() if (sort_type==2) sorting_arrow_x = files.x + files.w - 90; if (sort_type==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w; WriteText(sorting_arrow_x,files.y-12,0x80, system.color.work_text, sorting_arrow_t); - DrawBar(files.x+files.w,files.y,1,files.h,col_graph); - if (two_panels.checked) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,col_graph); + DrawBar(files.x+files.w,files.y,1,files.h,col.graph); + if (two_panels.checked) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,col.graph); } void DrawStatusBar() @@ -627,7 +648,7 @@ void DrawFilePanels() SystemDiscs.Get(); llist_copy(#files, #files_inactive); strcpy(#path, #inactive_path); - col_selec = 0xCCCccc; + col.selec = col.selec_inactive; SystemDiscs.Draw(); files_y = files.y; @@ -635,13 +656,13 @@ void DrawFilePanels() { llist_copy(#files, #files_inactive); strcpy(#path, #inactive_path); - col_selec = 0xCCCccc; //this is a bad code: need to use some var to set inactive panel for DrawList(); + col.selec = col.selec_inactive; //this is a bad code: need to use some var to set inactive panel for DrawList(); files.SetSizes(Form.cwidth/2, files_y, Form.cwidth/2 -17, Form.cheight-files_y-2 - status_bar_h, files.item_h); DrawList(); Open_Dir(#path,WITH_REDRAW); llist_copy(#files, #files_active); strcpy(#path, #active_path); - col_selec = 0x94AECE; + col.selec = col.selec_active; files.SetSizes(2, files_y, Form.cwidth/2-2-17, Form.cheight-files_y-2 - status_bar_h, files.item_h); DrawList(); Open_Dir(#path,WITH_REDRAW); @@ -653,7 +674,7 @@ void DrawFilePanels() Open_Dir(#path,WITH_REDRAW); llist_copy(#files, #files_active); strcpy(#path, #active_path); - col_selec = 0x94AECE; + col.selec = col.selec_active; files.SetSizes(Form.cwidth/2, files_y, Form.cwidth/2 -17, Form.cheight-files_y-2 - status_bar_h, files.item_h); DrawList(); Open_Dir(#path,WITH_REDRAW); @@ -679,24 +700,27 @@ void List_ReDraw() } if (old_cur_y != files.cur_y) { - if (old_cur_y-files.firsticon_size) DrawBar(files.x+4,icon_y+icon_size-1,icon_size,y+files.item_h-icon_y-icon_size+1,bgcol); - if (colored_lines.checked) && (bgcol!=col_selec) && (filenum%2) bgcol=0xF1F1F1; + if (colored_lines.checked) && (bgcol!=col.selec) && (filenum%2) bgcol=col.odd_line; DrawBar(files.x+icon_size+4,y,files.w-icon_size-4,files.item_h,bgcol); file_offet = file_mas[filenum+files.first]*304 + buf+32; @@ -747,29 +771,31 @@ void Line_ReDraw(dword bgcol, filenum){ ext1 = strrchr(file_name_off,'.') + file_name_off; if (ext1==file_name_off) ext1 = NULL; //if no extension then show nothing file_size = ConvertSize64(file.sizelo, file.sizehi); - if (ext1) && (strlen(ext1)<9) WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, 0, ext1); + if (ext1) && (strlen(ext1)<9) WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1); } else { if (!strcmp(file_name_off,"..")) ext1=""; else { ext1=""; - WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, 0, ext1); + WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1); } if (chrnum(#path, '/')==1) file_size = GetDeviceSizeLabel(#temp_path); } if (file_size) WriteText(7-strlen(file_size)*6+files.x+files.w-58, - files.text_y+y+1, files.font_type, 0, file_size); + files.text_y+y+1, files.font_type, col.list_gb_text, file_size); DrawIconByExtension(#temp_path, ext1, files.x+4, icon_y, bgcol); - if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden? - if (bgcol==col_selec) + if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=col.list_text_hidden; //system or hiden? + if (bgcol==col.selec) { file_name_is_8_3(file_name_off); itdir = TestBit(attr, 4); strcpy(#file_name, file_name_off); if (!strcmp(#path,"/")) sprintf(#file_path,"%s%s",#path,file_name_off); else sprintf(#file_path,"%s/%s",#path,file_name_off); - if (text_col==0xA6A6B7) text_col=0xFFFFFF; + if (text_col==col.list_text_hidden) { + text_col=MixColors(col.selec_text, col.list_text_hidden, 65); + } else text_col=col.selec_text; } if (file.selected) text_col=0xFF0000; if (kfont.size.pt==9) || (!kfont.font) @@ -795,10 +821,11 @@ void Line_ReDraw(dword bgcol, filenum){ } strcpy(#label_file_name+strlen(#label_file_name)-2, "..."); } - kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y, bgcol, text_col, kfont.size.pt, #label_file_name); + kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y, + bgcol, text_col, kfont.size.pt, #label_file_name); } - DrawBar(files.x+files.w-141,y,1,files.item_h,col_list_line); //gray line 1 - DrawBar(files.x+files.w-68,y,1,files.item_h,col_list_line); //gray line 2 + DrawBar(files.x+files.w-141,y,1,files.item_h,col.list_vert_line); //gray line 1 + DrawBar(files.x+files.w-68,y,1,files.item_h,col.list_vert_line); //gray line 2 } diff --git a/programs/cmm/eolite/include/breadcrumbs.h b/programs/cmm/eolite/include/breadcrumbs.h index 3f79e484b0..dc893e76ad 100644 --- a/programs/cmm/eolite/include/breadcrumbs.h +++ b/programs/cmm/eolite/include/breadcrumbs.h @@ -3,13 +3,15 @@ PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, void DrawPathBar() { PathShow.area_size_x = Form.cwidth-300; - DrawBar(PathShow.start_x-3, PathShow.start_y-6, PathShow.area_size_x+3, 19, 0xFFFfff); - DrawRectangle(PathShow.start_x-4,PathShow.start_y-7,PathShow.area_size_x+4,20,col_graph); + 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,col.graph); DefineHiddenButton(PathShow.start_x-4+1,PathShow.start_y-7+1,PathShow.area_size_x+4-2,20-2,PATH_BTN); DrawBar(PathShow.start_x-4, PathShow.start_y+14, PathShow.area_size_x+5+18, 1, system.color.work_light); 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_prepare stdcall(#PathShow); PathShow_draw stdcall(#PathShow); } @@ -44,7 +46,7 @@ void DrawBreadCrumbs() //DrawFavButton(btn.x); //btn.x+=20; btn.x++; - DrawBar(btn.x,btn.y-1,Form.cwidth-btn.x-25,btn.h+3,col_work); + DrawBar(btn.x,btn.y-1,Form.cwidth-btn.x-25,btn.h+3,col.work); } @@ -59,16 +61,13 @@ void ClickOnBreadCrumb(unsigned clickid) } -dword col_palette_br[14] = {0xFFFfff,0xF3EDF0,0xF3EDF0,0xF3EDF0,0xF3EDF0, - 0xF2EBEF,0xF2EBEF, - 0xF0EAEC,0xEFE9EB,0xEDE6E9,0xEAE6E8,0xE9E4E6,0xE5E0E3,0xE3DDDE,0xE0DBDB, - 0xDFDADA,0xDBD9DA,0xD2D0D2,0xC2C6C6}; void DrawBreadcrumbButton(dword x,y,w,h,id,text) { int i; - DrawRectangle(x,y,w,h,col_graph); - for (i=0; i sc_h-sc_slider_y+56) || (files.first+files.visible>=files.count) sc_slider_y= sc_y + sc_h - sc_slider_h - 1; //для большого списка } //slider - DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,col_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, system.color.work_light , system.color.work_dark); - if (!scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col_work_gradient[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_work_gradient[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.work_gradient[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.work_gradient[i]); //area before slider if (sc_slider_y > sc_y + 1) { - DrawBar(sc_x+1, sc_y, 15, 1, 0xC7C9C9); - DrawBar(sc_x+1, sc_y+1, 1, sc_slider_y-sc_y-1, 0xC7C9C9); - DrawBar(sc_x+2, sc_y+1, 14, sc_slider_y-sc_y-1, 0xCED0D0); + DrawBar(sc_x+1, sc_y, 15, 1, col.slider_bg_left); + DrawBar(sc_x+1, sc_y+1, 1, sc_slider_y-sc_y-1, col.slider_bg_left); + DrawBar(sc_x+2, sc_y+1, 14, sc_slider_y-sc_y-1, col.slider_bg_big); } //area after slider if (sc_h-sc_slider_h+sc_y-2>sc_slider_y) { - DrawBar(sc_x+1, sc_slider_y + sc_slider_h+1, 15, 1, 0xC7C9C9); - DrawBar(sc_x+1, sc_slider_y + sc_slider_h+2, 1, sc_h-sc_slider_h-sc_slider_y+sc_y-2, 0xC7C9C9); - DrawBar(sc_x+2, sc_slider_y + sc_slider_h+2, 14, sc_h-sc_slider_h-sc_slider_y+sc_y-2, 0xCED0D0); + DrawBar(sc_x+1, sc_slider_y + sc_slider_h+1, 15, 1, col.slider_bg_left); + DrawBar(sc_x+1, sc_slider_y + sc_slider_h+2, 1, sc_h-sc_slider_h-sc_slider_y+sc_y-2, col.slider_bg_left); + DrawBar(sc_x+2, sc_slider_y + sc_slider_h+2, 14, sc_h-sc_slider_h-sc_slider_y+sc_y-2, col.slider_bg_big); } } void DrawFlatButtonSmall(dword x,y,width,height,id,text) { - DrawRectangle(x,y,width,height,col_graph); - DrawRectangle3D(x+1,y+1,width-2,height-2, system.color.work_light , system.color.work_dark); + DrawRectangle(x,y,width,height,col.graph); + DrawRectangle3D(x+1,y+1,width-2,height-2, system.color.work_light, system.color.work_dark); PutPixel(x+width-1, y+1, system.color.work_dark); DrawFilledBar(x+2, y+2, width-3, height-3); if (id) DefineHiddenButton(x+1,y+1,width-2,height-2,id); @@ -55,9 +53,11 @@ void DrawFlatButtonSmall(dword x,y,width,height,id,text) void DrawFilledBar(dword x, y, w, h) { int i, fill_h; - if (h <= 14) fill_h = h; else fill_h = 14; - for (i=0; i=65) + { + //use light colors + col.list_bg = 0xFFFfff; + col.list_gb_text = 0x000000; + col.list_text_hidden = 0xA6A6B7; + col.list_vert_line = 0xDDD7CF; + col.work = system.color.work; + col.graph = system.color.work_graph; + col.lpanel = 0x00699C; + col.selec = col.selec_active = 0x94AECE; + col.selec_text = 0x000000; + system.color.work_dark = MixColors(0, system.color.work, 35); + col.slider_bg_big = 0xCDCFCF; + col.odd_line = 0xF1F1F1; + } + else + { + //use dark colors + col.list_bg = system.color.work; + col.list_gb_text = system.color.work_text; + col.list_text_hidden = 0xA6A6B7; + col.list_vert_line = system.color.work_graph; + col.work = system.color.work; + col.graph = system.color.work_graph; + col.lpanel = MixColors(system.color.work_graph, system.color.work, 65); + col.selec = col.selec_active = system.color.work_button; + col.selec_text = system.color.work_button_text; + system.color.work_dark = MixColors(0, system.color.work, 35); + if (col.list_bg==col.selec) col.selec = system.color.work_graph; //for fucking skins + col.slider_bg_big = MixColors(0xCED0D0, system.color.work, 35); + col.odd_line = MixColors(0xFFFfff, system.color.work, 15); + } + col.selec_inactive = MixColors(0xBBBbbb, col.list_bg, 65); + col.slider_bg_left = MixColors(col.graph, col.slider_bg_big, 10); + for (i=0; i<=20; i++) col.work_gradient[20-i] = MixColors(0, system.color.work, i); } @@ -244,9 +270,9 @@ void BigIconsSwitch() Libimg_LoadImage(#icons32_default, "/sys/icons32.png"); Libimg_LoadImage(#icons32_selected, "/sys/icons32.png"); Libimg_ReplaceColor(icons32_default.image, icons32_selected.w, - icons32_selected.h, 0x00000000, 0xffFFFfff); + icons32_selected.h, 0x00000000, col.list_bg); Libimg_ReplaceColor(icons32_selected.image, icons32_selected.w, - icons32_selected.h, 0x00000000, col_selec); + icons32_selected.h, 0x00000000, col.selec); } } else { diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index 6855bd9a76..eec51f5f8c 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -1,5 +1,5 @@ -#define TITLE "Eolite File Manager 4.1" -#define ABOUT_TITLE "EOLITE 4.1" +#define TITLE "Eolite File Manager 4.2" +#define ABOUT_TITLE "EOLITE 4.2" #ifdef LANG_RUS ?define T_FILE "” ©«"