From 068d5a71948365d55b39abed862b3bc8b980127b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 21 Aug 2010 10:29:02 +0200 Subject: Restore bk icon on the right This commit intends to revert manually commits de9abc72 && bd27f60d, restoring bk positions on the right. This because most of the developers prefer so. Anyway, if things will change again we can revert the "revertion" :D --- src/urlbar/bookmarkwidget.cpp | 2 +- src/urlbar/urlbar.cpp | 29 ++++++++++++++--------------- src/urlbar/urlbar.h | 1 + 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/urlbar') diff --git a/src/urlbar/bookmarkwidget.cpp b/src/urlbar/bookmarkwidget.cpp index 0e05e776..cb711723 100644 --- a/src/urlbar/bookmarkwidget.cpp +++ b/src/urlbar/bookmarkwidget.cpp @@ -144,7 +144,7 @@ void BookmarkWidget::reject() void BookmarkWidget::showAt(const QPoint &pos) { QPoint p; - p.setX(pos.x()); + p.setX(pos.x() - 350); p.setY(pos.y() + 12); move(p); show(); diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index c272d819..b4117601 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -112,9 +112,7 @@ UrlBar::UrlBar(QWidget *parent) connect(_tab->view(), SIGNAL(loadStarted()), this, SLOT(clearRightIcons())); // bookmark icon - _icon->setIcon(KIcon("bookmarks").pixmap(32,32, QIcon::Disabled)); connect(Application::bookmarkProvider()->bookmarkManager(), SIGNAL(changed(const QString &, const QString &)), this, SLOT(onBookmarksChanged())); - connect(_icon, SIGNAL(clicked(const QPoint &)), this, SLOT(showBookmarkInfo(const QPoint &))); // load typed urls connect(this, SIGNAL(returnPressed(const QString &)), this, SLOT(loadTyped(const QString &))); @@ -147,8 +145,7 @@ void UrlBar::setQUrl(const QUrl& url) clearFocus(); KLineEdit::setUrl(url); setCursorPosition(0); -// _icon->setIcon(Application::icon(url)); -// updateIcon(); + _icon->setIcon(Application::icon(url)); } } @@ -310,17 +307,9 @@ void UrlBar::loadFinished() return; } - // setting bookmark icon - if (Application::bookmarkProvider()->bookmarkForUrl(_tab->url()).isNull()) - { - _icon->setIcon(KIcon("bookmarks").pixmap(32,32, QIcon::Disabled)); - _icon->setToolTip(i18n("Bookmark this page")); - } - else - { - _icon->setIcon(KIcon("bookmarks")); - _icon->setToolTip(i18n("Edit this bookmark")); - } + // show bookmark info + IconButton *bt = addRightIcon(UrlBar::BK); + connect(bt, SIGNAL(clicked(const QPoint &)), this, SLOT(showBookmarkInfo(const QPoint &))); // show KGet downloads?? if (!KStandardDirs::findExe("kget").isNull() && ReKonfig::kgetList()) @@ -434,6 +423,16 @@ IconButton *UrlBar::addRightIcon(UrlBar::icon ic) rightIcon->setIcon(KIcon("object-locked")); rightIcon->setToolTip(i18n("Show SSL Info")); break; + case UrlBar::BK: + if (Application::bookmarkProvider()->bookmarkForUrl(_tab->url()).isNull()) + { + rightIcon->setIcon(KIcon("bookmarks").pixmap(32,32, QIcon::Disabled)); + } + else + { + rightIcon->setIcon(KIcon("bookmarks")); + } + break; default: kDebug() << "ERROR.. default non extant case!!"; break; diff --git a/src/urlbar/urlbar.h b/src/urlbar/urlbar.h index d0e2b60e..8808661b 100644 --- a/src/urlbar/urlbar.h +++ b/src/urlbar/urlbar.h @@ -83,6 +83,7 @@ public: KGet = 0x00000001, RSS = 0x00000010, SSL = 0x00000100, + BK = 0x00001000 }; explicit UrlBar(QWidget *parent = 0); -- cgit v1.2.1