WebView: refresh the page of clear cache, bugfixes

git-svn-id: svn://kolibrios.org@7893 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-05-07 21:13:43 +00:00
parent b88f3e2118
commit 88a13211ae
5 changed files with 24 additions and 13 deletions

View File

@ -35,6 +35,7 @@ struct TWebBrowser {
dword o_bufpointer;
int cur_encoding, custom_encoding;
bool link, t_html, t_body;
dword link_bg;
dword bufpointer;
dword bufsize;
@ -121,6 +122,7 @@ void TWebBrowser::SetPageDefaults()
link_color_default = 0x0000FF;
link_color_active = 0xFF0000;
page_bg = 0xFFFFFF;
link_bg = 0xFFFFFF;
style.bg_color = page_bg;
DrawBuf.Fill(0, page_bg);
PageLinks.Clear();
@ -331,9 +333,10 @@ void TWebBrowser::SetStyle() {
}
if (tag.is("body")) {
t_body = tag.opened;
if (value = tag.get_value_of("link=")) link_color_default = GetColor(value);
if (value = tag.get_value_of("alink=")) link_color_active = GetColor(value);
if (value = tag.get_value_of("text=")) text_colors[0]=GetColor(value);
if (value = tag.get_value_of("link=")) link_color_default = GetColor(value);
if (value = tag.get_value_of("alink=")) link_color_active = GetColor(value);
if (value = tag.get_value_of("bglink=")) link_bg=GetColor(value);
if (value = tag.get_value_of("text=")) text_colors[0]=GetColor(value);
if (value = tag.get_value_of("bgcolor=")) {
style.bg_color = page_bg = GetColor(value);
DrawBuf.Fill(0, page_bg);
@ -358,9 +361,11 @@ void TWebBrowser::SetStyle() {
{
link = true;
PageLinks.AddLink(value);
style.bg_color = link_bg;
}
} else {
link = false;
style.bg_color = page_bg;
}
return;
}

View File

@ -390,12 +390,7 @@ void ProcessEvent(dword id__)
EventSubmitOmnibox();
return;
case REFRESH_BUTTON:
if (http.transfer) {
StopLoading();
draw_window();
} else {
OpenPage(history.current());
}
EventRefreshPage();
return;
case CHANGE_ENCODING:
EventShowEncodingsList();
@ -429,6 +424,7 @@ void ProcessEvent(dword id__)
case CLEAR_CACHE:
pages_cache.clear();
notify(#clear_cache_ok);
EventRefreshPage();
return;
case IN_NEW_TAB:
open_new_tab = true;
@ -811,6 +807,16 @@ void EventViewSource()
EventOpenNewTab(history.current());
}
void EventRefreshPage()
{
if (http.transfer) {
StopLoading();
draw_window();
} else {
OpenPage(history.current());
}
}
dword GetFileSize(dword _path)
{
BDVK bdvk;

View File

@ -1,4 +1,4 @@
char version[]="WebView 2.47b";
char version[]="WebView 2.48";
#ifdef LANG_RUS
char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0";

View File

@ -16,7 +16,7 @@ $DD 2 dup 0
char aIconv_open[] = "iconv_open";
char aIconv[] = "iconv";
char charsets[] = "UTF-8\0 KOI8-RU\0 CP1251\0 CP1252\0 ISO8859-5\0CP866 \0AUTO";
char charsets[] = "UTF-8\0 KOI8-RU\0 CP1251\0 CP1252\0 ISO8859-5\0CP866\0 AUTO";
enum { CH_UTF8, CH_KOI8, CH_CP1251, CH_CP1252, CH_ISO8859_5, CH_CP866, CH_AUTO };
dword ChangeCharset(dword from_chs, to_chs, conv_buf)

View File

@ -195,9 +195,9 @@ struct _Image
//NOTICE: DO NOT FORGET TO INIT libio AND libimg!!!
#ifdef LANG_RUS
#define TEXT_FILE_SAVED_AS "'File saved as "
#else
#define TEXT_FILE_SAVED_AS "'” ©« á®åà ­¥­ ª ª "
#else
#define TEXT_FILE_SAVED_AS "'File saved as "
#endif
:void save_image(dword _image_pointer, _w, _h, _path)
{