diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-05-19 17:26:02 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-06-03 00:04:20 +0200 |
commit | de173857a95933a3de8ef446bde8a1a004d21d65 (patch) | |
tree | 0a050025fda6681d82047801b38e71dd35532141 /src/cookiedialog.cpp | |
parent | Fixing Compilation. Going to feature improvements (diff) | |
download | rekonq-de173857a95933a3de8ef446bde8a1a004d21d65.tar.xz |
Fixing Ui cookies dim
Diffstat (limited to 'src/cookiedialog.cpp')
-rw-r--r-- | src/cookiedialog.cpp | 67 |
1 files changed, 41 insertions, 26 deletions
diff --git a/src/cookiedialog.cpp b/src/cookiedialog.cpp index e9399e51..bc704f0b 100644 --- a/src/cookiedialog.cpp +++ b/src/cookiedialog.cpp @@ -160,6 +160,12 @@ void CookieModel::cookiesChanged() // Ui Includes #include "ui_cookies.h" +// Qt Includes +#include <QtCore/QRect> +#include <QtCore/QSize> + +#include <QtGui/QDesktopWidget> + CookiesDialog::CookiesDialog(CookieJar *cookieJar, QWidget *parent) : KDialog(parent) @@ -183,6 +189,7 @@ CookiesDialog::CookiesDialog(CookieJar *cookieJar, QWidget *parent) m_proxyModel->setSourceModel(model); + cookieWidget->cookiesTable->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); cookieWidget->cookiesTable->verticalHeader()->hide(); cookieWidget->cookiesTable->setSelectionBehavior(QAbstractItemView::SelectRows); cookieWidget->cookiesTable->setModel(m_proxyModel); @@ -191,31 +198,39 @@ CookiesDialog::CookiesDialog(CookieJar *cookieJar, QWidget *parent) cookieWidget->cookiesTable->setShowGrid(false); cookieWidget->cookiesTable->setSortingEnabled(true); - QFont f = font(); - f.setPointSize(10); - QFontMetrics fm(f); - int height = fm.height() + fm.height() / 3; - cookieWidget->cookiesTable->verticalHeader()->setDefaultSectionSize(height); - cookieWidget->cookiesTable->verticalHeader()->setMinimumSectionSize(-1); +// QFont f = font(); +// f.setPointSize(10); +// QFontMetrics fm(f); +// int height = fm.height() + fm.height() / 3; +// cookieWidget->cookiesTable->verticalHeader()->setDefaultSectionSize(height); +// cookieWidget->cookiesTable->verticalHeader()->setMinimumSectionSize(-1); + +// for (int i = 0; i < model->columnCount(); ++i) +// { +// int header = cookieWidget->cookiesTable->horizontalHeader()->sectionSizeHint(i); +// switch (i) +// { +// case 0: +// header = fm.width(QLatin1String("averagehost.domain.com")); +// break; +// case 1: +// header = fm.width(QLatin1String("_session_id")); +// break; +// case 4: +// header = fm.width(QDateTime::currentDateTime().toString(Qt::LocalDate)); +// break; +// } +// int buffer = fm.width(QLatin1String("xx")); +// header += buffer; +// cookieWidget->cookiesTable->horizontalHeader()->resizeSection(i, header); +// } +// cookieWidget->cookiesTable->horizontalHeader()->setStretchLastSection(true); +} - for (int i = 0; i < model->columnCount(); ++i) - { - int header = cookieWidget->cookiesTable->horizontalHeader()->sectionSizeHint(i); - switch (i) - { - case 0: - header = fm.width(QLatin1String("averagehost.domain.com")); - break; - case 1: - header = fm.width(QLatin1String("_session_id")); - break; - case 4: - header = fm.width(QDateTime::currentDateTime().toString(Qt::LocalDate)); - break; - } - int buffer = fm.width(QLatin1String("xx")); - header += buffer; - cookieWidget->cookiesTable->horizontalHeader()->resizeSection(i, header); - } - cookieWidget->cookiesTable->horizontalHeader()->setStretchLastSection(true); + +QSize CookiesDialog::sizeHint() const +{ + QRect desktopRect = QApplication::desktop()->screenGeometry(); + QSize size = desktopRect.size() * 0.8; + return size; } |