WebPositive: Style fixes, 80 char limit and ws

This commit is contained in:
John Scipione
2014-01-30 19:48:33 -05:00
parent 9f7f92dd7f
commit 741987bed7
2 changed files with 25 additions and 6 deletions
+24 -6
View File
@@ -701,6 +701,7 @@ BrowserWindow::DispatchMessage(BMessage* message, BHandler* target)
return; return;
} }
} }
if (message->what == B_MOUSE_MOVED || message->what == B_MOUSE_DOWN if (message->what == B_MOUSE_MOVED || message->what == B_MOUSE_DOWN
|| message->what == B_MOUSE_UP) { || message->what == B_MOUSE_UP) {
message->FindPoint("where", &fLastMousePos); message->FindPoint("where", &fLastMousePos);
@@ -708,6 +709,7 @@ BrowserWindow::DispatchMessage(BMessage* message, BHandler* target)
fLastMouseMovedTime = system_time(); fLastMouseMovedTime = system_time();
_CheckAutoHideInterface(); _CheckAutoHideInterface();
} }
if (message->what == B_MOUSE_WHEEL_CHANGED) { if (message->what == B_MOUSE_WHEEL_CHANGED) {
BPoint where; BPoint where;
uint32 buttons; uint32 buttons;
@@ -729,9 +731,13 @@ BrowserWindow::DispatchMessage(BMessage* message, BHandler* target)
return; return;
} }
} }
} else // Also don't scroll up and down if the mouse is not over the web view } else {
// Also don't scroll up and down if the mouse is not over the
// web view
return; return;
}
} }
BWebWindow::DispatchMessage(message, target); BWebWindow::DispatchMessage(message, target);
} }
@@ -747,9 +753,11 @@ BrowserWindow::MessageReceived(BMessage* message)
else else
fURLInputGroup->MakeFocus(true); fURLInputGroup->MakeFocus(true);
break; break;
case RELOAD: case RELOAD:
CurrentWebView()->Reload(); CurrentWebView()->Reload();
break; break;
case GOTO_URL: case GOTO_URL:
{ {
BString url; BString url;
@@ -761,15 +769,19 @@ BrowserWindow::MessageReceived(BMessage* message)
break; break;
} }
case GO_BACK: case GO_BACK:
CurrentWebView()->GoBack(); CurrentWebView()->GoBack();
break; break;
case GO_FORWARD: case GO_FORWARD:
CurrentWebView()->GoForward(); CurrentWebView()->GoForward();
break; break;
case STOP: case STOP:
CurrentWebView()->StopLoading(); CurrentWebView()->StopLoading();
break; break;
case HOME: case HOME:
CurrentWebView()->LoadURL(fStartPageURL); CurrentWebView()->LoadURL(fStartPageURL);
break; break;
@@ -792,13 +804,15 @@ BrowserWindow::MessageReceived(BMessage* message)
case CREATE_BOOKMARK: case CREATE_BOOKMARK:
_CreateBookmark(); _CreateBookmark();
break; break;
case SHOW_BOOKMARKS: case SHOW_BOOKMARKS:
_ShowBookmarks(); _ShowBookmarks();
break; break;
case B_REFS_RECEIVED: case B_REFS_RECEIVED:
{ {
// Currently the only source of these messages is the bookmarks menu. // Currently the only source of these messages is the bookmarks
// menu.
// Filter refs into URLs, this also gets rid of refs for folders. // Filter refs into URLs, this also gets rid of refs for folders.
// For clicks on sub-folders in the bookmarks menu, we have Tracker // For clicks on sub-folders in the bookmarks menu, we have Tracker
// open the corresponding folder. // open the corresponding folder.
@@ -830,12 +844,15 @@ BrowserWindow::MessageReceived(BMessage* message)
} }
message->RemoveName("refs"); message->RemoveName("refs");
if (addedCount > 10) { if (addedCount > 10) {
BString string(B_TRANSLATE_COMMENT("Do you want to open %addedCount " BString string(B_TRANSLATE_COMMENT("Do you want to open "
"bookmarks all at once?", "Don't translate variable %addedCount.")); "%addedCount bookmarks all at once?", "Don't translate "
"variable %addedCount."));
string.ReplaceFirst("%addedCount", BString() << addedCount); string.ReplaceFirst("%addedCount", BString() << addedCount);
BAlert* alert = new BAlert(B_TRANSLATE("Open bookmarks confirmation"), BAlert* alert = new BAlert(
string.String(), B_TRANSLATE("Cancel"), B_TRANSLATE("Open all")); B_TRANSLATE("Open bookmarks confirmation"),
string.String(), B_TRANSLATE("Cancel"),
B_TRANSLATE("Open all"));
alert->SetShortcut(0, B_ESCAPE); alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0) if (alert->Go() == 0)
break; break;
@@ -844,6 +861,7 @@ BrowserWindow::MessageReceived(BMessage* message)
be_app->PostMessage(message); be_app->PostMessage(message);
break; break;
} }
case B_SIMPLE_DATA: case B_SIMPLE_DATA:
{ {
// User possibly dropped files on this window. // User possibly dropped files on this window.
+1
View File
@@ -202,6 +202,7 @@ URLInputGroup::URLTextView::MessageReceived(BMessage* message)
case MSG_CLEAR: case MSG_CLEAR:
SetText(""); SetText("");
break; break;
default: default:
BTextView::MessageReceived(message); BTextView::MessageReceived(message);
break; break;