Remote Linux: Tweak header view behavior

If there's a surplus of space use a interactive + stretch column.
Otherwise make both columns interactive.

Task-number: QTCREATORBUG-12949
Change-Id: I2479e53df9d347e02387289396a6c5a2bd07a51a
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
Daniel Teske
2014-09-02 13:06:02 +02:00
parent 5a7c6db7b2
commit 91e5e49f46

View File

@@ -70,7 +70,15 @@ DeploymentDataView::~DeploymentDataView()
void DeploymentDataView::updateDeploymentDataModel()
{
d->deploymentDataModel.setDeploymentData(d->target->deploymentData());
QHeaderView *header = d->ui.deploymentDataView->header();
header->setSectionResizeMode(0, QHeaderView::Interactive);
header->setSectionResizeMode(1, QHeaderView::Interactive);
d->ui.deploymentDataView->resizeColumnToContents(0);
d->ui.deploymentDataView->resizeColumnToContents(1);
if (header->sectionSize(0) + header->sectionSize(1)
< d->ui.deploymentDataView->header()->width()) {
d->ui.deploymentDataView->header()->setSectionResizeMode(1, QHeaderView::Stretch);
}
}
} // namespace ProjectExplorer