From 14f3457eb89f071906191d9a7752607c1ae4b69d Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Fri, 10 Apr 2020 16:37:34 +0000 Subject: [PATCH] WebView 2.4a: bugfix git-svn-id: svn://kolibrios.org@7772 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/browser/WebView.c | 60 +++++++++++++++++++++++++--------- programs/cmm/browser/texts.h | 2 +- 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index 67752efabc..0f400e8cff 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -180,21 +180,7 @@ void main() if (key_scancode == SCAN_CODE_TAB) {EventActivatePreviousTab();break;} } - if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) { - if (key_scancode == SCAN_CODE_KEY_O) EventOpenDialog(); - else if (key_scancode == SCAN_CODE_KEY_H) ProcessEvent(VIEW_HISTORY); - else if (key_scancode == SCAN_CODE_KEY_U) EventViewSource(); - else if (key_scancode == SCAN_CODE_KEY_T) EventOpenNewTab(URL_SERVICE_HOMEPAGE); - else if (key_scancode == SCAN_CODE_KEY_N) RunProgram(#program_path, NULL); - else if (key_scancode == SCAN_CODE_KEY_J) ProcessEvent(DOWNLOAD_MANAGER); - else if (key_scancode == SCAN_CODE_KEY_R) ProcessEvent(REFRESH_BUTTON); - else if (key_scancode == SCAN_CODE_ENTER) EventSeachWeb(); - else if (key_scancode == SCAN_CODE_LEFT) ProcessEvent(BACK_BUTTON); - else if (key_scancode == SCAN_CODE_RIGHT) ProcessEvent(FORWARD_BUTTON); - else if (key_scancode == SCAN_CODE_KEY_W) EventCloseActiveTab(); - else if (key_scancode == SCAN_CODE_TAB) EventActivateNextTab(); - break; - } + if (ProcessCtrlKeyEvent()) break; if (key_scancode == SCAN_CODE_F5) ProcessEvent(REFRESH_BUTTON); @@ -256,6 +242,50 @@ void main() } } +bool ProcessCtrlKeyEvent() +{ + if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) switch(key_scancode) + { + case SCAN_CODE_KEY_O: + EventOpenDialog(); + return true; + case SCAN_CODE_KEY_H: + ProcessEvent(VIEW_HISTORY); + return true; + case SCAN_CODE_KEY_U: + EventViewSource(); + return true; + case SCAN_CODE_KEY_T: + EventOpenNewTab(URL_SERVICE_HOMEPAGE); + return true; + case SCAN_CODE_KEY_N: + RunProgram(#program_path, NULL); + return true; + case SCAN_CODE_KEY_J: + ProcessEvent(DOWNLOAD_MANAGER); + return true; + case SCAN_CODE_KEY_R: + ProcessEvent(REFRESH_BUTTON); + return true; + case SCAN_CODE_ENTER: + EventSeachWeb(); + return true; + case SCAN_CODE_LEFT: + ProcessEvent(BACK_BUTTON); + return true; + case SCAN_CODE_RIGHT: + ProcessEvent(FORWARD_BUTTON); + return true; + case SCAN_CODE_KEY_W: + EventCloseActiveTab(); + return true; + case SCAN_CODE_TAB: + EventActivateNextTab(); + return true; + } + return false; +} + void SetElementSizes() { address_box.width = Form.cwidth - address_box.left - 52 - 16; diff --git a/programs/cmm/browser/texts.h b/programs/cmm/browser/texts.h index 504bfb3ee8..897921f760 100644 --- a/programs/cmm/browser/texts.h +++ b/programs/cmm/browser/texts.h @@ -1,4 +1,4 @@ -char version[]="WebView 2.4"; +char version[]="WebView 2.4a"; #ifdef LANG_RUS char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0";