summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-06-17 09:46:29 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-06-17 09:46:29 +0200
commita110713b63bf9531548928f4f3e2da7eba0464e7 (patch)
tree3291529c4b13c2b4cee03562d85dc6cb2287e2be /src/urlbar
parentSuper safe checks in WebTab::url() detection (diff)
downloadrekonq-a110713b63bf9531548928f4f3e2da7eba0464e7.tar.xz
Properly calculate icon size, checking KDE settings instead on
checking actual icon size. BUG: 301988
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/urlbar.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 8535e045..30092911 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -53,6 +53,7 @@
#include <KStandardDirs>
#include <KColorScheme>
#include <KMenu>
+#include <KIconLoader>
// Qt Includes
#include <QPainter>
@@ -753,11 +754,13 @@ void UrlBar::manageFavorites(QPoint pos)
void UrlBar::updateRightIconPosition(IconButton *icon, int iconsCount)
{
- int iw = _icon->width();
- int ih = _icon->height();
+ // NOTE: cannot show a (let's say) 16x16 icon in a 16x16 square.
+ // It needs some margin. It usually is 3, but using 4 (default rekonq icon margin)
+ // seems NOT a big problem and let's us using just one const ;)
+ int iconSize = IconSize(KIconLoader::Small) + c_iconMargin;
- int iconWidth = width() - ((iw + c_iconMargin) * iconsCount);
- int iconHeight = (height() - ih) / 2;
+ int iconWidth = width() - ((iconSize + c_iconMargin) * iconsCount);
+ int iconHeight = (height() - iconSize) / 2;
icon->move(iconWidth, iconHeight);
}