/***************************************************************************
- * Copyright (C) 2006 by Peter Penz *
- * peter.penz@gmx.at *
+ * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
+#include "bookmarkselector.h"
#include <assert.h>
#include <q3popupmenu.h>
#include <kglobalsettings.h>
#include <kbookmarkmanager.h>
-#include "bookmarkselector.h"
#include "dolphinsettings.h"
-#include "dolphinview.h"
-#include "dolphinmainwindow.h"
#include "urlnavigator.h"
BookmarkSelector::BookmarkSelector(UrlNavigator* parent) :
UrlButton(parent),
- m_selectedIndex(0)
+ m_selectedIndex(0),
+ m_urlNavigator(parent)
{
setFocusPolicy(Qt::NoFocus);
return QSize(height, height);
}
-void BookmarkSelector::paintEvent(QPaintEvent* event)
+void BookmarkSelector::paintEvent(QPaintEvent* /*event*/)
{
QPainter painter(this);
}
// dimm the colors if the parent view does not have the focus
- const DolphinView* parentView = urlNavigator()->dolphinView();
- const DolphinMainWindow* dolphin = parentView->mainWindow();
-
- const bool isActive = (dolphin->activeView() == parentView);
+ const bool isActive = m_urlNavigator->isActive();
if (!isActive) {
QColor dimmColor(palette().brush(QPalette::Background).color());
foregroundColor = mixColors(foregroundColor, dimmColor);
{
m_selectedIndex = index;
- KBookmark bookmark = selectedBookmark();
+ const KBookmark bookmark = selectedBookmark();
setPixmap(SmallIcon(bookmark.icon()));
-
- emit bookmarkActivated(index);
+ emit bookmarkActivated(bookmark.url());
}
#include "bookmarkselector.moc"