From 9c51b90ee46de1a240aec17a48a5d99ac5382282 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 21 Dec 2015 19:04:39 +0000 Subject: [PATCH] cmm: minor fixes and improvements git-svn-id: svn://kolibrios.org@5997 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/include/settings.h | 14 ++++---- programs/cmm/eolite/include/translations.h | 4 +-- programs/cmm/lib/font.h | 34 ++++++++++--------- programs/cmm/lib/gui.h | 19 +++++++---- .../cmm/software_widget/software_widget.c | 8 ++--- 5 files changed, 42 insertions(+), 37 deletions(-) diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index fe87211dbc..f75a277cda 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -9,7 +9,7 @@ ?define smooth_FONT "Использовать сглаженный шрифт" ?define LIST_LINE_HEIGHT "Высота строки в списке" ?define NOTIFY_COPY_END "Уведомлять о завершении копирования" - #define SAVE_PATH_AS_DEFAULT "Сохранить текущий путь по умолчанию" + ?define SAVE_PATH_AS_DEFAULT "Сделать текущий путь домашним каталогом" #else ?define EDIT_FILE_ASSOCIATIONS "Edit file associations" ?define TITLE_SETT "Settings" @@ -20,7 +20,7 @@ ?define smooth_FONT "Use smooth font" ?define LIST_LINE_HEIGHT "List line height" ?define NOTIFY_COPY_END "Notify when copying finished" - #define SAVE_PATH_AS_DEFAULT "Save the current default path" + ?define SAVE_PATH_AS_DEFAULT "Save current path as home folder" #endif char config_section[] = "Config"; @@ -66,10 +66,10 @@ void settings_dialog() break; case evReDraw: - DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 300, 260+GetSkinHeight(),0x34,system.color.work,TITLE_SETT); + DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 300, 240+GetSkinHeight(),0x34,system.color.work,TITLE_SETT); DrawSettingsCheckBoxes(); - DrawFlatButton(9, 183, strlen(SAVE_PATH_AS_DEFAULT)+4*6, 22, 6, 0xE4DFE1, SAVE_PATH_AS_DEFAULT); - DrawFlatButton(9, 215, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS); + DrawFlatButton(9, 166, strlen(SAVE_PATH_AS_DEFAULT)+4*6, 22, 6, 0xE4DFE1, SAVE_PATH_AS_DEFAULT); + DrawFlatButton(9, 198, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS); } } } @@ -88,8 +88,8 @@ 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, 125, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT); - if (label.font) MoreLessBox(10, 152, 18, 30, 31, #system.color, label.size.pt, FONT_SIZE_LABEL); + MoreLessBox(10, 105, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT); + if (label.font) MoreLessBox(10, 132, 18, 30, 31, #system.color, label.size.pt, FONT_SIZE_LABEL); } diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index 336b1444df..ab054c1af7 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.29" -#define ABOUT_TITLE "Eolite 3.29" +#define TITLE "Eolite File Manager v3.3" +#define ABOUT_TITLE "Eolite 3.3" #ifdef LANG_RUS ?define T_FILE "Файл" diff --git a/programs/cmm/lib/font.h b/programs/cmm/lib/font.h index 9c5688dcd7..6af7dcad84 100644 --- a/programs/cmm/lib/font.h +++ b/programs/cmm/lib/font.h @@ -24,7 +24,7 @@ __SIZE size; int width,height; byte bold,italic,smooth; - dword color; + dword color, background; dword font,font_begin; word block; byte init(); @@ -215,35 +215,36 @@ inline fastcall dword b24(EBX) { return DSDWORD[EBX] << 8; } to = size.height - 1 * line_w + raw - 3; for(i=raw; i < to; i+=3) { - IF(i-raw%line_w +3 == line_w) continue; - IF(b24(i)==0x000000) && (b24(i+3)!=0x000000) && (b24(i+line_w)!=0x000000) && (b24(i+3+line_w)==0x000000) - { - ShadowPixel(i+3, 2); - ShadowPixel(i+line_w, 2); - } - ELSE IF(b24(i)!=0x000000) && (b24(i+3)==0x000000) && (b24(i+line_w)==0x000000) && (b24(i+3+line_w)!=0x000000) + if(i-raw%line_w +3 == line_w) continue; + if(b24(i)==0x000000) && (b24(i+3)!=0x000000) && (b24(i+line_w)!=0x000000) && (b24(i+3+line_w)==0x000000) { - ShadowPixel(i, 2); - ShadowPixel(i+3+line_w, 2); + ShadowImage(i+3, 1, 1, 2); + ShadowImage(i+line_w, 1, 1, 2); + } + else if(b24(i)!=0x000000) && (b24(i+3)==0x000000) && (b24(i+line_w)==0x000000) && (b24(i+3+line_w)!=0x000000) + { + ShadowImage(i, 1, 1, 2); + ShadowImage(i+3+line_w, 1, 1, 2); } } } -:int LABEL::write_center(dword x,y,w,h; dword background, color1; byte fontSizePoints; dword txt) +:int LABEL::write_center(dword x,y,w,h; dword _background, _color; byte fontSizePoints; dword txt) { size.pt = fontSizePoints; getsize(txt); - return write(w-size.width/2+x,y, background, color1, fontSizePoints, txt); + return write(w-size.width/2+x,y, _background, _color, fontSizePoints, txt); } -:int LABEL::write(int x,y; dword background, color1; byte fontSizePoints; dword text1) +:int LABEL::write(int x,y; dword _background, _color; byte fontSizePoints; dword text1) { signed len=0; IF(!text1)return false; IF(size.pt)IF(!changeSIZE())return false; size.pt = fontSizePoints; getsize(text1); - color = color1; + color = _color; + background = _background; y -= size.offset_y; EDX = size.width*size.height*3; IF(!raw_size) @@ -274,7 +275,7 @@ inline fastcall dword b24(EBX) { return DSDWORD[EBX] << 8; } return len; } -:void LABEL::write_buf(int x,y,w,h; dword background, color1; byte fontSizePoints; dword text1) +:void LABEL::write_buf(int x,y,w,h; dword _background, _color; byte fontSizePoints; dword text1) { dword new_raw_size; IF(!text1)return; @@ -283,7 +284,8 @@ inline fastcall dword b24(EBX) { return DSDWORD[EBX] << 8; } size.pt = fontSizePoints; getsize(text1); y -= size.offset_y; - color = color1; + color = _color; + background = _background; size.width = w; size.height = h; diff --git a/programs/cmm/lib/gui.h b/programs/cmm/lib/gui.h index cab136d67f..6761596bbb 100644 --- a/programs/cmm/lib/gui.h +++ b/programs/cmm/lib/gui.h @@ -177,15 +177,20 @@ } } -:void ShadowPixel(dword color_image, strength) +:dword ShadowPixel(dword dwColor, strength) { - dword to = color_image + 3; + dword iB, iG, iR; strength = 10 - strength; - for ( ; color_image < to; color_image++) - { - ESI = strength * DSBYTE[color_image] / 10; - DSBYTE[color_image] = ESI; - } + + iB = dwColor & 0xFF; dwColor >>= 8; + iG = dwColor & 0xFF; dwColor >>= 8; + iR = dwColor & 0xFF; dwColor >>= 8; + + iB = strength * iB / 10 << 16; + iG = strength * iG / 10 << 8; + iR = strength * iR / 10; + + return iR + iG + iB; } :void ShadowImage(dword color_image, w, h, strength) { diff --git a/programs/cmm/software_widget/software_widget.c b/programs/cmm/software_widget/software_widget.c index 59a3d187e7..93ee61ae65 100644 --- a/programs/cmm/software_widget/software_widget.c +++ b/programs/cmm/software_widget/software_widget.c @@ -145,7 +145,6 @@ byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name) icon_char_pos = strchr(key_value, ','); if (icon_char_pos) icon_id = atoi(icon_char_pos+1); else icon_id = default_icon; img_draw stdcall(skin.image, col*cell_w+tmp-10, row*cell_h+5 + list_pos, 32, 32, 0, icon_id*32); - label.bold = false; label.write_center(col*cell_w+7,row*cell_h+47 + list_pos, cell_w,0, LIST_BACKGROUND_COLOR, 0xDCDCDC, 12, key_name); label.write_center(col*cell_w+6,row*cell_h+46 + list_pos, cell_w,0, LIST_BACKGROUND_COLOR, 0x000000, 12, key_name); current_item_id++; @@ -177,7 +176,6 @@ byte process_sections(dword sec_name, f_name) old_row = row; DrawBar(0, row * cell_h + list_pos, Form.cwidth , 29, LIST_BACKGROUND_COLOR); //WriteTextB(10, row * cell_h + 9 + list_pos, 0x90, 0x000000, sec_name); - label.bold=false; text_len = label.write(10, row * cell_h + 10 + list_pos, LIST_BACKGROUND_COLOR, 0, 15, sec_name); DrawBar(text_len+20, row * cell_h + list_pos + 20, Form.cwidth-text_len-20, 1, 0xDCDCDC); DrawBar(text_len+20, row * cell_h + list_pos + 21, Form.cwidth-text_len-20, 1, 0xFCFCFC); @@ -190,10 +188,10 @@ byte process_sections(dword sec_name, f_name) void draw_top_bar() { int top_position = 26; - DrawBar(0,0,Form.cwidth, top_position-1, system.color.work); + DrawBar(0,0,Form.cwidth, top_position-2, system.color.work); + DrawBar(0,top_position-2, Form.cwidth, 1, ShadowPixel(system.color.work, 1)); DrawBar(0,top_position-1, Form.cwidth, 1, system.color.work_graph); - label.bold = false; - label.write_center(0,0, Form.cwidth, top_position, system.color.work, system.color.work_text, 17, #window_title); + label.write_center(0,0, Form.cwidth, top_position, system.color.work, system.color.work_text, 16, #window_title); list_top = top_position; list_pos = list_top; row = -1;