From 81ef95c4b3a713e8e5e5e4d7630eb20bd65d1f51 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 15 Feb 2015 10:18:26 +0000 Subject: [PATCH] WebView beta 6.2: hamburger icon, fix menu position, use libimg pattern git-svn-id: svn://kolibrios.org@5408 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/browser/WebView.c | 22 ++++++++----------- programs/cmm/browser/menu_rmb.h | 2 +- programs/cmm/browser/wv_skin.png | Bin 2310 -> 2004 bytes programs/cmm/lib/patterns/libimg_load_skin.h | 13 +++++++++++ 4 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 programs/cmm/lib/patterns/libimg_load_skin.h diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index f5bdbe3c16..090d24bd83 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -26,17 +26,20 @@ #include "..\lib\lib.obj\libimg_lib.h" #include "..\lib\lib.obj\http.h" +//useful patterns +#include "..\lib\patterns\libimg_load_skin.h" + char homepage[] = FROM "html\homepage.htm"; #ifdef LANG_RUS - char version[]=" Текстовый браузер 1.0 Beta 6.1"; + char version[]=" Текстовый браузер 1.0 Beta 6.2"; ?define IMAGES_CACHE_CLEARED "Кэш картинок очищен" ?define T_LAST_SLIDE "Это последний слайд" char loading[] = "Загрузка страницы...
"; char page_not_found[] = FROM "html\page_not_found_ru.htm"; char accept_language[]= "Accept-Language: ru\n"; #else - char version[]=" Text-based Browser 1.0 Beta 6.1"; + char version[]=" Text-based Browser 1.0 Beta 6.2"; ?define IMAGES_CACHE_CLEARED "Images cache cleared" ?define T_LAST_SLIDE "This slide is the last" char loading[] = "Loading...
"; @@ -85,20 +88,12 @@ edit_box address_box = {250,55,34,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(U enum { BACK=300, FORWARD, REFRESH, HOME, NEWTAB, GOTOURL, SEARCHWEB, INPUT_CH, INPUT_BT, BTN_UP, BTN_DOWN }; -struct struct_skin { - dword image, w, h; - int Load(); -} skin; +libimg_image skin; -int struct_skin::Load() +int SetSkinColors() { dword image_data; - skin.image = load_image(abspath("wv_skin.png")); - if (!skin.image) notify("WebView skin file 'wv_skin.png' not found, program will terminate"); - skin.w = DSWORD[skin.image+4]; - skin.h = DSWORD[skin.image+8]; image_data = DSDWORD[skin.image+24]; - col_bg = DSDWORD[image_data]; panel_color = DSDWORD[skin.w*4*4 + image_data]; border_color = DSDWORD[skin.w*4*7 + image_data]; @@ -132,7 +127,8 @@ void main() if (load_dll2(libio, #libio_init,1)!=0) notify("Error: library doesn't exists - libio"); if (load_dll2(libimg, #libimg_init,1)!=0) notify("Error: library doesn't exists - libimg"); if (load_dll2(libHTTP, #http_lib_init,1)!=0) notify("Error: library doesn't exists - http"); - skin.Load(); + Libimg_LoadImage(#skin, abspath("wv_skin.png")); + SetSkinColors(); Form.width=WIN_W; Form.height=WIN_H; diff --git a/programs/cmm/browser/menu_rmb.h b/programs/cmm/browser/menu_rmb.h index 24e3eb1eac..4cf854c0ef 100644 --- a/programs/cmm/browser/menu_rmb.h +++ b/programs/cmm/browser/menu_rmb.h @@ -54,7 +54,7 @@ void menu_rmb() break; case evReDraw: - DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,menu.w+2,menu.h+4,0x01, 0, 0, 0x01fffFFF); + DefineAndDrawWindow(Form.left+m.x-6,Form.top+m.y+GetSkinHeight()+3,menu.w+2,menu.h+4,0x01, 0, 0, 0x01fffFFF); DrawPopup(0,0,menu.w,menu.h+3,0, col_bg,border_color); DrawMenuList(); } diff --git a/programs/cmm/browser/wv_skin.png b/programs/cmm/browser/wv_skin.png index 8351a0d143f050ede8f0f0dfeac5bf3aae595b41..91adf4cd33315e16c032e07734ba76458bb36206 100644 GIT binary patch delta 1991 zcmV;&2RQhK64VcnBYy{*Nkl#y?v|z<8MT8EDu&jVUgQoEdA`(9~ z8#P%c-mq)*h6~*_G2X!F#zY4TDy#7`&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