def setPalettes(self): self.palettes = { "wrong": QPalette( Qt.black, Qt.lightGray, Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_wrong_fg"), Qt.white, Settings.getColor("quiz_wrong_bg"), Qt.yellow, ), "right": QPalette( Qt.black, Qt.lightGray, Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_right_fg"), Qt.yellow, Settings.getColor("quiz_right_bg"), Qt.yellow, ), "inactive": QPalette( Qt.black, Qt.lightGray, Qt.lightGray, Qt.darkGray, Qt.gray, Qt.black, Qt.lightGray, ), } self.setPalette(self.palettes["inactive"])
def setPalettes(self): self.palettes = { 'wrong': QPalette(Qt.black, Qt.lightGray, Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_wrong_fg"), Qt.white, Settings.getColor("quiz_wrong_bg"), Qt.yellow), 'right': QPalette(Qt.black, Qt.lightGray, Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_right_fg"), Qt.yellow, Settings.getColor("quiz_right_bg"), Qt.yellow), 'inactive': QPalette(Qt.black, Qt.lightGray, Qt.lightGray, Qt.darkGray, Qt.gray, Qt.black, Qt.lightGray)} self.setPalette(self.palettes['inactive'])
def updatePalette(self): self.setPalette( QPalette( Settings.getColor("main_text_color"), #color of typing text Settings.getColor( "widgets_background_color" ), #label tab gets part of it color from here Settings.getColor("main_borders_color"), #borders Settings.getColor( "widgets_text_color"), #rectangles in sources Qt.gray, #tab arrow Settings.getColor( "widgets_text_color"), #color of widgets text Qt.white, Settings.getColor( "main_text_area_color"), #most text areas' backgrounds Settings.getColor( "main_background_color" ) #most backgrounds. label tab gets part of its color from here. ))
def setPalettes(self): inactive_palette = QPalette(Qt.black, Settings.getColor("quiz_inactive_bd"), Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_inactive_fg"), Qt.yellow, Settings.getColor("quiz_inactive_bg"), Qt.yellow) inactive_palette.setColor(QPalette.Highlight, Settings.getColor("quiz_inactive_hl")) inactive_palette.setColor(QPalette.HighlightedText, Settings.getColor("quiz_inactive_hl_text")) self.palettes = { 'wrong': QPalette(Qt.black, Settings.getColor("quiz_wrong_bd"), Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_wrong_fg"), Qt.white, Settings.getColor("quiz_wrong_bg"), Qt.yellow), 'right': QPalette(Qt.black, Settings.getColor("quiz_right_bd"), Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_right_fg"), Qt.yellow, Settings.getColor("quiz_right_bg"), Qt.yellow), 'invisible': QPalette(Qt.black, Settings.getColor("quiz_invisible_bd"), Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_invisible_color"), Qt.yellow, Settings.getColor("quiz_invisible_color"), Qt.yellow), 'inactive':inactive_palette } self.setPalette(self.palettes['inactive'])
def setPalettes(self): inactive_palette = QPalette(Qt.black, Settings.getColor("quiz_inactive_bd"), Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_inactive_fg"), Qt.yellow, Settings.getColor("quiz_inactive_bg"), Qt.yellow) inactive_palette.setColor(QPalette.Highlight, Settings.getColor("quiz_inactive_hl")) inactive_palette.setColor(QPalette.HighlightedText, Settings.getColor("quiz_inactive_hl_text")) self.palettes = { 'wrong': QPalette(Qt.black, Settings.getColor("quiz_wrong_bd"), Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_wrong_fg"), Qt.white, Settings.getColor("quiz_wrong_bg"), Qt.yellow), 'right': QPalette(Qt.black, Settings.getColor("quiz_right_bd"), Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_right_fg"), Qt.yellow, Settings.getColor("quiz_right_bg"), Qt.yellow), 'invisible': QPalette(Qt.black, Settings.getColor("quiz_invisible_bd"), Qt.lightGray, Qt.darkGray, Qt.gray, Settings.getColor("quiz_invisible_color"), Qt.yellow, Settings.getColor("quiz_invisible_color"), Qt.yellow), 'inactive': inactive_palette } self.setPalette(self.palettes['inactive'])