From c0a9b4bda9a3b88f5222f74c2efe0a60b8f6b1b4 Mon Sep 17 00:00:00 2001 From: reionwong Date: Wed, 23 Jun 2021 12:37:42 +0800 Subject: [PATCH] Use the new FishUI API --- qml/FolderGridItem.qml | 8 ++++---- qml/FolderGridView.qml | 2 ++ qml/main.qml | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/qml/FolderGridItem.qml b/qml/FolderGridItem.qml index 21fa234..62197f4 100644 --- a/qml/FolderGridItem.qml +++ b/qml/FolderGridItem.qml @@ -87,8 +87,8 @@ Item { ColorOverlay { anchors.fill: _icon source: _icon - color: Qt.lighter(FishUI.Theme.highlightColor, 1.6) - opacity: FishUI.Theme.darkMode ? 0.4 : 0.6 + color: "white" + opacity: FishUI.Theme.darkMode ? 0.3 : 0.4 visible: control.hovered && !control.selected } } @@ -121,8 +121,8 @@ Item { ColorOverlay { anchors.fill: _image source: _image - color: Qt.lighter(FishUI.Theme.highlightColor, 1.6) - opacity: FishUI.Theme.darkMode ? 0.4 : 0.6 + color: "white" + opacity: FishUI.Theme.darkMode ? 0.3 : 0.4 visible: control.hovered && !control.selected } diff --git a/qml/FolderGridView.qml b/qml/FolderGridView.qml index dc7e5d1..92353fe 100644 --- a/qml/FolderGridView.qml +++ b/qml/FolderGridView.qml @@ -64,6 +64,8 @@ GridView { signal keyPress(var event) + cacheBuffer: Math.max(0, contentHeight) + onIconSizeChanged: { // 图标大小改变时需要重置状态,否则选中定位不准确 positioner.reset() diff --git a/qml/main.qml b/qml/main.qml index dc7d8a2..b01ccc8 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -34,8 +34,8 @@ FishUI.Window { visible: true title: qsTr("File Manager") - headerBarHeight: 35 + FishUI.Units.smallSpacing * 3 - backgroundColor: FishUI.Theme.darkMode ? "#262626" : "#F3F4F9" + header.height: 35 + FishUI.Units.smallSpacing * 3 + background.color: FishUI.Theme.darkMode ? "#262626" : "#F3F4F9" property QtObject settings: GlobalSettings { } @@ -51,7 +51,7 @@ FishUI.Window { id: optionsMenu } - headerBar: Item { + headerItem: Item { RowLayout { anchors.fill: parent anchors.leftMargin: FishUI.Units.smallSpacing * 1.5