Python PyQt5.QtGui.QPalette.WindowText() Examples
The following are 15
code examples of PyQt5.QtGui.QPalette.WindowText().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
PyQt5.QtGui.QPalette
, or try the search function
.
Example #1
Source File: videostyle.py From vidcutter with GNU General Public License v3.0 | 6 votes |
def __init__(self): super(VideoStyleDark, self).__init__() palette = qApp.palette() palette.setColor(QPalette.Window, QColor(27, 35, 38)) palette.setColor(QPalette.WindowText, QColor(234, 234, 234)) palette.setColor(QPalette.Base, QColor(27, 35, 38)) palette.setColor(QPalette.AlternateBase, QColor(12, 15, 16)) palette.setColor(QPalette.ToolTipBase, QColor(27, 35, 38)) palette.setColor(QPalette.ToolTipText, Qt.white) palette.setColor(QPalette.Text, QColor(234, 234, 234)) palette.setColor(QPalette.Button, QColor(27, 35, 38)) palette.setColor(QPalette.ButtonText, Qt.white) palette.setColor(QPalette.BrightText, QColor(100, 215, 222)) palette.setColor(QPalette.Link, QColor(126, 71, 130)) # palette.setColor(QPalette.Highlight, QColor(126, 71, 130)) # palette.setColor(QPalette.HighlightedText, Qt.white) palette.setColor(QPalette.Disabled, QPalette.Light, Qt.black) palette.setColor(QPalette.Disabled, QPalette.Shadow, QColor(12, 15, 16)) qApp.setPalette(palette)
Example #2
Source File: cvstudio.py From CvStudio with MIT License | 6 votes |
def dark_theme(app: QApplication): app.setStyle('Fusion') style = os.path.abspath("assets/styles/dark/style.css") with open(style, "r") as f: app.setStyleSheet(f.read()) palette = QPalette() palette.setColor(QPalette.Window, QColor(0, 0, 0)) palette.setColor(QPalette.WindowText, QtCore.Qt.white) palette.setColor(QPalette.Base, QColor(15, 15, 15)) palette.setColor(QPalette.AlternateBase, QColor(53, 53, 53)) palette.setColor(QPalette.ToolTipBase, QtCore.Qt.white) palette.setColor(QPalette.ToolTipText, QtCore.Qt.white) palette.setColor(QPalette.Text, QtCore.Qt.white) palette.setColor(QPalette.Button, QColor(20, 20, 20)) palette.setColor(QPalette.ButtonText, QtCore.Qt.white) palette.setColor(QPalette.BrightText, QtCore.Qt.red) palette.setColor(QPalette.Highlight, QColor(239, 74, 40).lighter()) palette.setColor(QPalette.HighlightedText, QtCore.Qt.black) app.setPalette(palette)
Example #3
Source File: cvstudio.py From CvStudio with MIT License | 6 votes |
def cvstudio_theme(app: QApplication): app.setStyle('Fusion') app.setStyle('Fusion') style = os.path.abspath("assets/styles/cvstudio/style.css") with open(style, "r") as f: app.setStyleSheet(f.read()) palette = QPalette() palette.setColor(QPalette.Window, QColor(0, 0, 0)) palette.setColor(QPalette.WindowText, QtCore.Qt.white) palette.setColor(QPalette.Base, QColor(15, 15, 15)) palette.setColor(QPalette.AlternateBase, QColor(53, 53, 53)) palette.setColor(QPalette.ToolTipBase, QtCore.Qt.white) palette.setColor(QPalette.ToolTipText, QtCore.Qt.white) palette.setColor(QPalette.Text, QtCore.Qt.white) palette.setColor(QPalette.Button, QColor(20, 20, 20)) palette.setColor(QPalette.ButtonText, QtCore.Qt.white) palette.setColor(QPalette.BrightText, QtCore.Qt.red) palette.setColor(QPalette.Highlight, QColor(169, 3, 252).lighter()) palette.setColor(QPalette.HighlightedText, QtCore.Qt.black) app.setPalette(palette)
Example #4
Source File: __init__.py From binja_dynamics with Apache License 2.0 | 6 votes |
def submit_line(self): """ Writes the input to the text browser, adds it to the history, and adds it to the message queue to be sent to the binary """ raw = self._textbox.text() line = self.decode(raw) if line is None: return if raw not in self.history: self.history.append(raw) action = QtWidgets.QAction(str(raw), self) action.triggered.connect(partial(self.set_text_box_contents, raw)) self._hist_menu.insertAction(self._hist_menu.actions()[0], action) self._messages.put((line, None)) self._autoscroll() # self._textBrowser.setTextColor(usercolor) # self._textBrowser.insertPlainText(line + "\n") # self._textBrowser.setTextColor(self.palette().color(QPalette.WindowText)) self._textbox.clear() self._autoscroll()
Example #5
Source File: tabwidget.py From qutebrowser with GNU General Public License v3.0 | 5 votes |
def paintEvent(self, event): """Override paintEvent to draw the tabs like we want to.""" p = QStylePainter(self) selected = self.currentIndex() for idx in range(self.count()): if not event.region().intersects(self.tabRect(idx)): # Don't repaint if we are outside the requested region continue tab = QStyleOptionTab() self.initStyleOption(tab, idx) setting = 'colors.tabs' if self._tab_pinned(idx): setting += '.pinned' if idx == selected: setting += '.selected' setting += '.odd' if (idx + 1) % 2 else '.even' tab.palette.setColor(QPalette.Window, config.cache[setting + '.bg']) tab.palette.setColor(QPalette.WindowText, config.cache[setting + '.fg']) indicator_color = self.tab_indicator_color(idx) tab.palette.setColor(QPalette.Base, indicator_color) p.drawControl(QStyle.CE_TabBarTab, tab)
Example #6
Source File: init.py From Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader with MIT License | 5 votes |
def __init__(self): application = QtWidgets.QApplication(sys.argv) application.processEvents() loginWindow = client.LoginWindow() if settings.darkMode: application.setStyle("Fusion") palette = QPalette() palette.setColor(QPalette.Window, QColor(53, 53, 53)) palette.setColor(QPalette.WindowText, QColor(255, 255, 255)) palette.setColor(QPalette.Base, QColor(25, 25, 25)) palette.setColor(QPalette.AlternateBase, QColor(53, 53, 53)) palette.setColor(QPalette.ToolTipBase, QColor(255, 255, 255)) palette.setColor(QPalette.ToolTipText, QColor(255, 255, 255)) palette.setColor(QPalette.Text, QColor(255, 255, 255)) palette.setColor(QPalette.Button, QColor(53, 53, 53)) palette.setColor(QPalette.ButtonText, QColor(255, 255, 255)) palette.setColor(QPalette.BrightText, QColor(255, 0, 0)) palette.setColor(QPalette.Link, QColor(42, 130, 218)) palette.setColor(QPalette.Highlight, QColor(42, 130, 218)) palette.setColor(QPalette.HighlightedText, QColor(0, 0, 0)) application.setPalette(palette) loginWindow.show() #new = rawscriptsmenu.ScriptsMenu() #new.show() sys.exit(application.exec_()) client.safeDisconnect()
Example #7
Source File: detection.py From detection with GNU General Public License v2.0 | 5 votes |
def main(): app = QApplication(sys.argv) app.setStyle(QtWidgets.QStyleFactory.create("Fusion")) p = app.palette() p.setColor(QPalette.Base, QColor(40, 40, 40)) p.setColor(QPalette.Window, QColor(55, 55, 55)) p.setColor(QPalette.Button, QColor(49, 49, 49)) p.setColor(QPalette.Highlight, QColor(135, 135, 135)) p.setColor(QPalette.ButtonText, QColor(155, 155, 155)) p.setColor(QPalette.WindowText, QColor(155, 155, 155)) p.setColor(QPalette.Text, QColor(155, 155, 155)) p.setColor(QPalette.Disabled, QPalette.Base, QColor(49, 49, 49)) p.setColor(QPalette.Disabled, QPalette.Text, QColor(90, 90, 90)) p.setColor(QPalette.Disabled, QPalette.Button, QColor(42, 42, 42)) p.setColor(QPalette.Disabled, QPalette.ButtonText, QColor(90, 90, 90)) p.setColor(QPalette.Disabled, QPalette.Window, QColor(49, 49, 49)) p.setColor(QPalette.Disabled, QPalette.WindowText, QColor(90, 90, 90)) app.setPalette(p) QApplication.addLibraryPath(QApplication.applicationDirPath() + "/../PlugIns") main = Window() main.setWindowTitle('Detection') main.setWindowIcon(QtGui.QIcon('assets/icon.png')) main.show() try: sys.exit(app.exec_()) except KeyboardInterrupt: pass
Example #8
Source File: palettes.py From persepolis with GNU General Public License v3.0 | 5 votes |
def __init__(self): super().__init__() self.setColor(QPalette.Window, QColor(56, 56, 56)) self.setColor(QPalette.WindowText, Qt.white) self.setColor(QPalette.Base, QColor(56, 56, 56)) self.setColor(QPalette.AlternateBase, QColor(63, 63, 63)) self.setColor(QPalette.ToolTipBase, Qt.white) self.setColor(QPalette.ToolTipText, Qt.white) self.setColor(QPalette.Text, Qt.white) self.setColor(QPalette.Button, QColor(56, 56, 56)) self.setColor(QPalette.ButtonText, Qt.white) self.setColor(QPalette.BrightText, QColor(0, 128, 152)) self.setColor(QPalette.Link, QColor(42, 130, 218)) self.setColor(QPalette.Highlight, QColor(0, 128, 152)) self.setColor(QPalette.HighlightedText, Qt.white) self.setColor(QPalette.Disabled, QPalette.Window, QColor(51, 51, 51)) self.setColor(QPalette.Disabled, QPalette.ButtonText, QColor(111, 111, 111)) self.setColor(QPalette.Disabled, QPalette.Text, QColor(122, 118, 113)) self.setColor(QPalette.Disabled, QPalette.WindowText, QColor(122, 118, 113)) self.setColor(QPalette.Disabled, QPalette.Base, QColor(32, 32, 32))
Example #9
Source File: palettes.py From persepolis with GNU General Public License v3.0 | 5 votes |
def __init__(self): super().__init__() # EFF0F1 self.setColor(QPalette.Window, QColor(239, 240, 241)) self.setColor(QPalette.WindowText, QColor(49, 54, 59)) self.setColor(QPalette.Base, QColor(239, 240, 241)) self.setColor(QPalette.AlternateBase, QColor(63, 63, 63)) self.setColor(QPalette.ToolTipBase, QColor(49, 54, 59)) self.setColor(QPalette.ToolTipText, QColor(49, 54, 59)) self.setColor(QPalette.Text, QColor(49, 54, 59)) self.setColor(QPalette.Button, QColor(239, 240, 241)) self.setColor(QPalette.ButtonText, QColor(49, 54, 59)) self.setColor(QPalette.BrightText, QColor(110, 197, 244)) self.setColor(QPalette.Link, QColor(42, 130, 218)) self.setColor(QPalette.Highlight, QColor(110, 197, 244)) self.setColor(QPalette.HighlightedText, QColor(49, 54, 59)) self.setColor(QPalette.Disabled, QPalette.Window, QColor(227, 227, 227)) self.setColor(QPalette.Disabled, QPalette.ButtonText, QColor(111, 111, 111)) self.setColor(QPalette.Disabled, QPalette.Text, QColor(111, 111, 111)) self.setColor(QPalette.Disabled, QPalette.WindowText, QColor(111, 111, 111)) self.setColor(QPalette.Disabled, QPalette.Base, QColor(227, 227, 227))
Example #10
Source File: videostyle.py From vidcutter with GNU General Public License v3.0 | 5 votes |
def __init__(self): super(VideoStyleLight, self).__init__() palette = qApp.palette() palette.setColor(QPalette.Window, QColor(239, 240, 241)) palette.setColor(QPalette.WindowText, QColor(49, 54, 59)) palette.setColor(QPalette.Base, QColor(252, 252, 252)) palette.setColor(QPalette.AlternateBase, QColor(239, 240, 241)) palette.setColor(QPalette.ToolTipBase, QColor(239, 240, 241)) palette.setColor(QPalette.ToolTipText, QColor(49, 54, 59)) palette.setColor(QPalette.Text, QColor(49, 54, 59)) palette.setColor(QPalette.Button, QColor(239, 240, 241)) palette.setColor(QPalette.ButtonText, QColor(49, 54, 59)) palette.setColor(QPalette.BrightText, QColor(255, 255, 255)) palette.setColor(QPalette.Link, QColor(41, 128, 185)) # palette.setColor(QPalette.Highlight, QColor(126, 71, 130)) # palette.setColor(QPalette.HighlightedText, Qt.white) palette.setColor(QPalette.Disabled, QPalette.Light, Qt.white) palette.setColor(QPalette.Disabled, QPalette.Shadow, QColor(234, 234, 234)) qApp.setPalette(palette)
Example #11
Source File: main.py From Hydra with GNU General Public License v3.0 | 5 votes |
def launch(): # from utils.install_punkt import install_punkt # install_punkt() app = QApplication(sys.argv) try: file = sys.argv[1] except IndexError: # File not given file = get_last_file() app.setStyle("Fusion") palette = QPalette() editor = configs[choiceIndex]["editor"] ex = Main(app, palette, editor) palette.setColor(QPalette.Window, QColor(editor["windowColor"])) palette.setColor(QPalette.WindowText, QColor(editor["windowText"])) palette.setColor(QPalette.Base, QColor(editor["editorColor"])) palette.setColor(QPalette.AlternateBase, QColor(editor["alternateBase"])) palette.setColor(QPalette.ToolTipBase, QColor(editor["ToolTipBase"])) palette.setColor(QPalette.ToolTipText, QColor(editor["ToolTipText"])) palette.setColor(QPalette.Text, QColor(editor["editorText"])) palette.setColor(QPalette.Button, QColor(editor["buttonColor"])) palette.setColor(QPalette.ButtonText, QColor(editor["buttonTextColor"])) palette.setColor(QPalette.Highlight, QColor(editor["HighlightColor"]).lighter()) palette.setColor(QPalette.HighlightedText, QColor(editor["HighlightedTextColor"])) app.setPalette(palette) app.setStyleSheet(material_blue) # uncomment this to have a material blue theme ex.show() if file is not None: ex.cleanOpen(file) ex.openProjectWithPath(os.getcwd()) sys.exit(app.exec_())
Example #12
Source File: cvstudio.py From CvStudio with MIT License | 5 votes |
def gray_theme(app: QApplication): # **** => copy this code **** app.setStyle("Fusion") style = os.path.abspath("assets/styles/gray/style.css") with open(style, "r") as f: app.setStyleSheet(f.read()) dark_palette = QPalette() dark_palette.setColor(QPalette.Window, QColor(46, 47, 48)) dark_palette.setColor(QPalette.WindowText, QColor(208, 208, 208)) dark_palette.setColor(QPalette.Light, QColor(255, 255, 255)) dark_palette.setColor(QPalette.Midlight, QColor(227, 227, 227)) dark_palette.setColor(QPalette.Dark, QColor(64, 66, 68)) dark_palette.setColor(QPalette.Mid, QColor(160, 160, 160)) dark_palette.setColor(QPalette.Text, QColor(208, 208, 208)) dark_palette.setColor(QPalette.BrightText, QColor(255, 51, 51)) dark_palette.setColor(QPalette.Button, QColor(64, 66, 68)) dark_palette.setColor(QPalette.ButtonText, QColor(208, 208, 208)) dark_palette.setColor(QPalette.Base, QColor(46, 47, 48)) dark_palette.setColor(QPalette.Shadow, QColor(105, 105, 105)) dark_palette.setColor(QPalette.Highlight, QColor(0, 0, 0, 102)) dark_palette.setColor(QPalette.HighlightedText, QColor(255, 255, 255)) dark_palette.setColor(QPalette.Link, QColor(0, 122, 244)) dark_palette.setColor(QPalette.LinkVisited, QColor(165, 122, 255)) dark_palette.setColor(QPalette.AlternateBase, QColor(53, 54, 55)) dark_palette.setColor(QPalette.NoRole, QColor(0, 0, 0)) dark_palette.setColor(QPalette.ToolTipBase, QColor(0, 0, 0, 102)) dark_palette.setColor(QPalette.ToolTipText, QColor(208, 208, 208)) dark_palette.setColor(QPalette.Disabled, QPalette.Window, QColor(68, 68, 68, 255)) dark_palette.setColor(QPalette.Disabled, QPalette.WindowText, QColor(164, 166, 168, 96)) dark_palette.setColor(QPalette.Disabled, QPalette.Text, QColor(164, 166, 168, 96)) dark_palette.setColor(QPalette.Disabled, QPalette.ButtonText, QColor(164, 166, 168, 96)) dark_palette.setColor(QPalette.Disabled, QPalette.Base, QColor(68, 68, 68, 255)) dark_palette.setColor(QPalette.Disabled, QPalette.Shadow, QColor(0, 0, 0, 255)) app.setPalette(dark_palette) app.setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }")
Example #13
Source File: tabwidget.py From qutebrowser with GNU General Public License v3.0 | 4 votes |
def drawControl(self, element, opt, p, widget=None): """Override drawControl to draw odd tabs in a different color. Draws the given element with the provided painter with the style options specified by option. Args: element: ControlElement opt: QStyleOption p: QPainter widget: QWidget """ if element not in [QStyle.CE_TabBarTab, QStyle.CE_TabBarTabShape, QStyle.CE_TabBarTabLabel]: # Let the real style draw it. self._style.drawControl(element, opt, p, widget) return layouts = self._tab_layout(opt) if layouts is None: log.misc.warning("Could not get layouts for tab!") return if element == QStyle.CE_TabBarTab: # We override this so we can control TabBarTabShape/TabBarTabLabel. self.drawControl(QStyle.CE_TabBarTabShape, opt, p, widget) self.drawControl(QStyle.CE_TabBarTabLabel, opt, p, widget) elif element == QStyle.CE_TabBarTabShape: p.fillRect(opt.rect, opt.palette.window()) self._draw_indicator(layouts, opt, p) # We use super() rather than self._style here because we don't want # any sophisticated drawing. super().drawControl(QStyle.CE_TabBarTabShape, opt, p, widget) elif element == QStyle.CE_TabBarTabLabel: if not opt.icon.isNull() and layouts.icon.isValid(): self._draw_icon(layouts, opt, p) alignment = (config.cache['tabs.title.alignment'] | Qt.AlignVCenter | Qt.TextHideMnemonic) self._style.drawItemText(p, layouts.text, int(alignment), opt.palette, bool(opt.state & QStyle.State_Enabled), opt.text, QPalette.WindowText) else: raise ValueError("Invalid element {!r}".format(element))
Example #14
Source File: content.py From malss with MIT License | 4 votes |
def set_paragraph(self, h2='', h3='', text='', img=None): if h2 != '': lbl_h2 = QLabel(h2, self.inner) fnt = lbl_h2.font() fnt.setPointSize(self.H2_FONT_SIZE) lbl_h2.setFont(fnt) lbl_h2.setFixedHeight(self.H2_HEIGHT) lbl_h2.setAlignment(Qt.AlignBottom) lbl_h2.setMargin(self.SIDE_MARGIN) self.vbox.addWidget(lbl_h2) frm = QFrame(self.inner) frm.setFrameShape(QFrame.HLine) frm.setContentsMargins(self.SIDE_MARGIN, 0, self.SIDE_MARGIN, 0) plt = frm.palette() plt.setColor(QPalette.WindowText, Qt.darkGray) frm.setPalette(plt) self.vbox.addWidget(frm) if text != '': lbl_txt = QLabel(text, self.inner) lbl_txt.setWordWrap(True) fnt = lbl_txt.font() fnt.setPointSize(self.TEXT_FONT_SIZE) lbl_txt.setFont(fnt) lbl_txt.setMargin(self.SIDE_MARGIN) self.vbox.addWidget(lbl_txt) if img is not None: if self.params.lang == 'en': img += '_en.png' else: img += '_jp.png' pixmap = QPixmap(img) if not pixmap.isNull(): lbl_img = QLabel(self.inner) lbl_img.setPixmap(pixmap) self.lbl_img_list.append(lbl_img) self.pixmap_list.append(pixmap.scaledToWidth(pixmap.width())) self.vbox.addWidget(lbl_img) self.inner.setLayout(self.vbox)
Example #15
Source File: ChartThemes.py From PyQt with GNU General Public License v3.0 | 4 votes |
def updateUI(self): theme = self.m_themeComboBox.itemData( self.m_themeComboBox.currentIndex()) if self.m_charts[0].chart().theme() != theme: for chartView in self.m_charts: chartView.chart().setTheme(theme) pal = self.window().palette() if theme == QChart.ChartThemeLight: pal.setColor(QPalette.Window, QColor(0xf0f0f0)) pal.setColor(QPalette.WindowText, QColor(0x404044)) elif theme == QChart.ChartThemeDark: pal.setColor(QPalette.Window, QColor(0x121218)) pal.setColor(QPalette.WindowText, QColor(0xd6d6d6)) elif theme == QChart.ChartThemeBlueCerulean: pal.setColor(QPalette.Window, QColor(0x40434a)) pal.setColor(QPalette.WindowText, QColor(0xd6d6d6)) elif theme == QChart.ChartThemeBrownSand: pal.setColor(QPalette.Window, QColor(0x9e8965)) pal.setColor(QPalette.WindowText, QColor(0x404044)) elif theme == QChart.ChartThemeBlueNcs: pal.setColor(QPalette.Window, QColor(0x018bba)) pal.setColor(QPalette.WindowText, QColor(0x404044)) elif theme == QChart.ChartThemeHighContrast: pal.setColor(QPalette.Window, QColor(0xffab03)) pal.setColor(QPalette.WindowText, QColor(0x181818)) elif theme == QChart.ChartThemeBlueIcy: pal.setColor(QPalette.Window, QColor(0xcee7f0)) pal.setColor(QPalette.WindowText, QColor(0x404044)) else: pal.setColor(QPalette.Window, QColor(0xf0f0f0)) pal.setColor(QPalette.WindowText, QColor(0x404044)) self.window().setPalette(pal) checked = self.m_antialiasCheckBox.isChecked() for chartView in self.m_charts: chartView.setRenderHint(QPainter.Antialiasing, checked) options = QChart.AnimationOptions( self.m_animatedComboBox.itemData( self.m_animatedComboBox.currentIndex())) if self.m_charts[0].chart().animationOptions() != options: for chartView in self.m_charts: chartView.chart().setAnimationOptions(options) alignment = self.m_legendComboBox.itemData( self.m_legendComboBox.currentIndex()) for chartView in self.m_charts: legend = chartView.chart().legend() if alignment == 0: legend.hide() else: legend.setAlignment(Qt.Alignment(alignment)) legend.show()