!7 Adjust desktop readonly icon agree with icon view

From: @dou33
Reviewed-by: @tanyulong2021
Signed-off-by: @tanyulong2021
This commit is contained in:
openeuler-ci-bot 2021-10-26 08:09:59 +00:00 committed by Gitee
commit 4c977bed36
2 changed files with 77 additions and 1 deletions

View File

@ -0,0 +1,70 @@
diff -Naur peony-3.0.4/libpeony-qt/controls/menu/directory-view-menu/directory-view-menu.cpp peony-3.0.4~/libpeony-qt/controls/menu/directory-view-menu/directory-view-menu.cpp
--- peony-3.0.4/libpeony-qt/controls/menu/directory-view-menu/directory-view-menu.cpp 2020-11-03 09:02:05.000000000 +0800
+++ peony-3.0.4~/libpeony-qt/controls/menu/directory-view-menu/directory-view-menu.cpp 2021-10-26 14:11:07.134058887 +0800
@@ -616,26 +616,22 @@
if (m_selections.count() >1 && m_is_trash)
return l;
- if (!m_is_search) {
- if (m_is_trash && m_selections.count() != 1){
-
- }else{
- l<<addAction(QIcon::fromTheme("preview-file"), tr("Properties"));
- connect(l.last(), &QAction::triggered, [=]() {
- //FIXME:
- if (m_selections.isEmpty()) {
- QStringList uris;
- uris<<m_directory;
- PropertiesWindow *p = new PropertiesWindow(uris);
- p->setAttribute(Qt::WA_DeleteOnClose);
- p->show();
- } else {
- PropertiesWindow *p = new PropertiesWindow(m_selections);
- p->setAttribute(Qt::WA_DeleteOnClose);
- p->show();
- }
- });
- }
+ if (! m_is_search) {
+ l<<addAction(QIcon::fromTheme("preview-file"), tr("Properties"));
+ connect(l.last(), &QAction::triggered, [=]() {
+ //FIXME:
+ if (m_selections.isEmpty()) {
+ QStringList uris;
+ uris<<m_directory;
+ PropertiesWindow *p = new PropertiesWindow(uris);
+ p->setAttribute(Qt::WA_DeleteOnClose);
+ p->show();
+ } else {
+ PropertiesWindow *p = new PropertiesWindow(m_selections);
+ p->setAttribute(Qt::WA_DeleteOnClose);
+ p->show();
+ }
+ });
} else if (m_selections.count() == 1) {
l<<addAction(QIcon::fromTheme("preview-file"), tr("Properties"));
connect(l.last(), &QAction::triggered, [=]() {
diff -Naur peony-3.0.4/peony-qt-desktop/desktop-icon-view-delegate.cpp peony-3.0.4~/peony-qt-desktop/desktop-icon-view-delegate.cpp
--- peony-3.0.4/peony-qt-desktop/desktop-icon-view-delegate.cpp 2020-11-03 09:02:05.000000000 +0800
+++ peony-3.0.4~/peony-qt-desktop/desktop-icon-view-delegate.cpp 2021-10-26 14:11:45.075056788 +0800
@@ -197,13 +197,16 @@
topRight.setY(topRight.y() + 10);
auto linkRect = QRect(topRight, lockerIconSize);
- if (file->canRead() && !file->canWrite() && !file->canExecute()) {
- QIcon symbolicLinkIcon = QIcon::fromTheme("emblem-readonly");
- symbolicLinkIcon.paint(painter, linkRect, Qt::AlignCenter);
- } else if (!file->canRead() && !file->canWrite() && !file->canExecute()) {
+ if (! file->canRead())
+ {
QIcon symbolicLinkIcon = QIcon::fromTheme("emblem-unreadable");
symbolicLinkIcon.paint(painter, linkRect, Qt::AlignCenter);
}
+ else if(! file->canWrite() && ! file->canExecute())
+ {
+ QIcon symbolicLinkIcon = QIcon::fromTheme("emblem-readonly");
+ symbolicLinkIcon.paint(painter, linkRect, Qt::AlignCenter);
+ }
}
if (index.data(Qt::UserRole + 1).toBool()) {

View File

@ -2,7 +2,7 @@
Name: peony
Version: 3.0.4
Release: 1
Release: 2
Summary: file Manager for the UKUI desktop
License: GPL-2.0+ GPL-3.0+ Expat LGPL-3.0+
URL: http://www.ukui.org
@ -17,6 +17,7 @@ Requires: peony-common, libpeony3
Requires: gvfs
patch0: 001-fix-excute-file.patch
patch1: 0001-adjust-desktop-readonly-icon-agree-with-icon-view.patch
%description
Peony is the official file manager for the UKUI desktop. It allows one
@ -73,6 +74,7 @@ Provides: libpeony
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%build
qmake-qt5
@ -122,7 +124,11 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/%{_lib}/pkgconfig/*.pc
%{_prefix}/%{_lib}/*.so
%changelog
* Tue Oct 26 2021 douyan <douyan@kylinos.cn> - 3.0.4-2
- add patch:0001-adjust-desktop-readonly-icon-agree-with-icon-view.patch
* Mon Oct 26 2020 douyan <douyan@kylinos.cn> - 3.0.4-1
- update to upstream version 3.0.4