mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
bug fix: tabactions: positions disabled label color
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@75 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
c506fcf739
commit
bc5fddbe1e
@ -253,7 +253,9 @@ void qTabActions::Expand(QAbstractButton *button ){
|
|||||||
|
|
||||||
// Collapse
|
// Collapse
|
||||||
if(!button->isChecked()){
|
if(!button->isChecked()){
|
||||||
palette->setColor(QPalette::WindowText,Qt::black);
|
palette->setColor(QPalette::Active,QPalette::WindowText,Qt::black);
|
||||||
|
|
||||||
|
|
||||||
lblName[index]->setPalette(*palette);
|
lblName[index]->setPalette(*palette);
|
||||||
button->setIcon(*iconPlus);
|
button->setIcon(*iconPlus);
|
||||||
|
|
||||||
@ -261,7 +263,7 @@ void qTabActions::Expand(QAbstractButton *button ){
|
|||||||
positionWidget->hide();
|
positionWidget->hide();
|
||||||
setFixedHeight(height()-30);//-80 if the checkboxes are included
|
setFixedHeight(height()-30);//-80 if the checkboxes are included
|
||||||
if(myDet->getPositions()) {
|
if(myDet->getPositions()) {
|
||||||
palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
palette->setColor(QPalette::Active,QPalette::WindowText,Qt::darkGreen);
|
||||||
lblName[index]->setPalette(*palette);
|
lblName[index]->setPalette(*palette);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -269,7 +271,7 @@ void qTabActions::Expand(QAbstractButton *button ){
|
|||||||
scanWidget[GetActualIndex(index)]->hide();
|
scanWidget[GetActualIndex(index)]->hide();
|
||||||
setFixedHeight(height()-130);
|
setFixedHeight(height()-130);
|
||||||
if(myDet->getScanMode(GetActualIndex(index))){
|
if(myDet->getScanMode(GetActualIndex(index))){
|
||||||
palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
palette->setColor(QPalette::Active,QPalette::WindowText,Qt::darkGreen);
|
||||||
lblName[index]->setPalette(*palette);
|
lblName[index]->setPalette(*palette);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -277,14 +279,17 @@ void qTabActions::Expand(QAbstractButton *button ){
|
|||||||
actionWidget[GetActualIndex(index)]->hide();
|
actionWidget[GetActualIndex(index)]->hide();
|
||||||
setFixedHeight(height()-30);
|
setFixedHeight(height()-30);
|
||||||
if(myDet->getActionMode(GetActualIndex(index))){
|
if(myDet->getActionMode(GetActualIndex(index))){
|
||||||
palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
palette->setColor(QPalette::Active,QPalette::WindowText,Qt::darkGreen);
|
||||||
lblName[index]->setPalette(*palette);
|
lblName[index]->setPalette(*palette);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
// Expand
|
// Expand
|
||||||
//always set title color to blue for expan\d
|
//always set title color to blue for expan\d
|
||||||
palette->setColor(QPalette::WindowText,QColor(0,0,200,255));
|
|
||||||
|
palette->setColor(QPalette::Active,QPalette::WindowText,QColor(0,0,200,255));
|
||||||
|
|
||||||
|
|
||||||
lblName[index]->setPalette(*palette);
|
lblName[index]->setPalette(*palette);
|
||||||
button->setIcon(*iconMinus);
|
button->setIcon(*iconMinus);
|
||||||
|
|
||||||
@ -389,7 +394,7 @@ void qTabActions::EnablePositions(bool enable){
|
|||||||
for(int i=0;i<comboPos->count();i++)
|
for(int i=0;i<comboPos->count();i++)
|
||||||
comboPos->removeItem(i);
|
comboPos->removeItem(i);
|
||||||
cout<<"Number of Positions set to :"<<myDet->getPositions()<<endl;
|
cout<<"Number of Positions set to :"<<myDet->getPositions()<<endl;
|
||||||
lblName[NumPositions]->setPalette(lblName[NumPositions-1]->palette());
|
|
||||||
//to collapse if it was expanded
|
//to collapse if it was expanded
|
||||||
if(btnExpand[NumPositions]->isChecked()){
|
if(btnExpand[NumPositions]->isChecked()){
|
||||||
disconnect(group, SIGNAL(buttonClicked(QAbstractButton*)), this,SLOT(Expand(QAbstractButton*)));
|
disconnect(group, SIGNAL(buttonClicked(QAbstractButton*)), this,SLOT(Expand(QAbstractButton*)));
|
||||||
@ -489,23 +494,20 @@ void qTabActions::UpdateCollapseColors(){
|
|||||||
for(int i=0;i<NumTotalActions;i++){
|
for(int i=0;i<NumTotalActions;i++){
|
||||||
//num positions
|
//num positions
|
||||||
if(i==NumPositions){
|
if(i==NumPositions){
|
||||||
//if its disabled
|
if(myDet->getPositions()) palette->setColor(QPalette::Active,QPalette::WindowText,Qt::darkGreen);
|
||||||
if(lblName[i]->isEnabled()){
|
else palette->setColor(QPalette::Active,QPalette::WindowText,Qt::black);
|
||||||
if(myDet->getPositions()) palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
lblName[i]->setPalette(*palette);
|
||||||
else palette->setColor(QPalette::WindowText,Qt::black);
|
|
||||||
lblName[i]->setPalette(*palette);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//scans
|
//scans
|
||||||
else if((i==Scan0)||(i==Scan1)){
|
else if((i==Scan0)||(i==Scan1)){
|
||||||
if(myDet->getScanMode(GetActualIndex(i))) palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
if(myDet->getScanMode(GetActualIndex(i))) palette->setColor(QPalette::Active,QPalette::WindowText,Qt::darkGreen);
|
||||||
else palette->setColor(QPalette::WindowText,Qt::black);
|
else palette->setColor(QPalette::Active,QPalette::WindowText,Qt::black);
|
||||||
lblName[i]->setPalette(*palette);
|
lblName[i]->setPalette(*palette);
|
||||||
}
|
}
|
||||||
//actions
|
//actions
|
||||||
else{
|
else{
|
||||||
if(myDet->getActionMode(GetActualIndex(i))) palette->setColor(QPalette::WindowText,Qt::darkGreen);
|
if(myDet->getActionMode(GetActualIndex(i))) palette->setColor(QPalette::Active,QPalette::WindowText,Qt::darkGreen);
|
||||||
else palette->setColor(QPalette::WindowText,Qt::black);
|
else palette->setColor(QPalette::Active,QPalette::WindowText,Qt::black);
|
||||||
lblName[i]->setPalette(*palette);
|
lblName[i]->setPalette(*palette);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user