From 68c82a97f440a26da7cf2024c480c7f56270c9ab Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 05:39:56 +0000 Subject: [PATCH] Qt: draw the search clear button, fade home out under the drawer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The phone's font has no ✕, so the clear button showed as a missing-glyph box; it is now two drawn strokes. The home screen showed through the drawer's backdrop; it now fades out as the drawer slides over it, leaving only the wallpaper behind the app list. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DPL5hiQsCq11CwCPnKPp9D --- qt/qml/Main.qml | 3 +++ qt/qml/SearchField.qml | 18 +++++++++++++----- qt/tests/e2e.cpp | 2 ++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/qt/qml/Main.qml b/qt/qml/Main.qml index 92c1ad6..28ef5c6 100644 --- a/qt/qml/Main.qml +++ b/qt/qml/Main.qml @@ -418,6 +418,9 @@ Window { Item { id: scroller + // The home screen fades out as the drawer slides over it, so only the + // wallpaper is left behind the app list. + opacity: drawer.visible ? Math.max(0, 1 - drawer.edge / Math.max(1, root.height)) : 1 width: parent.width height: root.contentH y: -root.scrollY diff --git a/qt/qml/SearchField.qml b/qt/qml/SearchField.qml index 82e82a3..f522f33 100644 --- a/qt/qml/SearchField.qml +++ b/qt/qml/SearchField.qml @@ -65,11 +65,19 @@ Rectangle { width: visible ? 44 : 0 visible: input.displayText.length > 0 z: 1 - Text { - anchors.centerIn: parent - text: "✕" - color: Qt.rgba(1, 1, 1, .7) - font.pixelSize: 14 + // Drawn, not a glyph: phone fonts may have no ✕. + Repeater { + model: [45, -45] + Rectangle { + required property var modelData + anchors.centerIn: parent + width: 14 + height: 2 + radius: 1 + rotation: modelData + antialiasing: true + color: Qt.rgba(1, 1, 1, .7) + } } MouseArea { anchors.fill: parent diff --git a/qt/tests/e2e.cpp b/qt/tests/e2e.cpp index dd4aa2c..128c74e 100644 --- a/qt/tests/e2e.cpp +++ b/qt/tests/e2e.cpp @@ -251,6 +251,8 @@ int main(int argc, char *argv[]) { eq(js("drawer.shown.map(i => apps[i].label).join(',')"), "Gmail,Maps", "the search filters the list"); { // the clear button empties the search and shows every app again + settle(100); + snap("search"); auto *clear = win->findChild("searchClear"); check(clear && clear->isVisible(), "the search shows a clear button"); if (clear) tap(clear->mapToScene(QPointF(clear->width() / 2, clear->height() / 2)));