# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1567875916 14400 # Node ID 4a4c74d920bcb7a5bd65c9cca69c1297df06d8e7 # Parent 406899afca32675413c53fad886dd84917ac0f62 ColourButton: always use plastique style, not system style Some other styles don't seem to allow recolouring: https://bugreports.qt.io/browse/QTBUG-11089 Looks like the solution is to instead pick a different style just for this widget. diff --git a/tilerswift b/tilerswift --- a/tilerswift +++ b/tilerswift @@ -4,6 +4,8 @@ from colors import NES_PALETTE +PLASTIQUE = QtWidgets.QStyleFactory().create("Plastique") + def read_rom(filename): with open(filename, 'rb') as f: ines = f.read() @@ -277,6 +279,10 @@ self.colour_idx = colour_idx self.set_colour(colour_idx) + # Native styles sometimes don't allow recolouring the + # background, see https://bugreports.qt.io/browse/QTBUG-11089 + self.setStyle(PLASTIQUE) + def set_colour(self, colour_idx): self.colour_idx = colour_idx self.setText(f"{colour_idx:0{2}X}")