mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
custom icon generate
This commit is contained in:
parent
9a52a1c616
commit
a20406dc39
|
@ -293,6 +293,8 @@ bool Class::loadIconFromText( QString const & text )
|
|||
painter.drawImage( QPoint( img.width() == max ? 0 : ( max - img.width() ) / 2,
|
||||
img.height() == max ? 0 : ( max - img.height() ) / 2 ),
|
||||
img );
|
||||
painter.setCompositionMode(QPainter::CompositionMode_DestinationOut);
|
||||
|
||||
QFont font = painter.font();
|
||||
//the text should be a little smaller than the icon
|
||||
font.setPixelSize( iconSize * 0.6 );
|
||||
|
|
Loading…
Reference in a new issue