diff options
| author | Andrea Diamantini <adjam7@gmail.com> | 2009-05-20 00:42:41 +0200 | 
|---|---|---|
| committer | Andrea Diamantini <adjam7@gmail.com> | 2009-06-03 00:04:20 +0200 | 
| commit | dc981e4cb1dc06596c801299f7c34e63d6762150 (patch) | |
| tree | a1d7d0a2f15a8ff130ae053f0dc46a7b9d0a737a | |
| parent | Fixing Ui cookies dim (diff) | |
| download | rekonq-dc981e4cb1dc06596c801299f7c34e63d6762150.tar.xz | |
Fixing Ui dimension
| -rw-r--r-- | src/cookiedialog.cpp | 30 | ||||
| -rw-r--r-- | src/cookieexceptiondialog.cpp | 26 | 
2 files changed, 7 insertions, 49 deletions
| diff --git a/src/cookiedialog.cpp b/src/cookiedialog.cpp index bc704f0b..ea9555eb 100644 --- a/src/cookiedialog.cpp +++ b/src/cookiedialog.cpp @@ -198,33 +198,9 @@ 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); - -//     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); +    // Fixing header dimension +    QHeaderView *headerView = cookieWidget->cookiesTable->horizontalHeader(); +    headerView->setResizeMode(QHeaderView::ResizeToContents);  } diff --git a/src/cookieexceptiondialog.cpp b/src/cookieexceptiondialog.cpp index 9cf95017..77445d0b 100644 --- a/src/cookieexceptiondialog.cpp +++ b/src/cookieexceptiondialog.cpp @@ -177,6 +177,7 @@ bool CookieExceptionsModel::removeRows(int row, int count, const QModelIndex &pa  #include <QtCore/QSize>  #include <QtGui/QDesktopWidget> +#include <QtGui/QHeaderView>  CookiesExceptionsDialog::CookiesExceptionsDialog(CookieJar *cookieJar, QWidget *parent) @@ -216,28 +217,9 @@ CookiesExceptionsDialog::CookiesExceptionsDialog(CookieJar *cookieJar, QWidget *      connect(m_exceptionsWidget->allowButton, SIGNAL(clicked()), this, SLOT(allow()));      connect(m_exceptionsWidget->allowForSessionButton, SIGNAL(clicked()), this, SLOT(allowForSession())); -//     QFont f = font(); -//     f.setPointSize(10); -//     QFontMetrics fm(f); -//     int height = fm.height() + fm.height() / 3; -//     m_exceptionsWidget->exceptionTable->verticalHeader()->setDefaultSectionSize(height); -//     m_exceptionsWidget->exceptionTable->verticalHeader()->setMinimumSectionSize(-1); -//     for (int i = 0; i < m_exceptionsModel->columnCount(); ++i) -//     { -//         int header = m_exceptionsWidget->exceptionTable->horizontalHeader()->sectionSizeHint(i); -//         switch (i) -//         { -//         case 0: -//             header = fm.width(QLatin1String("averagebiglonghost.domain.com")); -//             break; -//         case 1: -//             header = fm.width(QLatin1String("Allow For Session")); -//             break; -//         } -//         int buffer = fm.width(QLatin1String("xx")); -//         header += buffer; -//         m_exceptionsWidget->exceptionTable->horizontalHeader()->resizeSection(i, header); -//     } +    // Fixing header dimension +    QHeaderView *headerView = m_exceptionsWidget->exceptionTable->horizontalHeader(); +    headerView->setResizeMode(QHeaderView::Stretch);  } | 
