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
This commit is contained in:
Kirill Lipatov (Leency) 2021-12-28 18:24:06 +00:00
parent cfde3b082c
commit 834587bb50
10 changed files with 125 additions and 115 deletions

View File

@ -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; i<select_list.count; i++)
{
id = list.get(i) + strrchr(list.get(i), '/');
@ -122,12 +115,6 @@ void main()
break;
}
}
if (tabs.active_tab == TAB_SKINS) {
EAX = key_editbox;
edit_box_key stdcall (#edit_cmm);
edit_box_key stdcall (#edit_st);
}
break;
case evReDraw:
@ -139,24 +126,18 @@ void draw_window()
{
sc.get();
DefineAndDrawWindow(screen.width-WIN_W-9/2,80,WIN_W+9,WIN_H+4+skin_height,0x34,sc.work,WINDOW_HEADER,0);
DrawWindowContent();
}
void DrawWindowContent()
{
sc.get();
tabs.draw();
draw_icon_16w(tabs.x + TAB_PADDING, LP+5, 17);
draw_icon_16w(sizeof(t_skins)-1*8 + TAB_PADDING + TAB_PADDING + tabs.x, LP+5, 6);
draw_icon_16w(sizeof(t_wallpapers)+sizeof(t_skins)-2*8 + TAB_PADDING + TAB_PADDING + TAB_PADDING + tabs.x, LP+5, 61);
draw_icon_16w(tabs.x + TAB_P, LP+5, 17);
draw_icon_16w(sizeof(t_skins)-1*8 + TAB_P + TAB_P + tabs.x, LP+5, 6);
draw_icon_16w(sizeof(t_wallpapers)+sizeof(t_skins)-2*8 + TAB_P + TAB_P + TAB_P + tabs.x, LP+5, 61);
$push select_list.cur_y
SelectList_Init(
LP + TAB_PADDING,
LP,
PANEL_H,
LIST_W,
WIN_H - LP - TAB_PADDING - PANEL_H
WIN_H - LP - PANEL_H
);
$pop select_list.cur_y
@ -181,13 +162,22 @@ void DrawWindowContent()
}
if (tabs.active_tab == TAB_SCREENSAVERS)
{
miniprintf(#param, T_SS_TIMEOUT, screensaver_timeout);
WriteTextWithBg(RIGHTx, PANEL_H, 0xD0, sc.work_text, #param, sc.work);
ESI = DrawStandartCaptButton(RIGHTx, PANEL_H + 25, BTN_TEST_SCREENSAVER, T_SS_PREVIEW);
DrawStandartCaptButton(RIGHTx+ESI, PANEL_H + 25, BTN_SET_SCREENSAVER, T_SS_SET);
draw_timeout();
ss_timeout.line_col = sc.work_graph;
ss_timeout.frnt_col = sc.work;
scrollbar_h_draw stdcall (#ss_timeout);
DrawRectangle(RIGHTx, RIGHTy+25, RIGHTw-20, 15, sc.work_graph);
ESI = DrawStandartCaptButton(RIGHTx, PANEL_H + 65, BTN_TEST_SCREENSAVER, T_SS_PREVIEW);
DrawStandartCaptButton(RIGHTx+ESI, PANEL_H + 65, BTN_SET_SCREENSAVER, T_SS_SET);
}
}
void draw_timeout()
{
miniprintf(#param, T_SS_TIMEOUT, ss_timeout.position+1);
WriteTextWithBg(RIGHTx, PANEL_H, 0xD0, sc.work_text, #param, sc.work);
}
bool strreqi(dword _left, _right)
{
return strcmp(_left+strrchr(_left,'.'), _right);
@ -270,6 +260,8 @@ void SelectList_DrawLine(dword i)
{
int draw_y = i*SELECT_LIST_ITEMH+PANEL_H;
int i_abs = select_list.first + i;
dword text_color = 0xFFFfff;
dword bg_color = 0x000000;
char filename_buf[4096];
char* filename = #filename_buf;
@ -291,18 +283,15 @@ void SelectList_DrawLine(dword i)
BREAK;
CASE TAB_SCREENSAVERS:
active_screensaver = select_list.cur_y;
if (!i_abs) filename = T_NO_SS;
}
if (select_list.cur_y == i_abs)
{
DrawBar(select_list.x, draw_y, LIST_W, SELECT_LIST_ITEMH, sc.button);
WriteText(select_list.x+12,draw_y+select_list.text_y,select_list.font_type,sc.button_text, filename);
}
else
{
DrawBar(select_list.x,draw_y,LIST_W, SELECT_LIST_ITEMH, 0xFFFfff);
WriteText(select_list.x+12,draw_y+select_list.text_y,select_list.font_type,0, filename);
if (select_list.cur_y == i_abs) {
text_color = sc.button;
bg_color = sc.button_text;
}
DrawBar(select_list.x, draw_y, LIST_W, SELECT_LIST_ITEMH, text_color);
WriteText(select_list.x+12,draw_y+select_list.text_y,select_list.font_type,bg_color, filename);
}
void SelectList_LineChanged()
@ -313,6 +302,7 @@ void SelectList_LineChanged()
dword GetRealKolibriosPath()
{
char real_kolibrios_path[4096];
if (!dir_exists("/kolibrios")) return 0;
SetCurDir("/kolibrios");
GetCurDir(#real_kolibrios_path, sizeof(real_kolibrios_path));
return #real_kolibrios_path;
@ -321,11 +311,11 @@ dword GetRealKolibriosPath()
void GetIniSettings()
{
ini.section = "screensaver";
screensaver_timeout = ini.GetInt("timeout", 10);
ss_timeout.position = ini.GetInt("timeout", 10) - 1;
ini.GetString("available", #ss_available, sizeof(ss_available), 0);
ini.section = "style";
ini.GetString("default_skin", #default_skin, sizeof(default_skin), 0);
ini.GetString("default_wallp", #default_wallp, sizeof(default_wallp), 0);
ini.GetString("default_skin", #default_skin, PATHLEN, 0);
ini.GetString("default_wallp", #default_wallp, PATHLEN, 0);
}
//===================================================//
@ -358,7 +348,7 @@ void EventTabScreensaverClick()
select_list.ClearList();
select_list.count++;
list.add(T_NO_SS);
list.add("");
strcpy(#ssmas, #ss_available);
do {
@ -381,6 +371,7 @@ void EventDeleteFile()
void EventSelectWallpFolder()
{
o_dialog.type = 2; //select folder
OpenDialog_start stdcall (#o_dialog);
if (o_dialog.status) EventTabWallpappersClick();
}
@ -429,12 +420,11 @@ void EventApply()
void EventUpdateDocky()
{
if (!update_docky.checked) return;
// KillProcessByName("@docky", MULTIPLE);
// RunProgram("/sys/@docky",NULL);
if (update_docky.checked) {
RestartProcessByName("/sys/@docky", MULTIPLE);
pause(50);
ActivateWindow_Self();
}
}
void EventOpenFile()
@ -448,7 +438,7 @@ void EventOpenFile()
void EventExit()
{
if (cur_skin_path) {
if (GetRealKolibriosPath()) {
ini.section = "style";
ini.SetString("skin", #cur_skin_path, strlen(#cur_skin_path));
}
@ -460,7 +450,14 @@ void EventSetSs()
dword cur_ss = list.get(select_list.cur_y);
ini.section = "screensaver";
ini.SetString("program", cur_ss, strlen(cur_ss));
ini.SetInt("timeout", ss_timeout.position+1);
RestartProcessByName("/sys/@ss", MULTIPLE);
}
stop:
char folder_path[PATHLEN];
char cur_file_path[PATHLEN];
char cur_skin_path[PATHLEN];
char default_skin[PATHLEN];
char default_wallp[PATHLEN];

View File

@ -11,7 +11,7 @@
?define T_UPDATE_DOCK "Ž¡­®¢«ïâì Dock-¯ ­¥«ì"
?define T_NO_FILES "'<27>®¤¤¥à¦¨¢ ¥¬ë¥ ä ©«ë ­¥ ­ ©¤¥­ë' -E"
?define T_UI_PREVIEW " <20>ਬ¥à ª®¬¯®­¥­â®¢ "
?define T_SS_TIMEOUT "ˆ­â¥à¢ «: %i ¬¨­ãâ "
?define T_SS_TIMEOUT "ˆ­â¥à¢ « ¢ ¬¨­ãâ å: %i "
?define T_SS_PREVIEW "<EFBFBD>à®á¬®âà"
?define T_SS_SET "“áâ ­®¢¨âì"
?define T_NO_SS "[‚몫î祭]"
@ -29,22 +29,22 @@
?define T_UPDATE_DOCK "Update Dock"
?define T_NO_FILES "'No supported files were found' -E"
?define T_UI_PREVIEW " Components Preview "
?define T_SS_TIMEOUT "Wait: %i minutes "
?define T_SS_TIMEOUT "Wait in minutes: %i "
?define T_SS_PREVIEW "View"
?define T_SS_SET "Set"
?define T_NO_SS "[Disable]"
?define T_DEFAULT "[Default]"
#endif
#define WIN_W 600
#define WIN_H 420
#define LIST_W 280
#define WIN_W 560
#define WIN_H 450
#define LIST_W 260
#define PANEL_H 50
#define LP 6 //LIST_PADDING
#define RIGHTx LP + TAB_PADDING + LIST_W + TAB_PADDING + 30
#define RIGHTx LP + LIST_W + TAB_P + 30
#define RIGHTy PANEL_H
#define RIGHTw 226
#define RIGHTw WIN_W - RIGHTx - LP - TAB_P
#define RIGHTh 215
enum {
@ -64,3 +64,9 @@ _ini ini = { "/sys/settings/system.ini" };
char default_dir[] = "/rd/1";
od_filter filter2 = { 8, "TXT\0\0" };
_tabs tabs = { -sizeof(t_skins)-sizeof(t_wallpapers)-sizeof(t_screensaver)
-3*8+WIN_W - TAB_P / 2, LP, NULL, BASE_TAB_BUTTON_ID };
scroll_bar ss_timeout = { RIGHTw-19,RIGHTx,15,RIGHTy+25,0,3,89,10,0,0xFFFfff,
0xBBBbbb,0xeeeeee};

View File

@ -9,9 +9,9 @@ TODO:
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
*/
#define ABOUT_TITLE "EOLITE 5.16"
#define TITLE_EOLITE "Eolite File Manager 5.16"
#define TITLE_KFM "Kolibri File Manager 2.16";
#define ABOUT_TITLE "EOLITE 5.16a"
#define TITLE_EOLITE "Eolite File Manager 5.16a"
#define TITLE_KFM "Kolibri File Manager 2.16a";
#define MEMSIZE 1024 * 250
#include "../lib/clipboard.h"
@ -584,7 +584,9 @@ void draw_window()
}
//main rectangles
DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,sc.work_graph);
DrawRectangle(0,39,Form.cwidth-1,-show_status_bar.checked*status_bar_h + Form.cheight - 40,col.work_gradient[4]); //bg
DrawBar(0,39,1,-show_status_bar.checked*status_bar_h + Form.cheight - 40, sc.work);
EBX = Form.cwidth-1 * 65536 + 1;
$int 64
for (i=0; i<6; i++) DrawBar(0, 34+i, Form.cwidth, 1, MixColors(sc.work_dark, sc.work, i*10));
for (i=0; i<6; i++) DrawBar(0, 5-i, Form.cwidth, 1, MixColors(sc.work_light, sc.work, i*10));
llist_copy(#files_active, #files);
@ -637,14 +639,17 @@ void DrawStatusBar()
{
char status_bar_str[80];
int go_up_folder_exists=0;
dword topcolor;
if (show_status_bar.checked) topcolor=sc.work_light; else topcolor=sc.work;
DrawBar(0, Form.cheight - status_bar_h-1, Form.cwidth, 1, topcolor);
if (efm) {
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, 2, sc.work);
DrawBar(0, Form.cheight - 2, Form.cwidth, 2, sc.work);
DrawBar(Form.cwidth-1, Form.cheight - 19, 1, 17, sc.work);
DrawBar(0, Form.cheight - 2, Form.cwidth, 2, EDX);
DrawBar(Form.cwidth-1, Form.cheight - 19, 1, 17, EDX);
DrawFuncButtonsInKfm();
} else {
if (!show_status_bar.checked) return;
} else if (show_status_bar.checked) {
if (files.count>0) && (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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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; i<count; i++) {
xx += draw_button(xx + TAB_PADDING, i, names[i]) + TAB_PADDING;
xx += draw_button(xx + TAB_P, i, names[i]) + TAB_P;
}
}

View File

@ -555,7 +555,7 @@ inline fastcall void PutPixel( EBX,ECX,EDX)
:void DrawBar(dword x,y,w,h,color)
{
if (h<=0) || (h>60000) || (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;

View File

@ -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++;

View File

@ -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
@ -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