diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index d5b037fe3d..09d90210c7 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -83,6 +83,7 @@ enum { GO_BACK = 'goba', GO_FORWARD = 'gofo', STOP = 'stop', + HOME = 'home', GOTO_URL = 'goul', RELOAD = 'reld', CLEAR_HISTORY = 'clhs', @@ -359,6 +360,10 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings, fStopButton->SetIcon(204); fStopButton->TrimIcon(); + fHomeButton = new IconButton("Home", 0, NULL, new BMessage(HOME)); + fHomeButton->SetIcon(206); + fHomeButton->TrimIcon(); + // URL input group fURLInputGroup = new URLInputGroup(new BMessage(GOTO_URL)); @@ -402,12 +407,14 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings, // Navigation group BView* navigationGroup = BGroupLayoutBuilder(B_VERTICAL) - .Add(BGridLayoutBuilder(kElementSpacing, kElementSpacing) - .Add(fBackButton, 0, 0) - .Add(fForwardButton, 1, 0) - .Add(fStopButton, 2, 0) - .Add(fURLInputGroup, 3, 0) - .SetInsets(kInsetSpacing, kInsetSpacing, kInsetSpacing, kInsetSpacing) + .Add(BGroupLayoutBuilder(B_HORIZONTAL, kElementSpacing) + .Add(fBackButton) + .Add(fForwardButton) + .Add(fStopButton) + .Add(fHomeButton) + .Add(fURLInputGroup) + .SetInsets(kInsetSpacing, kInsetSpacing, kInsetSpacing, + kInsetSpacing) ) .Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER)) ; @@ -580,6 +587,9 @@ BrowserWindow::MessageReceived(BMessage* message) case STOP: CurrentWebView()->StopLoading(); break; + case HOME: + CurrentWebView()->LoadURL(fStartPageURL); + break; case CLEAR_HISTORY: { BrowsingHistory* history = BrowsingHistory::DefaultInstance(); diff --git a/src/apps/webpositive/BrowserWindow.h b/src/apps/webpositive/BrowserWindow.h index 16cb5d2b3d..6ef6f4d034 100644 --- a/src/apps/webpositive/BrowserWindow.h +++ b/src/apps/webpositive/BrowserWindow.h @@ -204,6 +204,7 @@ private: IconButton* fBackButton; IconButton* fForwardButton; IconButton* fStopButton; + IconButton* fHomeButton; URLInputGroup* fURLInputGroup; BStringView* fStatusText; BStatusBar* fLoadingProgressBar; diff --git a/src/apps/webpositive/WebPositive.rdef b/src/apps/webpositive/WebPositive.rdef index 5b89991cc9..c9561eebac 100644 --- a/src/apps/webpositive/WebPositive.rdef +++ b/src/apps/webpositive/WebPositive.rdef @@ -296,6 +296,19 @@ resource(204, "kActionStop") #'VICN' array { $"000A0503070809100117810004" }; +resource(206, "kActionGoStart") #'VICN' array { + $"6E63696605050002001602B53D77BAF2653D77A7B7CFFC460F874A2D7700F0FF" + $"D50200160236FB2637191CBC57873C40E14B0E7149D82700A2FFBB0200060239" + $"FB483A6DC2BDAC713D02DB4B384746086300EA0606FFD005050200060238B0C7" + $"397C47BD2A963C71B74A82C348B2B700FF4444FFF106060A0A06304942525044" + $"50383E32303D0A09303B3049324A32C0723643364C4252424036320A04503650" + $"44425242400A082D3E3535434645455439462C35312B3C0A062B3C2D3E353543" + $"46454535310A0445455439462C35310A0432C072324A364C36430A043A453A4A" + $"3E4C3EC2630A044645464A484848430A044C3F4C444E424E3D070A0001001001" + $"178400040A010101000A020102000A000406070809000A000103100117840004" + $"0A030105000A04010400" +}; + resource(205, "kActionGo") archive BBitmap { "_frame" = rect { 0.0, 0.0, 15.0, 15.0 }, "_cspace" = 8200,