refs #485, CDbMappingComponent: refactor resize logic

This commit is contained in:
Klaus Basan
2016-03-13 19:04:46 +00:00
committed by Mathew Sutcliffe
parent fdf41bcce3
commit b73562b33c
2 changed files with 15 additions and 7 deletions

View File

@@ -419,16 +419,12 @@ namespace BlackGui
void CDbMappingComponent::resizeForSelect()
{
int h = this->height();
int h1 = h / 3 * 2;
int h2 = h / 3;
QList<int> sizes({h1, h2});
this->ui->sp_MappingComponent->setSizes(sizes);
this->maxTableView();
}
void CDbMappingComponent::resizeForMapping()
{
int h = this->height(); // total height
const int h = this->height(); // total height
int h2 = ui->qw_EditorsScrollArea->minimumHeight();
h2 *= 1.10; // desired height of inner widget + some space for scrollarea
int currentSize = ui->sp_MappingComponent->sizes().last(); // current size
@@ -445,7 +441,16 @@ namespace BlackGui
h1 = h / 3;
h2 = h / 3 * 2;
}
QList<int> sizes({h1, h2});
const QList<int> sizes({h1, h2});
this->ui->sp_MappingComponent->setSizes(sizes);
}
void CDbMappingComponent::maxTableView()
{
const int h = this->height();
int h1 = h;
int h2 = 0;
const QList<int> sizes({h1, h2});
this->ui->sp_MappingComponent->setSizes(sizes);
}

View File

@@ -122,6 +122,9 @@ namespace BlackGui
//! Resize so that mapping is easier
void resizeForMapping();
//! Max. space for table view
void maxTableView();
//! Stash models
void stashSelectedModels();