Gerrit: Make dialog narrower

Change-Id: I2c298cde61b7643578c1c2665f8aee994a7289cd
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Orgad Shaneh
2012-05-16 22:58:01 +03:00
committed by Friedemann Kleint
parent 231da017f6
commit 674fce3aca

View File

@@ -57,7 +57,8 @@
namespace Gerrit {
namespace Internal {
enum { layoutSpacing = 5 };
static const int layoutSpacing = 5;
static const int maxTitleWidth = 350;
GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p,
QWidget *parent)
@@ -131,7 +132,7 @@ GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p,
slotCurrentChanged();
m_model->refresh();
resize(QSize(1200, 600));
resize(QSize(950, 600));
}
QPushButton *GerritDialog::addActionButton(const QString &text, const char *buttonSlot)
@@ -153,9 +154,12 @@ void GerritDialog::slotDoubleClicked(const QModelIndex &i)
void GerritDialog::slotRefreshStateChanged(bool v)
{
if (!v && m_model->rowCount())
if (!v && m_model->rowCount()) {
for (int c = 0; c < GerritModel::ColumnCount; ++c)
m_treeView->resizeColumnToContents(c);
if (m_treeView->columnWidth(GerritModel::TitleColumn) > maxTitleWidth)
m_treeView->setColumnWidth(GerritModel::TitleColumn, maxTitleWidth);
}
}
void GerritDialog::slotFetchDisplay()