  }
  
  
-@@ -621,6 +630,8 @@ NSBrowserWindow::QuitRequested(void)
+@@ -621,6 +637,8 @@ NSBrowserWindow::QuitRequested(void)
  }
  
  

 	// asynchronously
 	a->Go(NULL);
 
diff --git a/beos/scaffolding.cpp b/beos/scaffolding.cpp
index 4003b09..3455baf 100644
--- a/beos/scaffolding.cpp
+++ b/beos/scaffolding.cpp
@@ -38,6 +38,9 @@
 #include <TextControl.h>
 #include <View.h>
 #include <Window.h>
+#if defined(__HAIKU__)
+#include "WindowStack.h"
+#endif
 #include <fs_attr.h>
 extern "C" {
 #include "content/content.h"
@@ -571,6 +574,12 @@ NSBrowserWindow::NSBrowserWindow(BRect frame, struct beos_scaffolding *scaf)
 	: BWindow(frame, "NetSurf", B_DOCUMENT_WINDOW, 0),
 	fScaffolding(scaf)
 {

 // #pragma mark - implementation
 
 int32 nsbeos_replicant_main_thread(void *_arg)
@@ -1659,6 +1677,90 @@ static BMenuItem *make_menu_item(const char *name, BMessage *message)
 	return item;
 }
 
+
+class BBitmapButton: public BButton
+{
+	public:
+		BBitmapButton(BRect rect, const char* name, const char* label,
+			BMessage* message);
+		~BBitmapButton();
+
+		void Draw(BRect updateRect);
+		void SetBitmap(const char* attrName);
+	private:
+		BBitmap* fBitmap;
+};
+
+
+BBitmapButton::BBitmapButton(BRect rect, const char* name, const char* label,
+		BMessage* message)
+	: BButton(rect, name, label, message)
+{
+	SetBitmap(name);
+}
+
+
+BBitmapButton::~BBitmapButton()
+{
+	delete fBitmap;
+}
+
+
+void BBitmapButton::Draw(BRect updateRect)
+{
+	if(fBitmap == NULL) {
+		BButton::Draw(updateRect);
+		return;
+	}
+
+	SetDrawingMode(B_OP_COPY);
+	FillRect(updateRect, B_SOLID_LOW);
+	rgb_color color = LowColor();
+
+	SetDrawingMode(B_OP_ALPHA);
+	if(Value() != 0) {
+		// button is clicked
+		DrawBitmap(fBitmap, BPoint(1, 1));
+	} else {
+		// button is released
+		DrawBitmap(fBitmap, BPoint(0, 0));
+	}
+
+	if(!IsEnabled())
+	{
+		color.alpha = 127;
+		SetLowColor(color);
+		FillRect(updateRect, B_SOLID_LOW);
+	}
+}
+
+
+void BBitmapButton::SetBitmap(const char* attrname)
+{
+#ifdef __HAIKU__
+	size_t size = 0;
+	const void* data = BApplication::AppResources()->LoadResource('VICN', attrname, &size);
+
+	if (!data) {
+		printf("CANT LOAD RESOURCE %s\n", attrname);
+		return;
+	}
+
+	fBitmap = new BBitmap(BRect(0, 0, 32, 32), B_RGB32);
+	status_t status = BIconUtils::GetVectorIcon((const uint8*)data, size, fBitmap);
+	
+	if(status != B_OK) {
+		fprintf(stderr, "%s > oops %s\n", attrname, strerror(status));
+		delete fBitmap;
+		fBitmap = NULL;
+	}
+#else
+	// No vector icon support on BeOS. We could try to load a bitmap one
+	fBitmap = NULL;
+#endif
+}
+
+
 nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
 {
 	struct beos_scaffolding *g = (struct beos_scaffolding *)malloc(sizeof(*g));
@@ -2038,14 +2140,13 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
 	rect = g->top_view->Bounds();
 	rect.bottom = rect.top + TOOLBAR_HEIGHT - 1;
 	rect.right = rect.right - DRAGGER_WIDTH;
-	g->tool_bar = new BView(rect, "Toolbar", 
+	g->tool_bar = new BBox(rect, "Toolbar", 
 		B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, B_WILL_DRAW);
 	g->top_view->AddChild(g->tool_bar);
 	g->tool_bar->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
 	g->tool_bar->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)) ;
 
 	// buttons
-#warning use BPictureButton
 	rect = g->tool_bar->Bounds();
 	rect.right = TOOLBAR_HEIGHT;
 	rect.InsetBySelf(5, 5);
@@ -2054,35 +2155,35 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
 
 	message = new BMessage('back');
 	message->AddPointer("scaffolding", g);
-	g->back_button = new BButton(rect, "back_button", "<", message);
+	g->back_button = new BBitmapButton(rect, "back_button", "<", message);
 	g->tool_bar->AddChild(g->back_button);
 	nButtons++;
 
 	rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
 	message = new BMessage('forw');
 	message->AddPointer("scaffolding", g);
-	g->forward_button = new BButton(rect, "forward_button", ">", message);
+	g->forward_button = new BBitmapButton(rect, "forward_button", ">", message);
 	g->tool_bar->AddChild(g->forward_button);
 	nButtons++;
 
 	rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
 	message = new BMessage('stop');
 	message->AddPointer("scaffolding", g);
-	g->stop_button = new BButton(rect, "stop_button", "S", message);
+	g->stop_button = new BBitmapButton(rect, "stop_button", "S", message);
 	g->tool_bar->AddChild(g->stop_button);
 	nButtons++;
 
 	rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
 	message = new BMessage('relo');
 	message->AddPointer("scaffolding", g);
-	g->reload_button = new BButton(rect, "reload_button", "R", message);
+	g->reload_button = new BBitmapButton(rect, "reload_button", "R", message);
 	g->tool_bar->AddChild(g->reload_button);
 	nButtons++;
 
 	rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
 	message = new BMessage('home');
 	message->AddPointer("scaffolding", g);
-	g->home_button = new BButton(rect, "home_button", "H", message);
+	g->home_button = new BBitmapButton(rect, "home_button", "H", message);
 	g->tool_bar->AddChild(g->home_button);
 	nButtons++;
 
@@ -2407,3 +2508,4 @@ void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *g, BPoint where)
 {
 	g->popup_menu->Go(where);
 }
