From f5ab2ef8978bc40365c192639980227eb9ce361a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 30 Jul 2012 19:17:54 +0200 Subject: 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) --- src/tabwindow/tabwindow.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src') 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()); - } - } -- cgit v1.2.1