mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-03 09:08:37 +01:00
added color to collapse in actions, changed angular for number of data to be received, corrected constant size scan widget
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@48 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
@@ -211,14 +211,26 @@ void qTabActions::Expand(QAbstractButton *button ){
|
||||
if(index==NumPositions) {
|
||||
positionWidget->hide();
|
||||
setFixedHeight(height()-30);//-80 if the checkboxes are included
|
||||
if(myDet->getPositions()) {
|
||||
palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
||||
lblName[index]->setPalette(*palette);
|
||||
}
|
||||
}
|
||||
else if((index==Scan0)||(index==Scan1)) {
|
||||
scanWidget[GetActualIndex(index)]->hide();
|
||||
setFixedHeight(height()-130);
|
||||
if(myDet->getScanMode(GetActualIndex(index))){
|
||||
palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
||||
lblName[index]->setPalette(*palette);
|
||||
}
|
||||
}
|
||||
else {
|
||||
actionWidget[GetActualIndex(index)]->hide();
|
||||
setFixedHeight(height()-30);
|
||||
if(myDet->getActionMode(GetActualIndex(index))){
|
||||
palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
||||
lblName[index]->setPalette(*palette);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// Expand
|
||||
@@ -349,7 +361,7 @@ void qTabActions::Refresh(){
|
||||
//delete existing positions
|
||||
if (positions) delete [] positions;
|
||||
//get number of positions
|
||||
int numPos=myDet->getPositions();cout<<"numPOs:"<<numPos<<endl;
|
||||
int numPos=myDet->getPositions();
|
||||
comboPos->setMaxCount(numPos);
|
||||
|
||||
//set the number of positions in the gui
|
||||
@@ -383,6 +395,8 @@ void qTabActions::Refresh(){
|
||||
scanWidget[i]->Refresh();
|
||||
for(int i=0;i<qActionsWidget::NUM_ACTION_WIDGETS;i++)
|
||||
actionWidget[i]->Refresh();
|
||||
|
||||
UpdateCollapseColors();
|
||||
}
|
||||
|
||||
|
||||
@@ -405,3 +419,35 @@ int qTabActions::GetActualIndex(int index){
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabActions::UpdateCollapseColors(){
|
||||
#ifdef VERYVERBOSE
|
||||
cout << "Updating Collapse Colors" << endl;
|
||||
#endif
|
||||
for(int i=0;i<NumTotalActions;i++){
|
||||
//num positions
|
||||
if(i==NumPositions){
|
||||
//if its disabled
|
||||
if(lblName[i]->isEnabled()){
|
||||
if(myDet->getPositions()) palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
||||
else palette->setColor(QPalette::WindowText,Qt::black);
|
||||
lblName[i]->setPalette(*palette);
|
||||
}
|
||||
}
|
||||
//scans
|
||||
else if((i==Scan0)||(i==Scan1)){
|
||||
if(myDet->getScanMode(GetActualIndex(i))) palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
||||
else palette->setColor(QPalette::WindowText,Qt::black);
|
||||
lblName[i]->setPalette(*palette);
|
||||
}
|
||||
//actions
|
||||
else{
|
||||
if(myDet->getActionMode(GetActualIndex(i))) palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
||||
else palette->setColor(QPalette::WindowText,Qt::black);
|
||||
lblName[i]->setPalette(*palette);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user