Skip to content
Snippets Groups Projects
Commit 674fce3a authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Friedemann Kleint
Browse files

Gerrit: Make dialog narrower


Change-Id: I2c298cde61b7643578c1c2665f8aee994a7289cd
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 231da017
No related branches found
No related tags found
No related merge requests found
...@@ -57,7 +57,8 @@ ...@@ -57,7 +57,8 @@
namespace Gerrit { namespace Gerrit {
namespace Internal { namespace Internal {
enum { layoutSpacing = 5 }; static const int layoutSpacing = 5;
static const int maxTitleWidth = 350;
GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p, GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p,
QWidget *parent) QWidget *parent)
...@@ -131,7 +132,7 @@ GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p, ...@@ -131,7 +132,7 @@ GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p,
slotCurrentChanged(); slotCurrentChanged();
m_model->refresh(); m_model->refresh();
resize(QSize(1200, 600)); resize(QSize(950, 600));
} }
QPushButton *GerritDialog::addActionButton(const QString &text, const char *buttonSlot) QPushButton *GerritDialog::addActionButton(const QString &text, const char *buttonSlot)
...@@ -153,9 +154,12 @@ void GerritDialog::slotDoubleClicked(const QModelIndex &i) ...@@ -153,9 +154,12 @@ void GerritDialog::slotDoubleClicked(const QModelIndex &i)
void GerritDialog::slotRefreshStateChanged(bool v) void GerritDialog::slotRefreshStateChanged(bool v)
{ {
if (!v && m_model->rowCount()) if (!v && m_model->rowCount()) {
for (int c = 0; c < GerritModel::ColumnCount; ++c) for (int c = 0; c < GerritModel::ColumnCount; ++c)
m_treeView->resizeColumnToContents(c); m_treeView->resizeColumnToContents(c);
if (m_treeView->columnWidth(GerritModel::TitleColumn) > maxTitleWidth)
m_treeView->setColumnWidth(GerritModel::TitleColumn, maxTitleWidth);
}
} }
void GerritDialog::slotFetchDisplay() void GerritDialog::slotFetchDisplay()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment