From 1e0700bd56ac81afea03f209dd41a010c9f6ae00 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sat, 26 Dec 2015 11:03:17 +0000 Subject: [PATCH] Eolite 3.31: remove old code, use bigger font for buttons, remove Estonian translation as unsupported, better and unified popin() function software_widget.c: top panel increase height for new skin git-svn-id: svn://kolibrios.org@6008 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 23 ++++----- programs/cmm/eolite/include/about.h | 4 +- programs/cmm/eolite/include/gui.h | 24 ++++++---- programs/cmm/eolite/include/properties.h | 13 ++--- programs/cmm/eolite/include/settings.h | 7 ++- programs/cmm/eolite/include/translations.h | 47 +++---------------- .../cmm/software_widget/software_widget.c | 8 ++-- 7 files changed, 48 insertions(+), 78 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 612bd74ef8..57ed546150 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -309,7 +309,7 @@ void main() } if (del_active) { - if (id==301) || (id==302) Del_File(302-id); + if (id==301) || (id==302) Del_File(302-id); break; } if (new_element_active) @@ -821,7 +821,7 @@ void Del_Form() else { if (!files.count) return; - DrawPopup(dform_x,160,220,85,1,system.color.work,system.color.work_graph); + DrawEolitePopup(T_YES, T_NO); WriteText(-strlen(T_DELETE_FILE)*3+110+dform_x,175,0x80,system.color.work_text,T_DELETE_FILE); for (i=0; i0) DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF); - WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,system.color.work_text,text); + if (height<18) + WriteText(-strlen(text)*6+width/2+x+1,height/2+y-3,0x80 ,system.color.work_text,text); + else + WriteText(-strlen(text)*8+width/2+x+1,height/2+y-6,10010000b,system.color.work_text,text); + } void DrawFilledBar(dword x, y, w, h) @@ -61,12 +65,16 @@ void DrawFilledBar(dword x, y, w, h) DrawBar(x, y+i, w, h-fill_h, col_palette[14-i]); } -void ShowMessage(dword message, pause_duration) +void DrawEolitePopup(dword b1_text, b2_text) { - int form_x=files.w-220/2+files.x; - int form_y=160; - DrawPopup(form_x,form_y,220,80,1,system.color.work,system.color.work_graph); - WriteText(-strlen(message)*3+110+form_x,80/2-4+form_y,0x80,system.color.work_text,message); - pause(pause_duration); - if (pause_duration) List_ReDraw(); + int form_w=250, button_padding=30; + int b1_len = strlen(b1_text) * 8 + button_padding; + int b2_len = strlen(b2_text) * 8 + button_padding; + int dform_x = files.w - form_w / 2 + files.x ; + 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); + DrawFlatButton(b1_x, 210, b1_len, 24, 301, 0xFFB6B5, b1_text); + DrawFlatButton(b2_x, 210, b2_len, 24, 302, 0xC6DFC6, b2_text); } \ No newline at end of file diff --git a/programs/cmm/eolite/include/properties.h b/programs/cmm/eolite/include/properties.h index 02658393b8..26b559cf97 100644 --- a/programs/cmm/eolite/include/properties.h +++ b/programs/cmm/eolite/include/properties.h @@ -39,8 +39,8 @@ dword mouse_ddd2; char path_to_file[4096]="\0"; char file_name2[4096]="\0"; -edit_box file_name_ed = {195,50,25,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#file_name2,#mouse_ddd2, 1000000000000000b,2,2}; -edit_box path_to_file_ed = {145,100,46,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#path_to_file,#mouse_ddd2, 1000000000000000b,2,2}; +edit_box file_name_ed = {195,50,25,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,4098,#file_name2,#mouse_ddd2, 1000000000000000b,2,2}; +edit_box path_to_file_ed = {145,100,46,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,4098,#path_to_file,#mouse_ddd2, 1000000000000000b,2,2}; frame flags_frame = { 0, 280, 10, 83, 151, 0x000111, 0xFFFfff, 1, FLAGS, 0, 0, 6, 0x000111, 0xFFFFFF }; int file_count, dir_count, size_dir; @@ -158,7 +158,8 @@ void GetSizeDir(dword way) if (isdir(way)) { cur_file = malloc(4096); - // In the process of recursive descent, memory must be allocated dynamically, because the static memory -> was a bug !!! But unfortunately pass away to sacrifice speed. + // In the process of recursive descent, memory must be allocated dynamically, + // because the static memory -> was a bug !!! But unfortunately pass away to sacrifice speed. GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); for (i=0; i18) files.item_h--; - //else if (id==29) smooth_font ^= true; else if (id==30) { label.size.pt++; IF(!label.changeSIZE()) label.size.pt--; BigFontsChange(); } else if (id==31) { label.size.pt--; IF(!label.changeSIZE()) label.size.pt++; BigFontsChange(); } EventRedrawWindow(Form.left,Form.top); @@ -66,10 +65,10 @@ void settings_dialog() break; case evReDraw: - DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 300, 240+GetSkinHeight(),0x34,system.color.work,TITLE_SETT); + DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 370, 243+GetSkinHeight(),0x34,system.color.work,TITLE_SETT); DrawSettingsCheckBoxes(); - 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); + DrawFlatButton(9, 166, strlen(SAVE_PATH_AS_DEFAULT)+3*8, 24, 6, 0xE4DFE1, SAVE_PATH_AS_DEFAULT); + DrawFlatButton(9, 200, strlen(EDIT_FILE_ASSOCIATIONS)+3*8, 24, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS); } } } diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index ab054c1af7..04ebd785af 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.3" -#define ABOUT_TITLE "Eolite 3.3" +#define TITLE "Eolite File Manager v3.31" +#define ABOUT_TITLE "Eolite 3.31" #ifdef LANG_RUS ?define T_FILE "Файл" @@ -14,52 +14,20 @@ ?define T_CREATE "Создать" ?define T_RENAME "Переименовать" ?define FS_ITEM_ALREADY_EXISTS "'Элемент с таким именем уже существует' -E" - ?define T_DEL_ERROR_1 "Ошибка. Папка не пустая." - ?define NOT_CREATE_FOLDER "Не удалось создать папку." - ?define NOT_CREATE_FILE "Не удалось создать файл." + ?define NOT_CREATE_FOLDER "'Не удалось создать папку.' -E" + ?define NOT_CREATE_FILE "'Не удалось создать файл.' -E" ?define T_COPY_WINDOW_TITLE "Копирую..." ?define T_COPY_WINDOW_TEXT "Копируется файл:" ?define T_MOVE_WINDOW_TITLE "Перемещаю..." ?define T_MOVE_WINDOW_TEXT "Перемещается файл:" ?define T_DELETE_WINDOW_TITLE "Удаляю..." ?define T_DELETE_WINDOW_TEXT "Удаляется файл:" - ?define T_ABORT_WINDOW_BUTTON "Прервать" - - + ?define T_ABORT_WINDOW_BUTTON "Прервать" ?define INFO_AFTER_COPY "Копирование завершено" ?define T_CANCEL_PASTE "Копирование прекращено. Папка скопирована не полностью." ?define T_SELECT_APP_TO_OPEN_WITH "Выберите программу для открытия файла" ?define DEL_MORE_FILES_1 "выбранные элементы (" ?define DEL_MORE_FILES_2 " шт.)?" -#elif LANG_EST - ?define T_FILE "Fail" - ?define T_TYPE "TтДЦтДЦp" - ?define T_SIZE "Suurus" - ?define T_NEW_FOLDER "Uus kataloog" - ?define T_NEW_FILE "Uus fail" - ?define T_DELETE_FILE "Kas sa tahad t╤Чesti kustutada" - ?define T_YES "Jah" - ?define T_NO "Ei" - ?define T_CANCEL "Cancel" - ?define T_CREATE "Create" - ?define T_RENAME "Rename" - ?define FS_ITEM_ALREADY_EXISTS "'An item with that name already exists' -E" - ?define T_DEL_ERROR_1 "Viga. Kataloog ei ole tтДЦhi." - ?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..." - ?define NOT_CREATE_FOLDER "Kataloogi ei saa luua." - ?define NOT_CREATE_FILE "Faili ei saa luua." - ?define T_COPY_WINDOW_TITLE "Copying..." - ?define T_COPY_WINDOW_TEXT "Copying file:" - ?define T_MOVE_WINDOW_TITLE "Moving..." - ?define T_MOVE_WINDOW_TEXT "Moving file:" - ?define T_DELETE_WINDOW_TITLE "Deleting..." - ?define T_DELETE_WINDOW_TEXT "Deleting file:" - ?define T_ABORT_WINDOW_BUTTON "Abort" - ?define INFO_AFTER_COPY "Copy finished" - ?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely." - ?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file" - ?define DEL_MORE_FILES_1 "selected items(" - ?define DEL_MORE_FILES_2 " pcs.)?" #else ?define T_FILE "File" ?define T_TYPE "Type" @@ -73,10 +41,9 @@ ?define T_CREATE "Create" ?define T_RENAME "Rename" ?define FS_ITEM_ALREADY_EXISTS "'An item with that name already exists' -E" - ?define T_DEL_ERROR_1 "Error. Folder isn't empty." ?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..." - ?define NOT_CREATE_FOLDER "Folder can not be created." - ?define NOT_CREATE_FILE "File can not be created." + ?define NOT_CREATE_FOLDER "'Folder can not be created.' -E" + ?define NOT_CREATE_FILE "'File can not be created.' -E" ?define T_COPY_WINDOW_TITLE "Copying..." ?define T_COPY_WINDOW_TEXT "Copying file:" ?define T_MOVE_WINDOW_TITLE "Moving..." diff --git a/programs/cmm/software_widget/software_widget.c b/programs/cmm/software_widget/software_widget.c index 93ee61ae65..cd522f95fc 100644 --- a/programs/cmm/software_widget/software_widget.c +++ b/programs/cmm/software_widget/software_widget.c @@ -98,10 +98,11 @@ void main() DefineAndDrawWindow(GetScreenWidth()-window_width/2,GetScreenHeight()-window_height/2,window_width,window_height,0x74,system.color.work,""); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) { DrawTitle(#window_title); break; } else DrawTitle(""); + draw_top_bar(); kolibrios_mounted = isdir("/kolibrios"); col_max = Form.cwidth - 10 / cell_w; current_item_id = 0; - draw_top_bar(); + row = -1; ini_enum_sections stdcall (#settings_ini_path, #process_sections); DrawBar(0, row + 1 * cell_h + list_pos, Form.cwidth, -row - 1 * cell_h - list_pos + Form.cheight, LIST_BACKGROUND_COLOR); break; @@ -187,14 +188,13 @@ byte process_sections(dword sec_name, f_name) void draw_top_bar() { - int top_position = 26; + int top_position = 32; 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.write_center(0,0, Form.cwidth, top_position, system.color.work, system.color.work_text, 16, #window_title); + label.write_center(0,5, Form.cwidth, top_position, system.color.work, system.color.work_text, 16, #window_title); list_top = top_position; list_pos = list_top; - row = -1; }