Skip to content

__main__: Implement basic darkmode provisions#5526

Merged
PrimozGodec merged 4 commits into
biolab:masterfrom
irgolic:basic-darkmode
Aug 6, 2021
Merged

__main__: Implement basic darkmode provisions#5526
PrimozGodec merged 4 commits into
biolab:masterfrom
irgolic:basic-darkmode

Conversation

@irgolic

@irgolic irgolic commented Jul 14, 2021

Copy link
Copy Markdown
Member
Description of changes
  • Sets 'darkMode' property in QApplication if 'dark' is specified in stylesheet. This can be easily queried globally elsewhere to color decisions
  • Sets default pyqtgraph colors from QPalette on startup

Also removed the pyqtgraph colors set on owpalette.py import (please don't call code like this :x)

This is the first step toward proper dark mode support. Most (if not all) visualizations hardcode their colors. These hardcoded colors need to be removed and delegated to global default color settings (as set in 8f92990).

Note, this only works on startup, if the OS changes its color scheme (as Mac can upon sunset/sunrise), it won't update accordingly. But it's a first step.

This was transplanted from #5287. That PR will change into setting new default colors.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov

codecov Bot commented Jul 14, 2021

Copy link
Copy Markdown

Codecov Report

Merging #5526 (6f58628) into master (aa628bf) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #5526   +/-   ##
=======================================
  Coverage   86.36%   86.36%           
=======================================
  Files         304      304           
  Lines       61665    61663    -2     
=======================================
+ Hits        53254    53255    +1     
+ Misses       8411     8408    -3     

@irgolic irgolic force-pushed the basic-darkmode branch 2 times, most recently from ebe1dcb to cea5591 Compare July 14, 2021 23:28
@PrimozGodec PrimozGodec merged commit c326cea into biolab:master Aug 6, 2021
@janezd janezd mentioned this pull request Sep 30, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants