activity labels in red, when active

This commit is contained in:
Jan Grewe 2020-03-16 11:53:40 +01:00
parent ffe4052832
commit 3a93ae2b37
2 changed files with 6 additions and 3 deletions

View File

@ -71,7 +71,6 @@ PylonRecorder::PylonRecorder(QWidget *parent)
QLabel *loadLabel = new QLabel("Load:", this); QLabel *loadLabel = new QLabel("Load:", this);
writingLabel = new QLabel("writing"); writingLabel = new QLabel("writing");
//writingLabel->setStyleSheet("QLabel { color : gray; }");
writingLabel->setEnabled(false); writingLabel->setEnabled(false);
grabbingLabel = new QLabel("grabbing"); grabbingLabel = new QLabel("grabbing");
//grabbingLabel->setStyleSheet("QLabel { color : gray; }"); //grabbingLabel->setStyleSheet("QLabel { color : gray; }");
@ -480,8 +479,8 @@ void PylonRecorder::writerDone() {
} }
void PylonRecorder::displayActivity() { void PylonRecorder::displayActivity() {
grabbingLabel->setEnabled(labelSwitch && grabbing); grabbingLabel->setStyleSheet((labelSwitch && grabbing) ? activeLabelStyleHigh : activeLabelStyleLow);
writingLabel->setEnabled(labelSwitch && writing); writingLabel->setStyleSheet((labelSwitch && writing) ? activeLabelStyleHigh : activeLabelStyleLow);
labelSwitch = !labelSwitch; labelSwitch = !labelSwitch;
} }

View File

@ -85,6 +85,10 @@ private:
Writer *writer; Writer *writer;
bool grabbing, stopRequest, writing, labelSwitch; bool grabbing, stopRequest, writing, labelSwitch;
QPalette progressPalette; QPalette progressPalette;
QString activeLabelStyleHigh = "QLabel { color : red; }";
QString activeLabelStyleLow = "QLabel { color : cmyk(0, 255, 255, 0, 50); }";
QString inactiveLabelStyle = ("QLabel { color :gray; }");
#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printer) #if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printer)
QPrinter printer; QPrinter printer;