Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.0
-
None
-
-
31f5c21ddb571d744efd1885c0687816b3a12225
Description
Using MenuItem as an example, the disabled windowText property of its palette is set in C++, but there's no way to set it from QML and hence no way to distinguish between the normal and disabled colours. This means that once you set windowText, you effectively override the disabled colour as well.
The last item in the screenshot below should be the default (light greyish) disabled colour:
import QtQuick 2.11 import QtQuick.Controls 2.4 import QtQuick.Window 2.2 Window { id: window objectName: "window" width: 600 height: 800 visible: true Menu { visible: true MenuItem { text: "Enabled, default palette" } MenuItem { text: "Disabled, default palette" enabled: false } MenuItem { text: "Enabled, custom palette" palette.windowText: "red" } MenuItem { text: "Disabled, custom palette" enabled: false palette.windowText: "red" } } }
One solution might be to add a "disabled" grouped property somehow:
palette.windowText: "red" palette.disabled.windowText: "gray"