diff --git a/Orange/canvas/__main__.py b/Orange/canvas/__main__.py index f4c265918bc..809ebf5a1ba 100644 --- a/Orange/canvas/__main__.py +++ b/Orange/canvas/__main__.py @@ -337,7 +337,7 @@ def send_statistics(url): r = requests.post(url, files={'file': json.dumps(data)}) if r.status_code != 200: log.warning("Error communicating with server while attempting to send " - "usage statistics. Status code " + str(r.status_code)) + "usage statistics. Status code %d", r.status_code) return # success - wipe statistics file log.info("Usage statistics sent.") @@ -457,6 +457,20 @@ def main(argv=None): app.setPalette(breeze_dark()) defaultstylesheet = "darkorange.qss" + # set pyqtgraph colors + def onPaletteChange(): + p = app.palette() + bg = p.base().color().name() + fg = p.windowText().color().name() + + log.info('Setting pyqtgraph background to %s', bg) + pyqtgraph.setConfigOption('background', bg) + log.info('Setting pyqtgraph foreground to %s', fg) + pyqtgraph.setConfigOption('foreground', fg) + + app.paletteChanged.connect(onPaletteChange) + onPaletteChange() + palette = app.palette() if style is None and palette.color(QPalette.Window).value() < 127: log.info("Switching default stylesheet to darkorange") @@ -560,6 +574,9 @@ def onrequest(url): stylesheet_string = pattern.sub("", stylesheet_string) + if 'dark' in stylesheet: + app.setProperty('darkMode', True) + else: log.info("%r style sheet not found.", stylesheet) diff --git a/Orange/widgets/utils/plot/owpalette.py b/Orange/widgets/utils/plot/owpalette.py index 9c58c29947c..19112fa1570 100644 --- a/Orange/widgets/utils/plot/owpalette.py +++ b/Orange/widgets/utils/plot/owpalette.py @@ -5,8 +5,6 @@ __all__ = ["create_palette", "OWPalette"] -pg.setConfigOption('background', 'w') -pg.setConfigOption('foreground', 'k') pg.setConfigOptions(antialias=True)