From d1fc8762766afe7f73e40e8c12c2251b2075d8c1 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Thu, 6 Aug 2015 16:13:03 +0000 Subject: [PATCH] Eolite 2.93: fix for option "Use big fonts", supports only English characters yet git-svn-id: svn://kolibrios.org@5687 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 11 +++---- programs/cmm/eolite/include/icons.h | 6 ++-- programs/cmm/eolite/include/settings.h | 40 +++++++++++++++----------- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 0a19358144..4dec8af26b 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -103,8 +103,8 @@ enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir enum { CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement -#define TITLE "Eolite File Manager v2.92" -#define ABOUT_TITLE "Eolite 2.92" +#define TITLE "Eolite File Manager v2.93" +#define ABOUT_TITLE "Eolite 2.93" dword col_padding, col_selec, col_lpanel; int toolbar_buttons_x[7]={9,46,85,134,167,203}; @@ -132,6 +132,7 @@ byte real_files_names_case=0, use_big_fonts=0, font_type, + font_h, info_after_copy=0, sort_num=2, itdir; @@ -743,7 +744,7 @@ void Line_ReDraw(dword color, filenum){ if (! TestBit(attr, 4) ) //file or folder? { Put_icon(file_name_off+_strrchr(file_name_off,'.'), files.x+3, files.line_h/2-7+y, color, 0); - WriteText(7-strlen(ConvertSize(file.sizelo))*6+Form.cwidth - 76,files.line_h-6/2+y,font_type,0,ConvertSize(file.sizelo)); + WriteText(7-strlen(ConvertSize(file.sizelo))*6+Form.cwidth - 76, files.line_h - font_h/ 2 + y,font_type,0,ConvertSize(file.sizelo)); } else { @@ -764,9 +765,9 @@ void Line_ReDraw(dword color, filenum){ { FileShow.start_x = files.x + 23; FileShow.font_color = text_col; - FileShow.area_size_x = Form.width - 380; + FileShow.area_size_x = files.w - 164; FileShow.text_pointer = file_name_off; - FileShow.start_y = files.text_y+y; + FileShow.start_y = files.line_h - font_h/ 2 + y; PathShow_prepare stdcall(#FileShow); PathShow_draw stdcall(#FileShow); } diff --git a/programs/cmm/eolite/include/icons.h b/programs/cmm/eolite/include/icons.h index 0e79bfa1ad..5639597628 100644 --- a/programs/cmm/eolite/include/icons.h +++ b/programs/cmm/eolite/include/icons.h @@ -29,7 +29,7 @@ char *ext[]={ void Put_icon(dword extension, xx, yy, fairing_color, icon_n) { - int i, font_half_width; + int i, font_half_height; if (extension) for (i=0; ext[i]!=0; i+=2;) { @@ -43,8 +43,8 @@ void Put_icon(dword extension, xx, yy, fairing_color, icon_n) ficons_pal[0] = fairing_color; PutPaletteImage(icon_n*16*15+#ficons,16,15,xx,yy,8,#ficons_pal); if (fairing_color!=0xFFFfff) IconFairing(icon_n, xx, yy, fairing_color); - if (use_big_fonts) font_half_width=4; else font_half_width=3; - if (icon_n!=17) && (strlen(extension)<9) WriteText(-strlen(extension)*font_half_width+Form.cwidth-120,yy+4,font_type,0,extension); + if (use_big_fonts) font_half_height=0; else font_half_height=4; + if (icon_n!=17) && (strlen(extension)<9) WriteText(-FileShow.font_size_x/2*strlen(extension)+Form.cwidth-121,yy+font_half_height,font_type,0,extension); } diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index 366e7ed31e..5a4cf4f8aa 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -7,7 +7,7 @@ ?define TITLE_SETT "Настройки" ?define SHOW_DEVICE_CLASS "Выводить названия класса устройств" ?define SHOW_REAL_NAMES "Показывать имена файлов не меняя регистр" - ?define USE_BIG_FONTS "Использовать увеличенные шрифты" + ?define USE_BIG_FONTS "Большой шрифт (только английские символы!)" ?define LIST_LINE_HEIGHT "Высота строки в списке" ?define NOTIFY_COPY_END "Уведомлять о завершении копирования" ?define CANCEL_T "Отмена" @@ -18,7 +18,7 @@ ?define TITLE_SETT "Settings" ?define SHOW_DEVICE_CLASS "Show device class name" ?define SHOW_REAL_NAMES "Show real file names without changing case" - ?define USE_BIG_FONTS "Use big fonts" + ?define USE_BIG_FONTS "Use big fonts (English characters only!)" ?define LIST_LINE_HEIGHT "List line height" ?define NOTIFY_COPY_END "Notify when copying finished" ?define CANCEL_T "Cancel" @@ -86,7 +86,7 @@ void settings_dialog() else if (id==20) show_dev_name ^= 1; else if (id==21) real_files_names_case ^= 1; else if (id==22) info_after_copy ^= 1; - else if (id==23) use_big_fonts ^= 1; + else if (id==23) { use_big_fonts ^= 1; BigFontsChange(); } else if (id==25) files.line_h++; else if (id==26) && (files.line_h>14) files.line_h--; else if (id==27) MOUSE_TIME++; @@ -136,21 +136,10 @@ void LoadIniSettings() ini_get_int stdcall (eolite_ini_path, #confir_section, "UseBigFonts", 0); use_big_fonts = EAX; 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; - - if (use_big_fonts) - { - font_type = 0x90; - PathShow.font_size_x = FileShow.font_size_x = 8; - PathShow.font_number = FileShow.font_number = 1; - } - else - { - font_type=0x80; - PathShow.font_size_x = FileShow.font_size_x = 8; - PathShow.font_number = FileShow.font_number = 0; - } + BigFontsChange(); } + void SaveIniSettings() { ini_set_int stdcall (eolite_ini_path, #confir_section, "ShowDeviceName", show_dev_name); @@ -187,6 +176,25 @@ void SetAppColors() } +void BigFontsChange() +{ + if (use_big_fonts) + { + font_type = 10110000b; + font_h = 14; + FileShow.font_size_x = 8; + FileShow.font_number = 3; + } + else + { + font_type=10000000b; + font_h = 6; + FileShow.font_size_x = 6; + FileShow.font_number = 0; + } +} + + void CheckBox2(dword x, y, id, text, byte value) { CheckBox(x, y, 14, 14, id, text, system.color.work_graph, system.color.work_text, value); } \ No newline at end of file