diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-07-30 19:17:54 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:04 +0100 |
commit | f5ab2ef8978bc40365c192639980227eb9ce361a (patch) | |
tree | 392ac008dc62eb82e759f512e7628deb5f127de2 /src/tabwindow | |
parent | Restored Adblock moving hiding logic to the one used in kwebkitpart (diff) | |
download | rekonq-f5ab2ef8978bc40365c192639980227eb9ce361a.tar.xz |
window icon & title fixes
- Use rekonq as window icon for now
- use tab url if title is empty instead of the unsensed "(Untitled)"
(this is what the other browsers do)
Diffstat (limited to 'src/tabwindow')
-rw-r--r-- | src/tabwindow/tabwindow.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp index d3826848..0092bd9f 100644 --- a/src/tabwindow/tabwindow.cpp +++ b/src/tabwindow/tabwindow.cpp @@ -225,8 +225,10 @@ void TabWindow::currentChanged(int newIndex) if (!tab) return; - setWindowTitle(tab->title() + QL1S(" - rekonq")); - setWindowIcon(tab->icon()); + QString t = tab->title(); + (t.isEmpty()) + ? setWindowTitle(QL1S("rekonq")) + : setWindowTitle(t + QL1S(" - rekonq")); } @@ -272,7 +274,9 @@ void TabWindow::tabTitleChanged(const QString &title) if (!tab) return; - QString tabTitle = title.isEmpty() ? i18n("(Untitled)") : title; + bool emptyTitle = title.isEmpty(); + + QString tabTitle = emptyTitle ? tab->url().toString() : title; tabTitle.replace('&', "&&"); int index = indexOf(tab); @@ -283,15 +287,15 @@ void TabWindow::tabTitleChanged(const QString &title) if (currentIndex() != index) { - if (tabTitle != i18n("(Untitled)")) + if (!emptyTitle) tabBar()->setTabHighlighted(index, true); } else { - setWindowTitle(title + QL1S(" - rekonq")); + emptyTitle + ? setWindowTitle(QL1S("rekonq")) + : setWindowTitle(tabTitle + QL1S(" - rekonq")); } - - // TODO: What about window title? Is this enough? } @@ -346,12 +350,6 @@ void TabWindow::tabLoadFinished(bool ok) label->setMovie(0); label->setPixmap(tab->icon().pixmap(16, 16)); } - - if (currentIndex() == index) - { - setWindowIcon(tab->icon()); - } - } |