How to use the qdarkstyle.load_stylesheet_from_environment function in QDarkStyle

To help you get started, we’ve selected a few QDarkStyle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marioortizmanero / spotify-music-videos / vidify / __main__.py View on Github external
def start_gui(config: Config) -> None:
    """
    Initializing the Qt application. MainWindow takes care of initializing
    the player and the API, and acts as the "main function" where everything
    is put together.
    """

    app = QApplication(['vidify'])
    # Setting dark mode if enabled
    if config.dark_mode:
        logging.info("Enabling dark mode")
        app.setStyleSheet(qdarkstyle.load_stylesheet_from_environment())
        set_dark_mode()
    app.setWindowIcon(QIcon(Res.icon))
    window = MainWindow(config)
    window.show()
    sys.exit(app.exec_())
github vnpy / vnpy / examples / RQData / run.py View on Github external
#----------------------------------------------------------------------
    def exit(self):
        """"""
        self.active = False
        self.thread.join()
        
        QtWidgets.qApp.quit()
        

if __name__ == '__main__':
    font = QtGui.QFont(u'微软雅黑', 12)
    
    app = QtWidgets.QApplication([])
    app.setFont(font)
    app.setStyleSheet(qdarkstyle.load_stylesheet_from_environment())
    
    ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('RQDataService')  
    
    manager = RqDataManager()
    manager.show()
    
    app.exec_()
github spyder-ide / spyder-notebook / spyder_notebook / widgets / example_app.py View on Github external
def __init__(self, options):
        super().__init__()

        if options.dark:
            self.setStyleSheet(qdarkstyle.load_stylesheet_from_environment())

        self.server_manager = ServerManager(options.dark)
        QApplication.instance().aboutToQuit.connect(
            self.server_manager.shutdown_all_servers)

        self.tabwidget = NotebookTabWidget(
            self, self.server_manager, dark_theme=options.dark)

        if options.notebook:
            self.tabwidget.open_notebook(options.notebook)
        else:
            self.tabwidget.maybe_create_welcome_client()

        self.setCentralWidget(self.tabwidget)
        self._setup_menu()
github spyder-ide / spyder / spyder / widgets / mixins.py View on Github external
def _update_stylesheet(self, widget):
        """Update the background stylesheet to make it lighter."""
        if is_dark_interface():
            css = qdarkstyle.load_stylesheet_from_environment()
            widget.setStyleSheet(css)
            palette = widget.palette()
            background = palette.color(palette.Window).lighter(150).name()
            border = palette.color(palette.Window).lighter(200).name()
            name = widget.__class__.__name__
            widget.setObjectName(name)
            extra_css = '''
                {0}#{0} {{
                    background-color:{1};
                    border: 1px solid {2};
                }}'''.format(name, background, border)
            widget.setStyleSheet(css + extra_css)
github jadijadi / digikala_history / plotter.py View on Github external
pg.setConfigOptions(antialias=True)
        self.p6 = self.addPlot(title="")
        self.curve = self.p6.plot(pen='r')
        

    def addData(self, xData, yData):
        self.curve.setData(x = xData, y = yData)
        
    def getImage(self, filename):
        exporter =  exporter = pyqtgraph.exporters.ImageExporter(self.scene())
        exporter.export(filename)

if __name__ == '__main__':
    w = PlotWidget()
    w.show()
    QtGui.QApplication.setStyleSheet(qdarkstyle.load_stylesheet_from_environment(is_pyqtgraph=True))
    QtGui.QApplication.instance().exec_()
github spyder-ide / spyder / spyder / widgets / mixins.py View on Github external
def _update_stylesheet(self, widget):
        """Update the background stylesheet to make it lighter."""
        # Update the stylesheet for a given widget at most once
        # because Qt is slow to repeatedly parse & apply CSS
        if id(widget) in self._styled_widgets:
            return
        self._styled_widgets.add(id(widget))

        if is_dark_interface():
            css = qdarkstyle.load_stylesheet_from_environment()
            widget.setStyleSheet(css)
            palette = widget.palette()
            background = palette.color(palette.Window).lighter(150).name()
            border = palette.color(palette.Window).lighter(200).name()
            name = widget.__class__.__name__
            widget.setObjectName(name)
            extra_css = '''
                {0}#{0} {{
                    background-color:{1};
                    border: 1px solid {2};
                }}'''.format(name, background, border)
            widget.setStyleSheet(css + extra_css)