Fixed QSS Styling for YQDialogs #81
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trello
https://trello.com/c/KKQeOWSb Wrong Qt Window Transparency Making Windows Unusable
Split off from
https://trello.com/c/ST2Xm5iz HiDPI - Wrong resolution at Installation
Bugzilla
https://bugzilla.suse.com/show_bug.cgi?id=1199020
https://bugzilla.suse.com/show_bug.cgi?id=1191112
Problem
In some weird situations, YaST Qt UI main windows don't properly clear the background before rendering their own content and just overwrite what was there previously; resulting in something very similar to a transparency effect which makes the whole window unreadable and unusable.
Scenario
In this specific bug, wrongly detected HiDPI caused fonts that were much too large; so the Wizard.rb module fell back to an emergency mode to save screen space, not using the YQWizard (with the side bar), but a simple layout with a plain YDialog instead.
Apparent Cause
There was a problem with QSS styling: Any attempt to set a style for the
YQDialogwidget class resulted in this wrong rendering.Selecting the non-installation
style.qsswith theShiftF3key combination fixed the wrong transparency effect. Switching back toinstallation.qssand doing a slash-and-burn approach deleting line by line ofinstallation.qssshowed that the offending line was this:https://github.com/openSUSE/branding/blob/leap-15.4/yast/installation.qss#L6
Deeper Level Cause
Main windows in the Qt UI are managed in a
YQMainWinDockclass that implements something very similar to aQStackedWidget. But instead of actually using aQStackedWidget, it uses a self-made solution, and that solution had problems: Instead of showing and hiding itsYQDialogchildren to make sure only a single one is visible at any time, it only raised one of them to the top. That's not a problem in most scenarios; but obviously in this specific one it is.Qt-Level Cause?
For some reason, in the
QStyleSheetwidget style that is used when QSS style sheets are used, some of those widgets become transparent, and the problem we observed here appears.This may be a bug in the Qt libraries; or it may be a bug in the way we use them. But whichever it is, we need a solution on our level.
Fix
Ensure that only one of the
YQDialogsin theYQMainWindDockis visible at any given time: When raising the toplevel dialog, also make sure tohide()all the others. So whatever buggy transparency may appear, it doesn't matter because there is nothing to shine through the current toplevel dialog.Test
The problem can be reproduced even in the installed system:
installation.qssWizard.rbemergency modeWithout this Fix
With this Fix