mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 17:30:12 +08:00
refs #485, CDbMappingComponent: refactor resize logic
This commit is contained in:
committed by
Mathew Sutcliffe
parent
fdf41bcce3
commit
b73562b33c
@@ -419,16 +419,12 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDbMappingComponent::resizeForSelect()
|
void CDbMappingComponent::resizeForSelect()
|
||||||
{
|
{
|
||||||
int h = this->height();
|
this->maxTableView();
|
||||||
int h1 = h / 3 * 2;
|
|
||||||
int h2 = h / 3;
|
|
||||||
QList<int> sizes({h1, h2});
|
|
||||||
this->ui->sp_MappingComponent->setSizes(sizes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbMappingComponent::resizeForMapping()
|
void CDbMappingComponent::resizeForMapping()
|
||||||
{
|
{
|
||||||
int h = this->height(); // total height
|
const int h = this->height(); // total height
|
||||||
int h2 = ui->qw_EditorsScrollArea->minimumHeight();
|
int h2 = ui->qw_EditorsScrollArea->minimumHeight();
|
||||||
h2 *= 1.10; // desired height of inner widget + some space for scrollarea
|
h2 *= 1.10; // desired height of inner widget + some space for scrollarea
|
||||||
int currentSize = ui->sp_MappingComponent->sizes().last(); // current size
|
int currentSize = ui->sp_MappingComponent->sizes().last(); // current size
|
||||||
@@ -445,7 +441,16 @@ namespace BlackGui
|
|||||||
h1 = h / 3;
|
h1 = h / 3;
|
||||||
h2 = h / 3 * 2;
|
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);
|
this->ui->sp_MappingComponent->setSizes(sizes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,9 @@ namespace BlackGui
|
|||||||
//! Resize so that mapping is easier
|
//! Resize so that mapping is easier
|
||||||
void resizeForMapping();
|
void resizeForMapping();
|
||||||
|
|
||||||
|
//! Max. space for table view
|
||||||
|
void maxTableView();
|
||||||
|
|
||||||
//! Stash models
|
//! Stash models
|
||||||
void stashSelectedModels();
|
void stashSelectedModels();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user