Summary: | QtQuick dialog uses Dialog instead of Window, resulting in the wrong color on the bottom | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-knewstuff | Reporter: | Patrick Silva <bugseforuns> |
Component: | general | Assignee: | Jeremy Whiting <jpwhiting> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | admin, givbra, kde, kdelibs-bugs, nate |
Priority: | NOR | ||
Version: | 5.65.0 | ||
Target Milestone: | --- | ||
Platform: | Neon | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=413434 | ||
Latest Commit: | https://commits.kde.org/knewstuff/fd5b37818e6aa72fc149d9aec58511ca83e8a9d4 | Version Fixed In: | 5.67 |
Sentry Crash Report: | |||
Attachments: | screenshot |
The dialog uses a DialogButtonBox for this. Looks like our styling of DialogButtonBox doesn't respect the color scheme. I wrote import QtQuick 2.5 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.12 Item { width: 500 height: 500 ColumnLayout { Item { Layout.fillHeight: true } DialogButtonBox { Button { text: qsTr("Save") DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole } Button { text: qsTr("Close") DialogButtonBox.buttonRole: DialogButtonBox.DestructiveRole } } } } works fine. Please include a minimal test example if reporting against qqc2-desktop-style Example code that shows the issue (seen in the screenshot attached to this bug) can be found at https://cgit.kde.org/knewstuff.git/tree/src/qtquick/qml/Dialog.qml#n96 Requested info was provided. I opened it in gammaray. There is a no colour there because there is no item there. It's just showing the underlying window colour. This is not a QQC2 bug, as it's where there isn't any QQC2 element there. Moving back to KNS to find a fix. I'm not sure what options you've got other than porting to Window instead of Dialog. Then you've got the color property available. But shouldn't the styling for Dialog use the window background (i.e. light gray) by default instead of the view background (i.e. almost-white)? A dialog is a type of window after all. Also personally I think this button and the row it loves on should just go away. See Bug 413434. Could kill two birds with one stone if we did that. >But shouldn't the styling for Dialog use the window background
Arguably, but that requires getting new code into a deprecated Qt module.
We could try, but I don't think Dialog really offers anything useful.
*** Bug 417212 has been marked as a duplicate of this bug. *** Just uploaded a patch to attempt to alleviate this issue: https://phabricator.kde.org/D27204 Git commit fd5b37818e6aa72fc149d9aec58511ca83e8a9d4 by Dan Leinir Turthra Jensen. Committed on 07/02/2020 at 13:53. Pushed by leinir into branch 'master'. Fix the KNSQuick Dialog's close title and basic layout Summary: This resolves several issues found in the KNSQuick Dialog component. Specifically it puts a background in the dialog (as a rectangle), since the QtQuick Dialogs base dialog lacks such a thing by default, and offers no background property to rectify it. It further changes the Close button from a custom one to using a default button provided by the various underlying systems. This is more fault proof than the previous incarnation, but requires that the escape button press is handled separately. Finally it sets a sensible default size (previously the dialog was made large by the layout, but as a side effect of the layouting now being done without a Layout (which we could, but which would make the code enormously convoluted for little gain), we can now set a set of implicit width and height on the content item, which results in both a sensible default size and a dialogue that will resize down the way one would expect it to). This could have been done as separate patches, but they're too intertwined for that to feel in any way reasonable to do... Related: bug 416354, bug 414682 Test Plan: The dialog with its new default size looks as follows: {F8089818} Reviewers: #frameworks, ngraham Reviewed By: ngraham Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27204 M +19 -13 src/qtquick/qml/Dialog.qml https://commits.kde.org/knewstuff/fd5b37818e6aa72fc149d9aec58511ca83e8a9d4 |
Created attachment 124735 [details] screenshot STEPS TO REPRODUCE 1. set global theme the breeze dark in system settings > global theme 2. click on "Download new global themes..." button 3. OBSERVED RESULT As we can see in the attached screenshot, bottom of the window is white. EXPECTED RESULT breeze dark theme is correctly applied to the whole window SOFTWARE/OS VERSIONS Operating System: KDE neon Unstable Edition KDE Plasma Version: 5.17.80 KDE Frameworks Version: 5.66.0 Qt Version: 5.13.2