ginebra2/RecentUrlToolbarSnippet.cpp
changeset 6 1c3b8676e58c
parent 5 0f2326c2a325
child 15 73c48011b8c7
--- a/ginebra2/RecentUrlToolbarSnippet.cpp	Wed Jun 23 17:59:43 2010 +0300
+++ b/ginebra2/RecentUrlToolbarSnippet.cpp	Tue Jul 06 14:03:49 2010 +0300
@@ -22,6 +22,7 @@
  */
 
 #include "RecentUrlToolbarSnippet.h"
+#include "ToolbarChromeItem.h"
 #include "ViewStack.h"
 #include "GWebContentView.h"
 #include "BookmarksManager.h"
@@ -30,8 +31,8 @@
 namespace GVA {
 
     RecentUrlToolbarSnippet::RecentUrlToolbarSnippet(const QString& elementId, ChromeWidget * chrome,
-                                                     const QRectF& ownerArea, const QWebElement & element, QGraphicsWidget * widget)
-        : DualButtonToolbarSnippet(elementId, chrome, ownerArea, element, widget),
+                                                     const QWebElement & element)
+        : DualButtonToolbarSnippet(elementId, chrome, element),
           m_action1(0)
     {      
     }
@@ -42,6 +43,13 @@
             delete m_action1;
     }
 
+    RecentUrlToolbarSnippet * RecentUrlToolbarSnippet::instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element)
+    {
+        RecentUrlToolbarSnippet * that = new RecentUrlToolbarSnippet( elementId, chrome, element );
+        that->setChromeWidget( new ToolbarChromeItem( that ) );
+        return that;
+    }
+    
     void RecentUrlToolbarSnippet::addChild(ChromeSnippet * child) {
         WebChromeContainerSnippet * s =  dynamic_cast<WebChromeContainerSnippet* >(child);
         if (!s) {
@@ -49,16 +57,16 @@
             if (child->elementId() == "RecentBackButton" ) {
                 t->actionId = RECENTURL_VIEW_ACTION_BACK;
                 t->actionName = RECENTURL_TOOLBAR_BACK;
-                t->activeImg = ":/chrome/bedrockchrome/toolbar.snippet/icons/icon_back.png";
+                t->normalImg = ":/chrome/bedrockchrome/toolbar.snippet/icons/icon_back.png";
                 t->disabledImg = "";
-                t->selectedImg = ":/chrome/bedrockchrome/toolbar.snippet/icons/icon_back_pressed.png";
+                t->activeImg = ":/chrome/bedrockchrome/toolbar.snippet/icons/icon_back_pressed.png";
             }
             else if (child->elementId() == "RecentClearallButton" ) {
                 t->actionId = RECENTURL_VIEW_ACTION_CLEARALL;
                 t->actionName = RECENTURL_TOOLBAR_CLEARALL;
-                t->activeImg = ":/chrome/bedrockchrome/toolbar.snippet/icons/icon_clearall.png";
+                t->normalImg = ":/chrome/bedrockchrome/toolbar.snippet/icons/icon_clearall.png";
                 t->disabledImg = ":/chrome/bedrockchrome/toolbar.snippet/icons/icon_clearall_disabled.png";
-                t->selectedImg = ":/chrome/bedrockchrome/toolbar.snippet/icons/icon_clearall_pressed.png";
+                t->activeImg = ":/chrome/bedrockchrome/toolbar.snippet/icons/icon_clearall_pressed.png";
             }
             t->id = child->elementId();
             m_actionInfo.append(t);