From 834587bb502769a520890108e4fd709ac5b03e52 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Tue, 28 Dec 2021 18:24:06 +0000 Subject: [PATCH] appearance: fully working screensaver tab Eolite: add light line in the top of statusbar software_widget: fix game centre view3ds: fix by macgub git-svn-id: svn://kolibrios.org@9516 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/appearance/appearance.c | 119 +++++++++++++-------------- programs/cmm/appearance/const.h | 22 +++-- programs/cmm/eolite/Eolite.c | 21 +++-- programs/cmm/eolite/include/gui.h | 35 ++++---- programs/cmm/lib/fs.h | 6 +- programs/cmm/lib/gui.h | 1 - programs/cmm/lib/gui/tabs.h | 6 +- programs/cmm/lib/kolibri.h | 2 +- programs/cmm/misc/software_widget.c | 2 +- programs/demos/view3ds/view3ds.asm | 26 +++--- 10 files changed, 125 insertions(+), 115 deletions(-) diff --git a/programs/cmm/appearance/appearance.c b/programs/cmm/appearance/appearance.c index 86f805da5a..95eed77e1a 100644 --- a/programs/cmm/appearance/appearance.c +++ b/programs/cmm/appearance/appearance.c @@ -1,5 +1,5 @@ //11.03.12 - start! -//ver 2.31 +//TODO: select current value at startap #define MEMSIZE 1024*70 #include "../lib/mem.h" @@ -27,25 +27,14 @@ int active_skin, active_wallpaper, active_screensaver; -char folder_path[4096]; -char cur_file_path[4096]; -char cur_skin_path[4096]; -char default_skin[4096]; -char default_wallp[4096]; -char ss_available[200]; - -int screensaver_timeout; - -_tabs tabs = { -sizeof(t_skins)-sizeof(t_wallpapers)-sizeof(t_screensaver)-3*8+WIN_W - - TAB_PADDING / 2, LP, NULL, BASE_TAB_BUTTON_ID }; - checkbox update_docky = { T_UPDATE_DOCK, false }; -checkbox ss_in_on = { T_UPDATE_DOCK, false }; checkbox optionbox_stretch = { T_CHECKBOX_STRETCH, false }; checkbox optionbox_tiled = { T_CHECKBOX_TILED, false }; checkbox optionbox_auto = { T_CHECKBOX_AUTO, true }; +char ss_available[200]; + collection list; //===================================================// @@ -60,7 +49,6 @@ void main() load_dll(boxlib, #box_lib_init,0); load_dll(libini, #lib_init,1); load_dll(Proc_lib, #OpenDialog_init,0); - o_dialog.type = 2; //select folder OpenDialog_init stdcall (#o_dialog); GetIniSettings(); @@ -75,6 +63,13 @@ void main() { case evMouse: SelectList_ProcessMouse(); + if (tabs.active_tab == TAB_SCREENSAVERS) { + scrollbar_h_mouse stdcall (#ss_timeout); + if (ss_timeout.redraw) { + draw_timeout(); + ss_timeout.redraw = false; //reset flag + } + } break; case evButton: @@ -100,17 +95,15 @@ void main() case evKey: GetKeys(); - if (select_list.ProcessKey(key_scancode)) EventApply(); - if (key_scancode==SCAN_CODE_ENTER) EventOpenFile(); - if (key_scancode==SCAN_CODE_DEL) EventDeleteFile(); + if (select_list.ProcessKey(key_scancode)) { EventApply(); break; } + if (key_scancode==SCAN_CODE_ENTER) { EventOpenFile(); break; } + if (key_scancode==SCAN_CODE_DEL) { EventDeleteFile(); break; } if (key_scancode==SCAN_CODE_TAB) { id = tabs.active_tab+1; if(id==3)id=0; tabs.click(id + tabs.base_id); break; } - - if (! edit_cmm.flags & ed_focus) && (! edit_st.flags & ed_focus) for (i=select_list.cur_y+1; i0) && (streq(items.get(0)*304+buf+72,"..")) go_up_folder_exists=1; DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work); sprintf(#status_bar_str, T_STATUS_EVEMENTS, folder_count-go_up_folder_exists, files.count-folder_count); diff --git a/programs/cmm/eolite/include/gui.h b/programs/cmm/eolite/include/gui.h index d5a24c6cb1..12724dd8a9 100644 --- a/programs/cmm/eolite/include/gui.h +++ b/programs/cmm/eolite/include/gui.h @@ -30,35 +30,36 @@ void DrawScroll(bool _scroll_used) { } //slider DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,sc.work_graph); - DrawRectangle3D(sc_x+1,sc_slider_y+1,14,sc_slider_h-2, sc.work_light , sc.work_dark); + sc_x++; + DrawRectangle3D(sc_x,sc_slider_y+1,14,sc_slider_h-2, sc.work_light , sc.work_dark); for (i=0; i<13; i++) { if (!_scroll_used) EDX = col.work_gradient[13-i]; else EDX = col.work_gradient[i]; - DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, EDX); + DrawBar(sc_x + 1 + i, sc_slider_y+2, 1, sc_slider_h-3, EDX); } sc_center = sc_slider_h / 2 + sc_slider_y; - DrawBar(sc_x+3, sc_center, 10, 1, sc.work_graph); - DrawBar(sc_x+4, sc_center-3, 8, 1, sc.work_graph); - DrawBar(sc_x+4, sc_center+3, 8, 1, sc.work_graph); + DrawBar(sc_x+2, sc_center, 10, 1, sc.work_graph); + DrawBar(sc_x+3, sc_center-3, 8, 1, EDX); + DrawBar(sc_x+3, sc_center+3, 8, 1, EDX); - DrawBar(sc_x+3+1, sc_center+1, 10, 1, sc.work_light); - DrawBar(sc_x+4+1, sc_center-2, 8, 1, sc.work_light); - DrawBar(sc_x+4+1, sc_center+4, 8, 1, sc.work_light); + DrawBar(sc_x+3, sc_center+1, 10, 1, sc.work_light); + DrawBar(sc_x+4, sc_center-2, 8, 1, EDX); + DrawBar(sc_x+4, sc_center+4, 8, 1, EDX); //area before slider if (sc_slider_y > sc_y + 1) { - DrawBar(sc_x+1, sc_y, 15, 1, col.slider_bg_left); - DrawBar(sc_x+1, sc_y+1, 1, sc_slider_y-sc_y-1, col.slider_bg_left); - DrawBar(sc_x+2, sc_y+1, 14, sc_slider_y-sc_y-1, col.slider_bg_big); + DrawBar(sc_x, sc_y, 15, 1, col.slider_bg_left); + DrawBar(sc_x, sc_y+1, 1, sc_slider_y-sc_y-1, col.slider_bg_left); + DrawBar(sc_x+1, sc_y+1, 14, sc_slider_y-sc_y-1, col.slider_bg_big); } //area after slider if (sc_h-sc_slider_h+sc_y-2>sc_slider_y) { - DrawBar(sc_x+1, sc_slider_y + sc_slider_h+1, 15, 1, col.slider_bg_left); - DrawBar(sc_x+1, sc_slider_y + sc_slider_h+2, 1, sc_h-sc_slider_h-sc_slider_y+sc_y-2, col.slider_bg_left); - DrawBar(sc_x+2, sc_slider_y + sc_slider_h+2, 14, sc_h-sc_slider_h-sc_slider_y+sc_y-2, col.slider_bg_big); + DrawBar(sc_x, sc_slider_y + sc_slider_h+1, 15, 1, col.slider_bg_left); + DrawBar(sc_x, sc_slider_y + sc_slider_h+2, 1, sc_h-sc_slider_h-sc_slider_y+sc_y-2, col.slider_bg_left); + DrawBar(sc_x+1, sc_slider_y + sc_slider_h+2, 14, sc_h-sc_slider_h-sc_slider_y+sc_y-2, col.slider_bg_big); } } @@ -298,7 +299,7 @@ void DrawDot(dword x,y) { DrawBar(x+1,y,2,4,sc.work_graph); DrawBar(x,y+1,4,2,sc.work_graph); PutPixel(x,y,col_pxl); - PutPixel(x+3,y,col_pxl); - PutPixel(x,y+3,col_pxl); - PutPixel(x+3,y+3,col_pxl); + PutPixel(x+3,y,EDX); + PutPixel(x,y+3,EDX); + PutPixel(x+3,y+3,EDX); } \ No newline at end of file diff --git a/programs/cmm/lib/fs.h b/programs/cmm/lib/fs.h index 3592ecb18b..a24343f6a4 100644 --- a/programs/cmm/lib/fs.h +++ b/programs/cmm/lib/fs.h @@ -10,6 +10,8 @@ #include "../lib/collection.h" #endif +#define PATHLEN 4096 + //===================================================// // // // Basic System Functions // @@ -316,7 +318,7 @@ char readbuf[32]; :dword abspath(dword relative_path) //GetAbsolutePathFromRelative() { - char absolute_path[4096]; + char absolute_path[PATHLEN]; if (ESBYTE[relative_path]=='/') { strcpy(#absolute_path, relative_path); @@ -511,7 +513,7 @@ int block_size=1024*1024*4; //copy by 4 MiB if (!way) return 0; if (dir_exists(way)) { - cur_file = malloc(4096); + cur_file = malloc(PATHLEN); // 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); diff --git a/programs/cmm/lib/gui.h b/programs/cmm/lib/gui.h index 87f0614c34..74ebe702df 100644 --- a/programs/cmm/lib/gui.h +++ b/programs/cmm/lib/gui.h @@ -89,7 +89,6 @@ int w = tw + padding_h + padding_h; unsigned darker_color = MixColors(sc.button,0,230); - DefineButton(x,y,w,h,id,sc.button); WriteText(tx+1,ty+1,0x90,darker_color,text); diff --git a/programs/cmm/lib/gui/tabs.h b/programs/cmm/lib/gui/tabs.h index 3732efcf00..88dcdad29e 100644 --- a/programs/cmm/lib/gui/tabs.h +++ b/programs/cmm/lib/gui/tabs.h @@ -1,5 +1,5 @@ -#ifndef TAB_PADDING -#define TAB_PADDING 15 +#ifndef TAB_P +#define TAB_P 15 //Tab padding #endif #define TAB_HEIGHT 28 @@ -33,7 +33,7 @@ } for (i=0; i60000) || (w<=0) || (w>60000) return; //bad boy :) + //if (h<=0) || (h>60000) || (w<=0) || (w>60000) return; //bad boy :) EAX = 13; EBX = x<<16+w; ECX = y<<16+h; diff --git a/programs/cmm/misc/software_widget.c b/programs/cmm/misc/software_widget.c index 3310f9a910..119f42853b 100644 --- a/programs/cmm/misc/software_widget.c +++ b/programs/cmm/misc/software_widget.c @@ -161,7 +161,7 @@ byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name) //do not show items located in /kolibrios/ if this directory not mounted if (!strncmp(key_value, "/kolibrios/", 11)) || (!strncmp(key_value, "/k/", 3)) - if (!kolibrios_mounted) return true; + || (!strncmp(key_value, "/kg/", 4)) if (!kolibrios_mounted) return true; if (col==list.column_max) { row++; diff --git a/programs/demos/view3ds/view3ds.asm b/programs/demos/view3ds/view3ds.asm index 453a694b1e..99dc4c55bd 100644 --- a/programs/demos/view3ds/view3ds.asm +++ b/programs/demos/view3ds/view3ds.asm @@ -355,15 +355,15 @@ START: ; start of execution ; call init_envmap2 call do_emboss @@: -; cmp ah,17 -; jne .next_m -; cmp [move_flag],2 -; jne @f -; call draw_window ; redraw other labels to navigation buttons -; @@: -; cmp [move_flag],0 -; jne .next_m -; call draw_window ; redraw other labels to navigation buttons + ; cmp ah,17 + ; jne .next_m + ; cmp [move_flag],2 + ; jne @f + ; call draw_window ; redraw other labels to navigation buttons + ; @@: + ; cmp [move_flag],0 + ; jne .next_m + ; call draw_window ; redraw other labels to navigation buttons .next_m: cmp ah,18 jne .next_m2 @@ -375,8 +375,8 @@ START: ; start of execution mov [re_alloc_flag],0 mov bl,[generator_flag] - ; or bl,bl - ; jz .next_m2 + ; or bl,bl + ; jz .next_m2 cmp bl,1 jne @f call generate_object @@ -2950,8 +2950,8 @@ draw_handlers: mov .dr_model,eax movzx eax,word[size_x_var] - cmp .dr_model,12 - jge @f + cmp .dr_model,10 + jg @f lea ebx,[eax*3] sub ebx,3*6 mov [.xplus_scr],ebx ; for scr 1st cause