comparison widgets/PropertyBox.cpp @ 1199:73d43e410a6b levelpanwidget

Add swatches to colour map combo (optionally, as it turns out they are quite visually distracting)
author Chris Cannam
date Fri, 16 Dec 2016 15:55:59 +0000
parents 69ff93e0c624
children d421df27e184
comparison
equal deleted inserted replaced
1198:69ff93e0c624 1199:73d43e410a6b
217 if (layer) { 217 if (layer) {
218 218
219 QLabel *showLabel = new QLabel(tr("Show")); 219 QLabel *showLabel = new QLabel(tr("Show"));
220 layout->addWidget(showLabel, 0, col++, Qt::AlignVCenter | Qt::AlignRight); 220 layout->addWidget(showLabel, 0, col++, Qt::AlignVCenter | Qt::AlignRight);
221 221
222 m_showButton = new LEDButton(Qt::blue); 222 m_showButton = new LEDButton(palette().highlight().color());
223 layout->addWidget(m_showButton, 0, col++, Qt::AlignVCenter | Qt::AlignLeft); 223 layout->addWidget(m_showButton, 0, col++, Qt::AlignVCenter | Qt::AlignLeft);
224 connect(m_showButton, SIGNAL(stateChanged(bool)), 224 connect(m_showButton, SIGNAL(stateChanged(bool)),
225 this, SIGNAL(showLayer(bool))); 225 this, SIGNAL(showLayer(bool)));
226 connect(m_showButton, SIGNAL(mouseEntered()), 226 connect(m_showButton, SIGNAL(mouseEntered()),
227 this, SLOT(mouseEnteredWidget())); 227 this, SLOT(mouseEnteredWidget()));
418 cb->blockSignals(true); 418 cb->blockSignals(true);
419 cb->setCurrentIndex(value); 419 cb->setCurrentIndex(value);
420 cb->blockSignals(false); 420 cb->blockSignals(false);
421 } 421 }
422 422
423 cb->setMinimumSize(QSize(10, cb->font().pixelSize() * 2));
424 break; 423 break;
425 } 424 }
426 425
427 case PropertyContainer::ColourMapProperty: 426 case PropertyContainer::ColourMapProperty:
428 { 427 {
433 assert(cb); 432 assert(cb);
434 } else { 433 } else {
435 #ifdef DEBUG_PROPERTY_BOX 434 #ifdef DEBUG_PROPERTY_BOX
436 cerr << "PropertyBox: creating new colourmap combobox" << endl; 435 cerr << "PropertyBox: creating new colourmap combobox" << endl;
437 #endif 436 #endif
438 cb = new ColourMapComboBox(); 437 cb = new ColourMapComboBox(false);
439 cb->setObjectName(name); 438 cb->setObjectName(name);
440 439
441 connect(cb, SIGNAL(colourMapChanged(int)), 440 connect(cb, SIGNAL(colourMapChanged(int)),
442 this, SLOT(propertyControllerChanged(int))); 441 this, SLOT(propertyControllerChanged(int)));
443 connect(cb, SIGNAL(mouseEntered()), 442 connect(cb, SIGNAL(mouseEntered()),
455 cb->blockSignals(true); 454 cb->blockSignals(true);
456 cb->setCurrentIndex(value); 455 cb->setCurrentIndex(value);
457 cb->blockSignals(false); 456 cb->blockSignals(false);
458 } 457 }
459 458
460 cb->setMinimumSize(QSize(10, cb->font().pixelSize() * 2));
461 break; 459 break;
462 } 460 }
463 461
464 case PropertyContainer::ValueProperty: 462 case PropertyContainer::ValueProperty:
465 case PropertyContainer::UnitsProperty: 463 case PropertyContainer::UnitsProperty:
541 } 539 }
542 } 540 }
543 } 541 }
544 cb->blockSignals(false); 542 cb->blockSignals(false);
545 543
546 #ifdef Q_OS_MAC
547 // Crashes on startup without this, for some reason; also
548 // prevents combo boxes from getting weirdly squished
549 // vertically
550 cb->setMinimumSize(QSize(10, cb->font().pixelSize() * 2));
551 #endif
552
553 break; 544 break;
554 } 545 }
555 546
556 case PropertyContainer::InvalidProperty: 547 case PropertyContainer::InvalidProperty:
557 default: 548 default: