From d091f6f9a2a2f3a4d7d5c3f14df3fab551fac94e Mon Sep 17 00:00:00 2001 From: reionwong Date: Fri, 22 Oct 2021 17:31:30 +0800 Subject: [PATCH] Add link symbol --- debian/changelog | 4 ++-- model/foldermodel.cpp | 4 ++++ model/foldermodel.h | 1 + qml/FolderGridItem.qml | 10 ++++++++++ qml/FolderListItem.qml | 10 ++++++++++ 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bc457a9..c520c1d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -cutefish-filemanager (0.5.1) UNRELEASED; urgency=high +cutefish-filemanager (0.5.1-2) UNRELEASED; urgency=high * Initial release (CutefishOS) - -- CutefishOS Packaging Team Sat, 09 Oct 2021 11:01:00 +0800 \ No newline at end of file + -- CutefishOS Packaging Team Fri, 15 Oct 2021 22:53:38 +0800 \ No newline at end of file diff --git a/model/foldermodel.cpp b/model/foldermodel.cpp index d6501b4..e237afd 100644 --- a/model/foldermodel.cpp +++ b/model/foldermodel.cpp @@ -152,6 +152,7 @@ QHash FolderModel::staticRoleNames() roleNames[SelectedRole] = "selected"; roleNames[IsDirRole] = "isDir"; roleNames[IsHiddenRole] = "isHidden"; + roleNames[IsLinkRole] = "isLink"; roleNames[UrlRole] = "url"; roleNames[DisplayNameRole] = "displayName"; roleNames[FileNameRole] = "fileName"; @@ -195,6 +196,9 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const case IsHiddenRole: { return item.isHidden(); } + case IsLinkRole: { + return item.isLink(); + } case FileSizeRole: { if (item.isDir()) { QDir dir(item.url().toLocalFile()); diff --git a/model/foldermodel.h b/model/foldermodel.h index 1fae7d5..e40e236 100644 --- a/model/foldermodel.h +++ b/model/foldermodel.h @@ -67,6 +67,7 @@ public: SelectedRole, IsDirRole, IsHiddenRole, + IsLinkRole, UrlRole, DisplayNameRole, FileNameRole, diff --git a/qml/FolderGridItem.qml b/qml/FolderGridItem.qml index fae1b5a..473d792 100644 --- a/qml/FolderGridItem.qml +++ b/qml/FolderGridItem.qml @@ -166,6 +166,16 @@ Item { } } + Image { + anchors.right: _icon.visible ? _icon.right : _image.right + anchors.bottom: _icon.visible ? _icon.bottom : _image.bottom + source: "image://icontheme/emblem-symbolic-link" + width: 16 + height: 16 + visible: model.isLink + sourceSize: Qt.size(width, height) + } + // ColorOverlay { // id: _selectedColorOverlay // anchors.fill: _image.visible ? _image : _icon diff --git a/qml/FolderListItem.qml b/qml/FolderListItem.qml index bc62534..ee769a3 100644 --- a/qml/FolderListItem.qml +++ b/qml/FolderListItem.qml @@ -116,6 +116,16 @@ Item { } } } + + Image { + anchors.right: _icon.visible ? _icon.right : _image.right + anchors.bottom: _icon.visible ? _icon.bottom : _image.bottom + source: "image://icontheme/emblem-symbolic-link" + width: 16 + height: 16 + visible: model.isLink + sourceSize: Qt.size(width, height) + } } ColumnLayout {