diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-10-07 11:23:25 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:05 +0100 |
commit | a22dc445285c3038349ccf118aa8e880f82d2756 (patch) | |
tree | 9c6ed80494e2b1f7828eb7b18f74537bc54095f5 /src/tabwindow/tabbar.cpp | |
parent | pinning tabs, the UI part (diff) | |
download | rekonq-a22dc445285c3038349ccf118aa8e880f82d2756.tar.xz |
Saving the "pinned" state in the sessionmanager
also, a tiny fix for some visual glitches...
Diffstat (limited to 'src/tabwindow/tabbar.cpp')
-rw-r--r-- | src/tabwindow/tabbar.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/tabwindow/tabbar.cpp b/src/tabwindow/tabbar.cpp index f5f3215f..7e493fec 100644 --- a/src/tabwindow/tabbar.cpp +++ b/src/tabwindow/tabbar.cpp @@ -42,6 +42,7 @@ #include <KMenu> #include <KUrl> +#include <QLabel> #include <QPropertyAnimation> #include <QSignalMapper> #include <QStyleOptionFrameV3> @@ -509,7 +510,18 @@ void TabBar::pinTab() tabButton(index, QTabBar::RightSide)->hide(); setTabText(index, QString()); - setTabIcon(index, IconManager::self()->iconForUrl(w->webWindow(index)->url())); + + // workaround: "fix" the icon + QLabel *label = qobject_cast<QLabel* >(tabButton(index, QTabBar::LeftSide)); + if (!label) + label = new QLabel(this); + + setTabButton(index, QTabBar::LeftSide, 0); + setTabButton(index, QTabBar::LeftSide, label); + + KIcon ic = IconManager::self()->iconForUrl(w->webWindow(index)->url()); + label->setPixmap(ic.pixmap(16, 16)); + } @@ -541,5 +553,15 @@ void TabBar::unpinTab() tabButton(index, QTabBar::RightSide)->show(); setTabText(index, w->webWindow(index)->title()); - setTabIcon(index, IconManager::self()->iconForUrl(w->webWindow(index)->url())); + + // workaround: "fix" the icon + QLabel *label = qobject_cast<QLabel* >(tabButton(index, QTabBar::LeftSide)); + if (!label) + label = new QLabel(this); + + setTabButton(index, QTabBar::LeftSide, 0); + setTabButton(index, QTabBar::LeftSide, label); + + KIcon ic = IconManager::self()->iconForUrl(w->webWindow(index)->url()); + label->setPixmap(ic.pixmap(16, 16)); } |