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

Fix QComboBox background and transparency workaround on macOS #7775

Open
wants to merge 1 commit into
base: master
from

Conversation

3 participants
@chargeflux
Copy link

chargeflux commented Feb 2, 2019

This is an attempted fix for https://bugs.dolphin-emu.org/issues/11256. The commit that seem to have caused the issue is 4bf276e.

To better understand why 4bf276e causes the issue, I changed Line 39 in the below file to p.setColor(QPalette::Window, Qt::black);, and this is the result,
solution

As you can see, Line 39, p.setColor(QPalette::Window, QColor(0, 0, 0, 0)); changes the background color of QComboBox at the top and bottom to be transparent and gives the impression that the rounded corners are gone, which is what the issue on the issue tracker is referring to. This PR restores the default palette of all QComboBoxes in the QWidget that GetWrappedWidget() is called for and restores the rounded corners to ensure proper UI on macOS for Qt apps. AFAIK, this applies to Settings, Graphics and the Properties Dialog.

This is a fix on macOS but I don't know how it will impact Windows for those QComboBoxes. I can take a look at it later if needed.

@BhaaLseN

This comment has been minimized.

Copy link
Member

BhaaLseN commented Feb 2, 2019

What happens if that section is removed completely? I wonder if we still needs this (or whether #6739 was shooting a bit over the target)

@chargeflux

This comment has been minimized.

Copy link
Author

chargeflux commented Feb 2, 2019

gsywot

This is what happens on macOS if you remove the ifdef section. That section is a QScrollArea that the arrow pointing to.

@BhaaLseN

This comment has been minimized.

Copy link
Member

BhaaLseN commented Feb 2, 2019

Uh, that looks a little like we're breaking the other part of the control and adding the transparency there just hide the remainder on macOS.

The right side is what it's supposed to look like, right? What causes the majority of the background to go missing (but only the top stick out)?

@chargeflux

This comment has been minimized.

Copy link
Author

chargeflux commented Feb 2, 2019

Each tab area is wrapped in a QScrollArea and causes that appearance. The transparency essentially fills that background. Assuming the scroll area is necessary, I am trying to figure out if we can implement the scroll area without breaking the background or having to add transparency.

@BhaaLseN

This comment has been minimized.

Copy link
Member

BhaaLseN commented Feb 2, 2019

Both the transparency change and your current PR feel a little like they're just piling workarounds on top of each other for something that should have an easier solution. Are we using those wrong perhaps, and need to look at how we're compositing the UI in that place?

@chargeflux

This comment has been minimized.

Copy link
Author

chargeflux commented Feb 2, 2019

I thought the arrow was pointing to QScrollArea but actually it was a QTabWidget. Adding a QScrollArea to a QTabWidget causes this issue because QTabWidget has a dark background, which is what the arrow is pointing to. However, QScrollArea has a native platform-specific background color that doesn't match the dark background for QTabWidget, on macOS at least. Thus, that is why I think we need to change the background color of QScrollArea to match QTabWidget's background color.

@8times9

This comment has been minimized.

Copy link
Contributor

8times9 commented Feb 2, 2019

Tested on Windows, the QComboBoxes aren't affected.

@chargeflux chargeflux force-pushed the chargeflux:QComboBoxBGColorFix-macOS branch from d651ea9 to a258ba2 Feb 2, 2019

@chargeflux chargeflux force-pushed the chargeflux:QComboBoxBGColorFix-macOS branch from a258ba2 to ef0b5e2 Feb 19, 2019

@chargeflux

This comment has been minimized.

Copy link
Author

chargeflux commented Feb 19, 2019

My attempted fix breaks in Dark Mode on macOS Mojave. I have opted for a different method to solve the issue and also removes the transparency workaround. I am unsure how it impacts Windows.

@chargeflux chargeflux changed the title Restore BG color of QComboBox when applying transparency on macOS Fix QComboBox background and transparency workaround on macOS Feb 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment