23 |
23 |
24 #include "BookmarksToolbarSnippet.h" |
24 #include "BookmarksToolbarSnippet.h" |
25 #include "ToolbarChromeItem.h" |
25 #include "ToolbarChromeItem.h" |
26 #include "ViewStack.h" |
26 #include "ViewStack.h" |
27 #include "GWebContentView.h" |
27 #include "GWebContentView.h" |
28 #include "BookmarksManager.h" |
28 #include "HistoryManager.h" |
29 #include <QDebug> |
29 #include <QDebug> |
30 |
30 |
31 namespace GVA { |
31 namespace GVA { |
32 |
32 |
33 BookmarksToolbarSnippet::BookmarksToolbarSnippet(const QString& elementId, ChromeWidget * chrome, |
33 BookmarksToolbarSnippet::BookmarksToolbarSnippet(const QString& elementId, ChromeWidget * chrome, |
34 const QWebElement & element) |
34 const QWebElement & element) |
35 : DualButtonToolbarSnippet(elementId, chrome, element), |
35 : DualButtonToolbarSnippet(elementId, chrome, element), |
36 m_action1(0), m_action2(0) |
36 m_action1(0), m_action2(0) |
37 { |
37 { |
|
38 connect(m_chrome, SIGNAL(aspectChanged(int)) , this, SLOT(onAspectChanged())); |
38 } |
39 } |
39 |
40 |
40 BookmarksToolbarSnippet::~BookmarksToolbarSnippet() |
41 BookmarksToolbarSnippet::~BookmarksToolbarSnippet() |
41 { |
42 { |
42 if(m_action1) |
43 if(m_action1) |
43 delete m_action1; |
44 delete m_action1; |
44 if(m_action2) |
45 if(m_action2) |
45 delete m_action2; |
46 delete m_action2; |
46 } |
47 } |
47 |
48 |
|
49 void BookmarksToolbarSnippet::onAspectChanged( ) { |
|
50 |
|
51 updateOwnerArea(); |
|
52 |
|
53 } |
48 BookmarksToolbarSnippet * BookmarksToolbarSnippet::instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element) |
54 BookmarksToolbarSnippet * BookmarksToolbarSnippet::instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element) |
49 { |
55 { |
50 BookmarksToolbarSnippet * that = new BookmarksToolbarSnippet( elementId, chrome, element ); |
56 BookmarksToolbarSnippet * that = new BookmarksToolbarSnippet( elementId, chrome, element ); |
51 that->setChromeWidget( new ToolbarChromeItem( that ) ); |
57 that->setChromeWidget( new ToolbarChromeItem( that ) ); |
52 return that; |
58 return that; |