From 28537cf3ff3cd9210f7568f40334ac3a2c9bed18 Mon Sep 17 00:00:00 2001 From: Xu Zhao Date: Wed, 30 Mar 2022 00:13:44 -0400 Subject: [PATCH] Change the text color when appmenu is selected or hovered When the mouse hovers the appmenu item, the text color should be inverted to the background color. Before this commit, the text was still the same color as the "REST" state, making it difficult to recognize. --- applets/appmenu/package/contents/ui/MenuDelegate.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/applets/appmenu/package/contents/ui/MenuDelegate.qml b/applets/appmenu/package/contents/ui/MenuDelegate.qml index ebbf8d53a..441e99016 100644 --- a/applets/appmenu/package/contents/ui/MenuDelegate.qml +++ b/applets/appmenu/package/contents/ui/MenuDelegate.qml @@ -66,5 +66,9 @@ AbstractButton { contentItem: PC3.Label { text: controlRoot.Kirigami.MnemonicData.richTextLabel + // Kirigami.Theme.highlightedTextColor returns different colors + // depending on window focus, which does not apply to this applet + // instead, we use palette.highlightedText here, which returns consistent result + color: background.state == MenuDelegate.State.Rest ? palette.windowText : palette.highlightedText } }