Bug 415606 - QtQuick dialog uses Dialog instead of Window, resulting in the wrong color on the bottom
Summary: QtQuick dialog uses Dialog instead of Window, resulting in the wrong color on...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-knewstuff
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.65.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Jeremy Whiting
URL:
Keywords:
: 417212 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-12-27 11:34 UTC by Patrick Silva
Modified: 2020-02-07 14:38 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.67


Attachments
screenshot (251.76 KB, image/png)
2019-12-27 11:34 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2019-12-27 11:34:06 UTC
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
Comment 1 Nate Graham 2020-01-01 23:32:04 UTC
The dialog uses a DialogButtonBox for this. Looks like our styling of DialogButtonBox doesn't respect the color scheme.
Comment 2 David Edmundson 2020-01-02 00:38:21 UTC
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
Comment 3 Nate Graham 2020-01-03 02:30:04 UTC
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
Comment 4 Patrick Silva 2020-01-17 10:21:22 UTC
Requested info was provided.
Comment 5 David Edmundson 2020-01-21 14:05:27 UTC
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.
Comment 6 Nate Graham 2020-01-21 14:33:38 UTC
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.
Comment 7 David Edmundson 2020-01-21 15:25:56 UTC
>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.
Comment 8 Patrick Silva 2020-02-06 17:15:59 UTC
*** Bug 417212 has been marked as a duplicate of this bug. ***
Comment 9 Dan Leinir Turthra Jensen 2020-02-07 10:32:37 UTC
Just uploaded a patch to attempt to alleviate this issue:
https://phabricator.kde.org/D27204
Comment 10 Dan Leinir Turthra Jensen 2020-02-07 13:53:16 UTC
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