diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-06-17 09:46:29 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-06-17 09:46:29 +0200 |
commit | a110713b63bf9531548928f4f3e2da7eba0464e7 (patch) | |
tree | 3291529c4b13c2b4cee03562d85dc6cb2287e2be /src/urlbar/urlbar.cpp | |
parent | Super safe checks in WebTab::url() detection (diff) | |
download | rekonq-a110713b63bf9531548928f4f3e2da7eba0464e7.tar.xz |
Properly calculate icon size, checking KDE settings instead on
checking actual icon size.
BUG: 301988
Diffstat (limited to 'src/urlbar/urlbar.cpp')
-rw-r--r-- | src/urlbar/urlbar.cpp | 11 |
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); } |