diff --git a/programs/cmm/eolite/imgs/png/icons.png b/programs/cmm/eolite/imgs/png/icons.png index 017acd118c..c8f0b71aef 100644 Binary files a/programs/cmm/eolite/imgs/png/icons.png and b/programs/cmm/eolite/imgs/png/icons.png differ diff --git a/programs/cmm/eolite/include/open_with.h b/programs/cmm/eolite/include/open_with.h index 0fd68f4c72..b6d7c7cdb9 100644 --- a/programs/cmm/eolite/include/open_with.h +++ b/programs/cmm/eolite/include/open_with.h @@ -106,14 +106,22 @@ void OpenWith() key = GetKey(); if (key==27) ExitProcess(); if (key==13) { RunProgram(#app_paths[app_list.current].item, #file_path); ExitProcess(); } - if (key==177) //down + if (key==177) { if (app_list.KeyDown()) DrawAppList(); } - if (key==178) //up + if (key==178) { if (app_list.KeyUp()) DrawAppList(); } + if (key==180) + { + if (app_list.KeyHome()) DrawAppList(); + } + if (key==181) + { + if (app_list.KeyEnd()) DrawAppList(); + } break; case evReDraw: _APP_LIST_DRAW: @@ -144,9 +152,10 @@ void DrawAppList() Put_icon(#app_paths[index+app_list.first].ext, app_list.x+4, index*app_list.line_h+app_list.y+2, col_bg, 6); WriteText(app_list.x+25, index*app_list.line_h+app_list.y+7, 0x80, 0, #app_paths[index+app_list.first].item); } - tiny_scroll.h = app_list.w*app_list.visible/app_list.count; tiny_scroll.x = app_list.x+app_list.w-SCROLL_WIDTH-1; - tiny_scroll.y = app_list.first * app_list.h / app_list.count + app_list.y; - if (tiny_scroll.y + tiny_scroll.h - app_list.y > app_list.h) tiny_scroll.y = app_list.y + app_list.h - tiny_scroll.h-1; + tiny_scroll.h = app_list.h * app_list.visible / app_list.count; + tiny_scroll.y = app_list.h * app_list.first / app_list.count + app_list.y; + debugi(tiny_scroll.y + tiny_scroll.h - app_list.y - app_list.h); + if (tiny_scroll.y + tiny_scroll.h - app_list.y - app_list.h >= 0) tiny_scroll.y = app_list.y + app_list.h - tiny_scroll.h-1; DrawBar(tiny_scroll.x, tiny_scroll.y, SCROLL_WIDTH, tiny_scroll.h, 0x555555); //scroll } \ No newline at end of file diff --git a/programs/cmm/lib/list_box.h b/programs/cmm/lib/list_box.h index e3a43190b2..6fde8e299b 100644 --- a/programs/cmm/lib/list_box.h +++ b/programs/cmm/lib/list_box.h @@ -8,6 +8,8 @@ struct llist void ClearList(); int KeyDown(); int KeyUp(); + int KeyHome(); + int KeyEnd(); void SetSizes(int xx, yy, ww, hh, min_hh, line_hh); int MouseScroll(dword scroll_state); }; @@ -51,12 +53,12 @@ int llist::KeyDown() { if (current-first+1=count) return -1; + if (current+1>=count) return 0; current++; } else { - if (visible+first>=count) return -1; + if (visible+first>=count) return 0; first++; current++; } @@ -71,9 +73,25 @@ int llist::KeyUp() } else { - if (first==0) return -1; + if (first==0) return 0; first--; current--; } return 1; +} + +int llist::KeyHome() +{ + if (current==0) && (first==0) return 0; + current=0; + first=0; + return 1; +} + +int llist::KeyEnd() +{ + if (current==count-1) && (first==count-visible) return 0; + current=count-1; + first=count-visible; + return 1; } \ No newline at end of file