Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Use palette colors in more places #5680

Merged
merged 20 commits into from
Feb 4, 2022

Conversation

ales-erjavec
Copy link
Contributor

Issue

Some visualizations use hardcoded colors and do not account for the effective color palette.

Description of changes

Replace use of hardcoded colors with palette colors.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov
Copy link

codecov bot commented Nov 3, 2021

Codecov Report

Merging #5680 (ca9b973) into master (2b857a3) will increase coverage by 0.07%.
The diff coverage is 91.79%.

@@            Coverage Diff             @@
##           master    #5680      +/-   ##
==========================================
+ Coverage   86.13%   86.20%   +0.07%     
==========================================
  Files         316      316              
  Lines       66388    66616     +228     
==========================================
+ Hits        57182    57426     +244     
+ Misses       9206     9190      -16     

@ales-erjavec ales-erjavec force-pushed the use-palette-colors branch 2 times, most recently from 955ec62 to f657bad Compare November 4, 2021 13:20
@ajdapretnar
Copy link
Contributor

The only fault I can find here is the Correspondence Analysis suddenly showing no points at all. 🤷‍♀️
Uploading Screen Shot 2021-11-17 at 10.59.33.png…

The rest is ok. I hope I have tested it well, I wasn't entirely sure what to check. 😅

@ajdapretnar ajdapretnar removed their assignment Nov 17, 2021
@ales-erjavec ales-erjavec force-pushed the use-palette-colors branch 3 times, most recently from 6f89123 to 7895eeb Compare November 19, 2021 09:33
if self.__brush is not None:
return QBrush(self.__brush)
else:
color = self.palette().color(QPalette.Window)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is too dark, at least on my machine. I don't have a better suggestion, except, perhaps, super().brush() (which, for me, apparently uses a transparent background).

Screenshot 2021-11-19 at 14 04 23

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange its supposed to be:
Screenshot 2021-11-19 at 14 29 02

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I can finally say: Janez, your Qt is a mess. 😆
(i.e. My version is ok, too.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My QPalette.Window is black, which it indeed shouldn't be (in light mode on macOS). Any ideas why?

>>> hex(QPalette().color(QPalette.Window).rgb())
'0xff000000'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you post the contents of ~/.config/biolab.si/Orange.iniin particular [application-style] section.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[application-style]
palette=
style-name=

@janezd
Copy link
Contributor

janezd commented Nov 26, 2021

I tried in a new environment. It's still (transparent) black.

@VesnaT
Copy link
Contributor

VesnaT commented Dec 17, 2021

image

On:

  • macOS Catalina
  • python 3.8.3
  • PyQt5==5.12.3

@ales-erjavec ales-erjavec force-pushed the use-palette-colors branch 3 times, most recently from 4035846 to ee046d3 Compare December 31, 2021 07:58
@janezd janezd self-assigned this Jan 14, 2022
@janezd
Copy link
Contributor

janezd commented Feb 4, 2022

@ales-erjavec, I downloaded an Orange bundle, replaced the widgets directory with the files from this PR. The legend still has a black background. It looks as something between Qt and Catalina, not my installation of Qt.

@VesnaT VesnaT removed their assignment Feb 4, 2022
@janezd
Copy link
Contributor

janezd commented Feb 4, 2022

As suggested by @markotoplak, I tried creating a fresh user. Still black.

@janezd
Copy link
Contributor

janezd commented Feb 4, 2022

Found it. Works with pyqtgraph 0.12 (the change that was made just to improve performance, it appears: pyqtgraph/pyqtgraph@fd0e2b6).

@ales-erjavec, @markotoplak, can we increase the oldest supported version to 0.12?

@ales-erjavec, can you add it to this PR?

@ales-erjavec
Copy link
Contributor Author

... can we increase the oldest supported version to 0.12?

I have reset the palette instead so that wont be necessary.

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.

4 participants