appearance: image set mode, eolite bug fix

git-svn-id: svn://kolibrios.org@7611 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2019-03-15 12:19:45 +00:00
parent 9b2415c6ea
commit d746259b38
2 changed files with 36 additions and 6 deletions

View File

@ -31,12 +31,18 @@
?define T_WALLPAPERS "Ž¡®¨" ?define T_WALLPAPERS "Ž¡®¨"
?define T_SELECT_FOLDER "‚ë¡à âì ¯ ¯ªã" ?define T_SELECT_FOLDER "‚ë¡à âì ¯ ¯ªã"
?define MENU_LIST "Žâªàëâì ä ©« Enter\n“¤ «¨âì ä ©« Del" ?define MENU_LIST "Žâªàëâì ä ©« Enter\n“¤ «¨âì ä ©« Del"
?define T_PICTURE_MODE " <20>®«®¦¥­¨¥ ª à⨭ª¨ "
?define T_CHECKBOX_STRETCH "<EFBFBD> áâï­ãâì"
?define T_CHECKBOX_TILED "‡ ¬®áâ¨âì"
#else #else
?define WINDOW_HEADER "Appearance" ?define WINDOW_HEADER "Appearance"
?define T_SKINS "Skins" ?define T_SKINS "Skins"
?define T_WALLPAPERS "Wallpapers" ?define T_WALLPAPERS "Wallpapers"
?define T_SELECT_FOLDER "Select wallpapers" ?define T_SELECT_FOLDER "Select folder"
?define MENU_LIST "Open file Enter\nDelete file Del" ?define MENU_LIST "Open file Enter\nDelete file Del"
?define T_PICTURE_MODE " Picture Mode "
?define T_CHECKBOX_STRETCH "Stretch"
?define T_CHECKBOX_TILED "Tiled"
#endif #endif
#define PANEL_H 40 #define PANEL_H 40
@ -75,6 +81,9 @@ edit_box edit_st = {180,NULL,NULL,0xffffff,0x94AECE,0xFFFfff,0xffffff,
char default_dir[] = "/rd/1"; char default_dir[] = "/rd/1";
od_filter filter2 = { 8, "TXT\0\0" }; od_filter filter2 = { 8, "TXT\0\0" };
checkbox optionbox_stretch = { T_CHECKBOX_STRETCH, true };
checkbox optionbox_tiled = { T_CHECKBOX_TILED, false };
//===================================================// //===================================================//
// // // //
// CODE // // CODE //
@ -132,6 +141,8 @@ void main()
if (id==BTN_SELECT_WALLP_FOLDER) EventSelectWallpFolder(); if (id==BTN_SELECT_WALLP_FOLDER) EventSelectWallpFolder();
checkbox1.click(id); checkbox1.click(id);
spinbox1.click(id); spinbox1.click(id);
if (!optionbox_stretch.checked) && (optionbox_stretch.click(id)) EventSetWallpMode_Stretch();
if (!optionbox_tiled.checked) && (optionbox_tiled.click(id)) EventSetWallpMode_Tiled();
break; break;
case evKey: case evKey:
@ -189,7 +200,7 @@ void DrawWindowContent()
incn y; incn y;
int list_w; int list_w;
if (tabs.active_tab == SKINS) list_w=250; else list_w=370; if (tabs.active_tab == SKINS) list_w=250; else list_w=350;
DrawWideRectangle(0, 0, Form.cwidth, Form.cheight, LP, system.color.work); DrawWideRectangle(0, 0, Form.cwidth, Form.cheight, LP, system.color.work);
@ -237,8 +248,12 @@ void DrawWindowContent()
} }
if (tabs.active_tab == WALLPAPERS) if (tabs.active_tab == WALLPAPERS)
{ {
DrawStandartCaptButton(select_list.x + select_list.w + scroll1.size_x + 17, skp.x -= TAB_PADDING + 3;
select_list.y, BTN_SELECT_WALLP_FOLDER, T_SELECT_FOLDER); DrawStandartCaptButton(skp.x, select_list.y, BTN_SELECT_WALLP_FOLDER, T_SELECT_FOLDER);
DrawBar(skp.x, select_list.y+50, 180, 80, system.color.work);
DrawFrame(skp.x, select_list.y+50, 180, 80, T_PICTURE_MODE);
optionbox_stretch.draw(skp.x+14, select_list.y+70);
optionbox_tiled.draw(skp.x+14, select_list.y+97);
} }
} }
@ -361,6 +376,20 @@ void EventSelectWallpFolder()
} }
} }
void EventSetWallpMode_Stretch()
{
optionbox_tiled.checked = false;
optionbox_tiled.redraw();
EventApply();
}
void EventSetWallpMode_Tiled()
{
optionbox_stretch.checked = false;
optionbox_stretch.redraw();
EventApply();
}
void EventApply() void EventApply()
{ {
char kivpath[4096+10]; char kivpath[4096+10];
@ -375,7 +404,8 @@ void EventApply()
if (tabs.active_tab==WALLPAPERS) if (tabs.active_tab==WALLPAPERS)
{ {
SelectList_Draw(); SelectList_Draw();
strcpy(#kivpath, "\\S__"); if (optionbox_stretch.checked) strcpy(#kivpath, "\\S__");
if (optionbox_tiled.checked) strcpy(#kivpath, "\\T__");
strcat(#kivpath, #cur_file_path); strcat(#kivpath, #cur_file_path);
RunProgram("/sys/media/kiv", #kivpath); RunProgram("/sys/media/kiv", #kivpath);
} }

View File

@ -146,7 +146,7 @@ void _SystemDiscs::Draw()
_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*6+dev_icon*17*18*3+#devices); _PutImage(draw_x + 5, draw_y+2, 18,17, is_active*6+dev_icon*17*18*3+#devices);
WriteText(draw_x + 24, draw_y+3, 10110000b, 0, #dev_name+1); WriteText(draw_x + 24, draw_y+3, 10110000b, 0, #dev_name+1);
draw_x += name_len + 31; draw_x += name_len + 31;
if (draw_x>=Form.width-35) && (Form.width) { if (draw_x>=Form.cwidth-100) && (Form.cwidth) {
DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF); DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF);
draw_x = 2; draw_x = 2;
draw_y += draw_h; draw_y += draw_h;