pymmcore-plus / pymmcore-widgets

A set of Qt-based widgets onto the pymmcore-plus model
https://pymmcore-plus.github.io/pymmcore-widgets
Other
12 stars 7 forks source link

All Radio Buttons appear On within GridPlan widget on Windows 11 #339

Closed gselzer closed 4 months ago

gselzer commented 4 months ago

Description

A colleague was confused by the radio buttons within the GridPlanWidget, as they appeared to him to all be on at once - it's not apparent at a glance which is actually on.

image

The UI does not have this problem on macOS (at least as far as I can tell on the documentation screenshots) nor on WSL, so it might be a OS-specific thing we can't do much about, or maybe it is a styling thing?

tlambert03 commented 4 months ago

this is what I see on windows 10:

Capture

what does yours like like without the dark theme?

gselzer commented 4 months ago

Nope 😅

image

Windows 11 thing, then?

tlambert03 commented 4 months ago

ok, yeah, i think it's the accent color on windows 11 somehow... try playing with your personalization stuff and see if you can learn anything. That circle in the first one is showing that it's selected...

image

but it's obviously incredibly hard to see. windows is annoying. I also don't know why your other fields don't seem to be disabled like they are in my view. this is the standard example right? Not a widget within a broader app that might have a style sheet applied?

gselzer commented 4 months ago

try playing with your personalization stuff and see if you can learn anything.

Yeah, I'll keep looking.

windows is annoying.

đŸ’¯

I also don't know why your other fields don't seem to be disabled like they are in my view.

Well, they are disabled, but there's no visual indication (outside of the cursor not changing to the I-Beam on the disabled fields) ☚ī¸

this is the standard example right? Not a widget within a broader app that might have a style sheet applied?

The above image was from my UI, however it looks identical if I run python pymmcore-widgets/examples/mda_widget.py

tlambert03 commented 4 months ago

Qt issue tracker for windows11 is here: https://bugreports.qt.io/browse/QTBUG-125857?jql=labels%20%3D%20Windows11%20

definitely a number of open issues regarding look/style

gselzer commented 4 months ago

So this MCVE showcases the problem. On Windows 11, it would seem that the line self.setWidget(self.inner) is the culprit that affects the style, as removing that line removes the accent fill that makes this so confusing.

from qtpy.QtWidgets import QApplication, QScrollArea, QWidget, QRadioButton, QVBoxLayout

app = QApplication([])

class FooWidget(QScrollArea):

    def __init__(self, parent: QWidget | None = None):
        super().__init__(parent)

        self.btn = QRadioButton()

        self.inner = QWidget(self)
        layout = QVBoxLayout(self.inner)

        layout.addWidget(self.btn)

        self.setWidget(self.inner)

wdg = FooWidget()
wdg.show()
app.exec()
gselzer commented 4 months ago

Despite my multiple attempts this issue was not automatically closed with the merge of #334 - so I'll do it myself! 😤