@@ -736,9 +736,10 @@ def createGeneralTab(self):
736736 self .maskingCheck = QCheckBox ('' )
737737 self .maskingCheck .stateChanged .connect (main_window .toggleMasking )
738738
739+ button_width = self .font_metric .boundingRect ("XXXXXXXXXX" ).width ()
739740 self .maskColorButton = QPushButton ()
740741 self .maskColorButton .setCursor (QtCore .Qt .PointingHandCursor )
741- self .maskColorButton .setFixedWidth (self . font_metric . width ( "XXXXXXXXXX" ) )
742+ self .maskColorButton .setFixedWidth (button_width )
742743 self .maskColorButton .setFixedHeight (self .font_metric .height () * 1.5 )
743744 self .maskColorButton .clicked .connect (main_window .editMaskingColor )
744745
@@ -748,7 +749,7 @@ def createGeneralTab(self):
748749
749750 self .hlColorButton = QPushButton ()
750751 self .hlColorButton .setCursor (QtCore .Qt .PointingHandCursor )
751- self .hlColorButton .setFixedWidth (self . font_metric . width ( "XXXXXXXXXX" ) )
752+ self .hlColorButton .setFixedWidth (button_width )
752753 self .hlColorButton .setFixedHeight (self .font_metric .height () * 1.5 )
753754 self .hlColorButton .clicked .connect (main_window .editHighlightColor )
754755
@@ -764,7 +765,7 @@ def createGeneralTab(self):
764765 # General options
765766 self .bgButton = QPushButton ()
766767 self .bgButton .setCursor (QtCore .Qt .PointingHandCursor )
767- self .bgButton .setFixedWidth (self . font_metric . width ( "XXXXXXXXXX" ) )
768+ self .bgButton .setFixedWidth (button_width )
768769 self .bgButton .setFixedHeight (self .font_metric .height () * 1.5 )
769770 self .bgButton .clicked .connect (main_window .editBackgroundColor )
770771
@@ -788,7 +789,7 @@ def createGeneralTab(self):
788789
789790 self .overlapColorButton = QPushButton ()
790791 self .overlapColorButton .setCursor (QtCore .Qt .PointingHandCursor )
791- self .overlapColorButton .setFixedWidth (self . font_metric . width ( "XXXXXXXXXX" ) )
792+ self .overlapColorButton .setFixedWidth (button_width )
792793 self .overlapColorButton .setFixedHeight (self .font_metric .height () * 1.5 )
793794 self .overlapColorButton .clicked .connect (main_window .editOverlapColor )
794795
0 commit comments