From 2a4727c52223d65de10fabb238fe1ab2f0da8935 Mon Sep 17 00:00:00 2001 From: kateleet Date: Tue, 28 Dec 2021 15:41:45 +0800 Subject: [PATCH] fix: path history --- images/drive-harddisk-root.svg | 2 +- images/drive-harddisk.svg | 2 +- images/drive-optical.svg | 12 +++++------- images/drive-removable-media-usb.svg | 2 +- images/folder-desktop.svg | 2 +- images/folder-document.svg | 2 +- images/folder-download.svg | 2 +- images/folder-home.svg | 2 +- images/folder-music.svg | 4 ++-- images/folder-picture.svg | 2 +- images/folder-video.svg | 2 +- images/media-optical-data.svg | 2 +- images/media-optical-mixed-cd.svg | 10 ++++------ images/media-optical.svg | 4 ++-- images/user-trash.svg | 14 ++------------ model/foldermodel.cpp | 3 ++- qml/SideBar.qml | 5 ++--- 17 files changed, 29 insertions(+), 43 deletions(-) diff --git a/images/drive-harddisk-root.svg b/images/drive-harddisk-root.svg index de7840d..2489006 100755 --- a/images/drive-harddisk-root.svg +++ b/images/drive-harddisk-root.svg @@ -12,7 +12,7 @@ - + diff --git a/images/drive-harddisk.svg b/images/drive-harddisk.svg index de7840d..2489006 100755 --- a/images/drive-harddisk.svg +++ b/images/drive-harddisk.svg @@ -12,7 +12,7 @@ - + diff --git a/images/drive-optical.svg b/images/drive-optical.svg index 650781b..0a31fff 100755 --- a/images/drive-optical.svg +++ b/images/drive-optical.svg @@ -9,12 +9,10 @@ - - - - - - - + + + + + diff --git a/images/drive-removable-media-usb.svg b/images/drive-removable-media-usb.svg index 70af504..c5cc0ef 100755 --- a/images/drive-removable-media-usb.svg +++ b/images/drive-removable-media-usb.svg @@ -9,7 +9,7 @@ - + diff --git a/images/folder-desktop.svg b/images/folder-desktop.svg index 7eb3329..0009563 100755 --- a/images/folder-desktop.svg +++ b/images/folder-desktop.svg @@ -12,5 +12,5 @@ - + diff --git a/images/folder-document.svg b/images/folder-document.svg index 768b0a3..809cf9c 100755 --- a/images/folder-document.svg +++ b/images/folder-document.svg @@ -12,7 +12,7 @@ - + diff --git a/images/folder-download.svg b/images/folder-download.svg index 3244bd1..b7c8ae5 100755 --- a/images/folder-download.svg +++ b/images/folder-download.svg @@ -12,5 +12,5 @@ - + diff --git a/images/folder-home.svg b/images/folder-home.svg index 36b7b8a..88a7042 100755 --- a/images/folder-home.svg +++ b/images/folder-home.svg @@ -12,5 +12,5 @@ - + diff --git a/images/folder-music.svg b/images/folder-music.svg index 37de584..f2d0256 100755 --- a/images/folder-music.svg +++ b/images/folder-music.svg @@ -10,7 +10,7 @@ - + - + diff --git a/images/folder-picture.svg b/images/folder-picture.svg index a77bf34..9488b22 100755 --- a/images/folder-picture.svg +++ b/images/folder-picture.svg @@ -12,5 +12,5 @@ - + diff --git a/images/folder-video.svg b/images/folder-video.svg index ff6046f..283795c 100755 --- a/images/folder-video.svg +++ b/images/folder-video.svg @@ -12,5 +12,5 @@ - + diff --git a/images/media-optical-data.svg b/images/media-optical-data.svg index 55a16bd..f983c9b 100755 --- a/images/media-optical-data.svg +++ b/images/media-optical-data.svg @@ -4,7 +4,7 @@ + id="current-color-scheme"> .ColorScheme-Text { color:#363636; } diff --git a/images/media-optical-mixed-cd.svg b/images/media-optical-mixed-cd.svg index b822bc0..a3978bf 100755 --- a/images/media-optical-mixed-cd.svg +++ b/images/media-optical-mixed-cd.svg @@ -14,11 +14,9 @@ color:#363636; } - - - - - - + + + + diff --git a/images/media-optical.svg b/images/media-optical.svg index 391bf67..68ce9f0 100755 --- a/images/media-optical.svg +++ b/images/media-optical.svg @@ -12,6 +12,6 @@ - - + + diff --git a/images/user-trash.svg b/images/user-trash.svg index 0ca84a8..7b0c00a 100755 --- a/images/user-trash.svg +++ b/images/user-trash.svg @@ -1,16 +1,6 @@ - - - - - - image/svg+xml - - - - - + - + diff --git a/model/foldermodel.cpp b/model/foldermodel.cpp index 61b7218..d7187cc 100644 --- a/model/foldermodel.cpp +++ b/model/foldermodel.cpp @@ -414,7 +414,8 @@ void FolderModel::setUrl(const QString &url) setStatus(Status::Listing); - m_pathHistory.append(resolvedNewUrl); + if (m_pathHistory.isEmpty() || m_pathHistory.last() != resolvedNewUrl) + m_pathHistory.append(resolvedNewUrl); beginResetModel(); m_url = resolvedNewUrl.toString(QUrl::PreferLocalFile); diff --git a/qml/SideBar.qml b/qml/SideBar.qml index 0164413..c2c574d 100644 --- a/qml/SideBar.qml +++ b/qml/SideBar.qml @@ -204,9 +204,8 @@ ListView { smooth: false antialiasing: true - ColorOverlay { - anchors.fill: parent - source: parent + layer.enabled: true + layer.effect: ColorOverlay { color: checked ? FishUI.Theme.highlightColor : FishUI.Theme.textColor } }