From c73149a4f56b6ec4d4183ac99015d73df2c2e34e Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 1 Oct 2012 19:10:21 +0200 Subject: Add sizeHint code from rekonq oops... by accident (-a) added here also the easy fix for tabs: - shown "Loading..." string while loading - use IconManager to properly show tab icon on load finished --- src/tabwindow/rekonqwindow.cpp | 10 +++++++--- src/tabwindow/rekonqwindow.h | 2 ++ src/tabwindow/tabwindow.cpp | 8 +++++++- src/webwindow/webwindow.cpp | 6 ------ src/webwindow/webwindow.h | 1 - 5 files changed, 16 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/tabwindow/rekonqwindow.cpp b/src/tabwindow/rekonqwindow.cpp index eb511b18..8bc96d87 100644 --- a/src/tabwindow/rekonqwindow.cpp +++ b/src/tabwindow/rekonqwindow.cpp @@ -125,9 +125,6 @@ RekonqWindow::RekonqWindow(QWidget* parent) ktwsm->dummyInit(); sWindowList->append(this); - // a decent minimum size... - setMinimumSize(100,40); - QString geometry; KCmdLineArgs *args = KCmdLineArgs::parsedArgs("kde"); if (args && args->isSet("geometry")) @@ -158,6 +155,13 @@ RekonqWindow::~RekonqWindow() } +QSize RekonqWindow::sizeHint() const +{ + QRect desktopRect = QApplication::desktop()->screenGeometry(); + QSize size = desktopRect.size() * 0.8; + return size; +} + QList RekonqWindow::windowList() { return *sWindowList; diff --git a/src/tabwindow/rekonqwindow.h b/src/tabwindow/rekonqwindow.h index c7fe80d1..67f0fcfa 100644 --- a/src/tabwindow/rekonqwindow.h +++ b/src/tabwindow/rekonqwindow.h @@ -60,6 +60,8 @@ public: virtual ~RekonqWindow(); + QSize sizeHint() const; + /** * List of members of RekonqWindow class. */ diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp index cd4ec8ce..36b2caec 100644 --- a/src/tabwindow/tabwindow.cpp +++ b/src/tabwindow/tabwindow.cpp @@ -36,6 +36,8 @@ #include "tabhistory.h" +#include "iconmanager.h" + // KDE Includes #include #include @@ -305,6 +307,8 @@ void TabWindow::tabLoadStarted() } tabBar()->setTabButton(index, QTabBar::LeftSide, 0); tabBar()->setTabButton(index, QTabBar::LeftSide, label); + + tabBar()->setTabText(index, i18n("Loading...")); } } @@ -328,7 +332,9 @@ void TabWindow::tabLoadFinished(bool ok) delete movie; label->setMovie(0); - label->setPixmap(tab->icon().pixmap(16, 16)); + + KIcon ic = IconManager::self()->iconForUrl(tab->url()); + label->setPixmap(ic.pixmap(16, 16)); } } diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp index 592000c9..e76d1d5d 100644 --- a/src/webwindow/webwindow.cpp +++ b/src/webwindow/webwindow.cpp @@ -613,12 +613,6 @@ QString WebWindow::title() const } -QIcon WebWindow::icon() const -{ - return _tab->view()->icon(); -} - - UrlBar *WebWindow::urlBar() { return _bar; diff --git a/src/webwindow/webwindow.h b/src/webwindow/webwindow.h index affa5cb1..fa465ddc 100644 --- a/src/webwindow/webwindow.h +++ b/src/webwindow/webwindow.h @@ -71,7 +71,6 @@ public: KUrl url() const; QString title() const; - QIcon icon() const; UrlBar *urlBar(); WebTab *view(); -- cgit v1.2.1