From 383b55f4be1ba094176bb993a8b9443bd7f5d3c2 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 19 Aug 2015 11:14:15 +0000 Subject: [PATCH] Eolite 3.05: use sizable fonts *.kf git-svn-id: svn://kolibrios.org@5745 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/end/compile_en.bat | 9 +++++ programs/cmm/end/compile_ru.bat | 10 +++++ programs/cmm/eolite/Eolite.c | 25 +++++++----- programs/cmm/eolite/include/settings.h | 26 +++++-------- programs/cmm/eolite/include/translations.h | 4 +- programs/cmm/lib/font.h | 44 ++++++++++++++++++---- programs/cmm/lib/io.h | 6 ++- 7 files changed, 87 insertions(+), 37 deletions(-) create mode 100644 programs/cmm/end/compile_en.bat create mode 100644 programs/cmm/end/compile_ru.bat diff --git a/programs/cmm/end/compile_en.bat b/programs/cmm/end/compile_en.bat new file mode 100644 index 0000000000..2042e60989 --- /dev/null +++ b/programs/cmm/end/compile_en.bat @@ -0,0 +1,9 @@ +@del lang.h-- +@echo #define LANG_ENG 1 >lang.h-- + +c-- end.c +@del end +@rename end.com end +@del warning.txt +@del lang.h-- +@pause \ No newline at end of file diff --git a/programs/cmm/end/compile_ru.bat b/programs/cmm/end/compile_ru.bat new file mode 100644 index 0000000000..0c52539668 --- /dev/null +++ b/programs/cmm/end/compile_ru.bat @@ -0,0 +1,10 @@ +@del lang.h-- +@echo #define LANG_RUS 1 >lang.h-- + +c-- end.c +@del end +@rename end.com end +@del warning.txt +@del lang.h-- +@pause +kpack end \ No newline at end of file diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 207d625240..29475ec713 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -130,7 +130,6 @@ void main() Open_Dir(#path,ONLY_OPEN); strcpy(#inactive_path, #path); llist_copy(#files_inactive, #files); - //font.load("/sys/font/Verdana.kf"); SetEventMask(1100111b); loop(){ switch(WaitEvent()) @@ -688,15 +687,23 @@ void Line_ReDraw(dword color, filenum){ if (text_col==0xA6A6B7) text_col=0xFFFFFF; } if (file.selected) text_col=0xFF0000; - if (Form.width>=480) + if (font_size==9) || (!font.data) { - FileShow.start_x = files.x + 23; - FileShow.font_color = text_col; - FileShow.area_size_x = files.w - 164; - FileShow.text_pointer = file_name_off; - FileShow.start_y = files.text_y + y; - PathShow_prepare stdcall(#FileShow); - PathShow_draw stdcall(#FileShow); + if (Form.width>=480) + { + FileShow.start_x = files.x + 23; + FileShow.font_color = text_col; + FileShow.area_size_x = files.w - 164; + FileShow.text_pointer = file_name_off; + FileShow.start_y = files.text_y + y; + PathShow_prepare stdcall(#FileShow); + PathShow_draw stdcall(#FileShow); + } + } + else + { + font.bg_color = color; + font.text(files.x + 23, files.line_h - font.height / 2 - 1 + y, file_name_off, 0, font_size); } DrawBar(files.x+files.w-141,y,1,files.line_h,system.color.work); //gray line 1 DrawBar(files.x+files.w-68,y,1,files.line_h,system.color.work); //gray line 2 diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index fb6f5c3ffd..2df984adb8 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -47,8 +47,8 @@ void settings_dialog() else if (id==26) && (files.line_h>18) files.line_h--; else if (id==27) MOUSE_TIME++; else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--; - else if (id==30) && (font_size<30) { font_size++; BigFontsChange(); } - else if (id==31) && (font_size>10) { font_size--; BigFontsChange(); } + else if (id==30) && (font_size<22) { font_size++; BigFontsChange(); } + else if (id==31) && (font_size>9) { font_size--; BigFontsChange(); } SaveIniSettings(); EventRedrawWindow(Form.left,Form.top); DrawSettingsCheckBoxes(); @@ -81,9 +81,9 @@ void DrawSettingsCheckBoxes() CheckBox2(10, 33, 21, SHOW_REAL_NAMES, real_files_names_case); CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy); CheckBox2(10, 77, 24, USE_TWO_PANELS, two_panels); - MoreLessBox(10, 103, 18, 30, 31, #system.color, font_size, FONT_SIZE_LABEL); + MoreLessBox(10, 103, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK); MoreLessBox(10, 130, 18, 25, 26, #system.color, files.line_h, LIST_LINE_HEIGHT); - MoreLessBox(10, 157, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK); + if (font.data) MoreLessBox(10, 157, 18, 30, 31, #system.color, font_size, FONT_SIZE_LABEL); } @@ -98,6 +98,8 @@ void LoadIniSettings() ini_get_int stdcall (eolite_ini_path, #confir_section, "LineHeight", 18); files.line_h = EAX; ini_get_int stdcall (eolite_ini_path, #confir_section, "TimeDoubleClick", 50); MOUSE_TIME = EAX; BigFontsChange(); + font.no_bg_copy = true; + font.load("/sys/font/Tahoma.kf"); } @@ -142,19 +144,11 @@ void BigFontsChange() { files.line_h = font.height + 4; if (files.line_h<18) files.line_h = 18; + files_active.line_h = files_inactive.line_h = files.line_h; - if (font_size!=9) - { - files.SetFont(8, 14, 10110000b); - FileShow.font_size_x = files.font_w; - FileShow.font_number = 3; - } - else - { - files.SetFont(6, 6, 10000000b); - FileShow.font_size_x = files.font_w; - FileShow.font_number = 0; - } + files.SetFont(6, 6, 10000000b); + FileShow.font_size_x = files.font_w; + FileShow.font_number = 0; } diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index bbde2efe2b..40c7dbdc67 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -1,5 +1,5 @@ -#define TITLE "Eolite File Manager v3.01" -#define ABOUT_TITLE "Eolite 3.01" +#define TITLE "Eolite File Manager v3.05" +#define ABOUT_TITLE "Eolite 3.05" #ifdef LANG_RUS ?define T_FILE "” ©«" diff --git a/programs/cmm/lib/font.h b/programs/cmm/lib/font.h index fd675d1bfc..5d98b5641f 100644 --- a/programs/cmm/lib/font.h +++ b/programs/cmm/lib/font.h @@ -23,12 +23,14 @@ byte load(...); byte symbol(word x;byte s;dword c); byte symbol_size(byte s); - dword text(word x,y;dword text,c;byte size); + dword text(word x,y;dword text1,c;byte size); dword text_width(dword text1;byte size); dword textarea(word x,y;dword text,c;byte size); byte changeSIZE(byte size); void PixelRGB(word x,y); dword tmp_y,tmp_height,tmp_x; + byte no_bg_copy; + dword bg_color; }; FONT font = 0; @@ -128,12 +130,31 @@ FONT font = 0; c>>=16; AX = c; b = AL; - width_buffer = width; - width_buffer *= strlen(text1); - IF(!buffer_size)buffer = malloc(width_buffer*height*3); - ELSE IF(buffer_size