Add link symbol

This commit is contained in:
reionwong 2021-10-22 17:31:30 +08:00
parent 48934e1533
commit d091f6f9a2
5 changed files with 27 additions and 2 deletions

4
debian/changelog vendored
View file

@ -1,5 +1,5 @@
cutefish-filemanager (0.5.1) UNRELEASED; urgency=high
cutefish-filemanager (0.5.1-2) UNRELEASED; urgency=high
* Initial release (CutefishOS) <support@cutefishos.com>
-- CutefishOS Packaging Team <support@cutefishos.com> Sat, 09 Oct 2021 11:01:00 +0800
-- CutefishOS Packaging Team <support@cutefishos.com> Fri, 15 Oct 2021 22:53:38 +0800

View file

@ -152,6 +152,7 @@ QHash<int, QByteArray> 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());

View file

@ -67,6 +67,7 @@ public:
SelectedRole,
IsDirRole,
IsHiddenRole,
IsLinkRole,
UrlRole,
DisplayNameRole,
FileNameRole,

View file

@ -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

View file

@ -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 {