@@ -354,7 +354,6 @@ def btnFontColor_clicked(self):
354
354
if col .isValid ():
355
355
self .set_font_color_elements (col .name (), col .alphaF ())
356
356
self .update_font_color_button ()
357
- self .font_color_code = col
358
357
359
358
# Something changed, so update temp SVG
360
359
self .writeToFile (self .xmldoc )
@@ -374,7 +373,6 @@ def btnBackgroundColor_clicked(self):
374
373
if col .isValid ():
375
374
self .set_bg_style (col .name (), col .alphaF ())
376
375
self .update_background_color_button ()
377
- self .bg_color_code = col
378
376
379
377
# Something changed, so update temp SVG
380
378
self .writeToFile (self .xmldoc )
@@ -461,13 +459,13 @@ def update_font_color_button(self):
461
459
else :
462
460
text_color = QtGui .QColor (Qt .black )
463
461
464
- # Convert the opacity into the alpha value
465
- alpha = int (opacity * 65535.0 )
466
-
467
- # Set the colors of the button
462
+ # Set the color of the button, ignoring alpha
468
463
self .btnFontColor .setStyleSheet (
469
464
"background-color: %s; opacity: %s; color: %s;"
470
- % (color .name (), alpha , text_color .name ()))
465
+ % (color .name (), 1 , text_color .name ()))
466
+
467
+ # Store the opacity as the color's alpha level
468
+ color .setAlphaF (opacity )
471
469
self .font_color_code = color
472
470
473
471
def update_background_color_button (self ):
@@ -519,13 +517,13 @@ def update_background_color_button(self):
519
517
else :
520
518
text_color = QtGui .QColor (Qt .black )
521
519
522
- # Convert the opacity into the alpha value
523
- alpha = int (opacity * 65535.0 )
524
-
525
- # Set the colors of the button
520
+ # Set the colors of the button, ignoring opacity
526
521
self .btnBackgroundColor .setStyleSheet (
527
522
"background-color: %s; opacity: %s; color: %s;"
528
- % (color .name (), alpha , text_color .name ()))
523
+ % (color .name (), 1 , text_color .name ()))
524
+
525
+ # Store the opacity as the color's alpha level
526
+ color .setAlphaF (opacity )
529
527
self .bg_color_code = color
530
528
531
529
def set_font_style (self ):
0 commit comments