Mercurial > hg > svgui
diff 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 |
line wrap: on
line diff
--- a/widgets/PropertyBox.cpp Wed Nov 30 10:54:16 2016 +0000 +++ b/widgets/PropertyBox.cpp Wed Nov 30 11:01:39 2016 +0000 @@ -476,11 +476,14 @@ //!!! should be a proper colour combobox class that // manages its own Add New Colour entry... + + int size = (QFontMetrics(QFont()).height() * 2) / 3; + if (size < 12) size = 12; ColourDatabase *db = ColourDatabase::getInstance(); for (int i = 0; i < db->getColourCount(); ++i) { QString name = db->getColourName(i); - cb->addItem(db->getExamplePixmap(i, QSize(12, 12)), name); + cb->addItem(db->getExamplePixmap(i, QSize(size, size)), name); } cb->addItem(tr("Add New Colour...")); }