comparison widgets/PropertyBox.cpp @ 1173:db90fee630bc 3.0-integration

Bigger colour swatches for bigger fonts
author Chris Cannam
date Wed, 30 Nov 2016 11:01:39 +0000
parents 5c3333fb70b3
children 3f5c82034f9b
comparison
equal deleted inserted replaced
1172:ba379b4d4555 1173:db90fee630bc
474 474
475 } else { // ColourProperty 475 } else { // ColourProperty
476 476
477 //!!! should be a proper colour combobox class that 477 //!!! should be a proper colour combobox class that
478 // manages its own Add New Colour entry... 478 // manages its own Add New Colour entry...
479
480 int size = (QFontMetrics(QFont()).height() * 2) / 3;
481 if (size < 12) size = 12;
479 482
480 ColourDatabase *db = ColourDatabase::getInstance(); 483 ColourDatabase *db = ColourDatabase::getInstance();
481 for (int i = 0; i < db->getColourCount(); ++i) { 484 for (int i = 0; i < db->getColourCount(); ++i) {
482 QString name = db->getColourName(i); 485 QString name = db->getColourName(i);
483 cb->addItem(db->getExamplePixmap(i, QSize(12, 12)), name); 486 cb->addItem(db->getExamplePixmap(i, QSize(size, size)), name);
484 } 487 }
485 cb->addItem(tr("Add New Colour...")); 488 cb->addItem(tr("Add New Colour..."));
486 } 489 }
487 490
488 cb->blockSignals(false); 491 cb->blockSignals(false);