@@ -669,20 +669,22 @@ def __init__(self, parent, data=None, readonly=False, bg_value=None, bg_gradient
669
669
gradient_chooser .setMaximumSize (120 , 20 )
670
670
gradient_chooser .setIconSize (QSize (100 , 20 ))
671
671
672
- # add white option
673
672
pixmap = QPixmap (100 , 15 )
674
- pixmap .fill (Qt .white )
673
+ pixmap .fill (Qt .transparent )
674
+ painter = QPainter (pixmap )
675
+
676
+ # add white option
677
+ # 1 (y) and 13 (height) instead of 0 and 15 to have a transparent border around/between the gradients
678
+ painter .fillRect (0 , 1 , 100 , 13 , Qt .white )
675
679
gradient_chooser .addItem (QIcon (pixmap ), "white" )
676
680
677
681
# add other options
678
- pixmap .fill (Qt .transparent )
679
- painter = QPainter (pixmap )
680
682
for name , gradient in available_gradients [1 :]:
681
683
qgradient = gradient .as_qgradient ()
682
684
683
685
# * fill with white because gradient can be transparent and if we do not "start from white", it skews the
684
686
# colors.
685
- # * 1 and 13 instead of 0 and 15 to have a transparent border around/between the gradients
687
+ # * 1 (y) and 13 (height) instead of 0 and 15 to have a transparent border around/between the gradients
686
688
painter .fillRect (0 , 1 , 100 , 13 , Qt .white )
687
689
painter .fillRect (0 , 1 , 100 , 13 , qgradient )
688
690
gradient_chooser .addItem (QIcon (pixmap ), name , gradient )
0 commit comments