Discussion:
D16019: Added missing 'visibility' icons to panel places items
Alex Debus
2018-10-07 15:51:33 UTC
Permalink
alexde created this revision.
alexde added a reviewer: VDG.
Herald added a project: Dolphin.
Herald added a subscriber: kfm-devel.
alexde requested review of this revision.

REPOSITORY
R318 Dolphin

REVISION DETAIL
https://phabricator.kde.org/D16019

AFFECTED FILES
src/panels/places/placespanel.cpp

To: alexde, #vdg
Cc: kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Alex Debus
2018-10-07 16:29:32 UTC
Permalink
alexde updated this revision to Diff 43055.
alexde added a comment.


Changed the icon from "visibility" to "hint" as it describes the action better. Also added another missing icon to "Show all entries".

CHANGES SINCE LAST UPDATE
https://phabricator.kde.org/D16019?vs=43052&id=43055

REVISION DETAIL
https://phabricator.kde.org/D16019

AFFECTED FILES
src/panels/places/placespanel.cpp

To: alexde, #vdg
Cc: kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Alex Debus
2018-10-07 16:30:18 UTC
Permalink
alexde retitled this revision from "Added missing 'visibility' icons to panel places items" to "Added missing icons to panel places items".

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg
Cc: kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Andrew Crouthamel
2018-10-07 16:32:39 UTC
Permalink
acrouthamel added a comment.


Could you add some screenshots?

Also, it may not be best to choose a Breeze icon based on look, rather than name. Other icon themes may use something entirely different for hint.

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg
Cc: acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Alex Debus
2018-10-07 16:39:59 UTC
Permalink
alexde added a comment.
Post by Andrew Crouthamel
Could you add some screenshots?
F6310217: Screenshot_20181007_183515.png <https://phabricator.kde.org/F6310217> F6310218: Screenshot_20181007_183441.png <https://phabricator.kde.org/F6310218>
Post by Andrew Crouthamel
Also, it may not be best to choose a Breeze icon based on look, rather than name. Other icon themes may use something entirely different for hint.
Maby you can help me with that, as I am not sure how to do that. :-)

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg
Cc: acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Alex Debus
2018-10-07 19:02:51 UTC
Permalink
alexde edited the summary of this revision.

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg
Cc: acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Alex Debus
2018-10-07 19:05:27 UTC
Permalink
alexde edited the summary of this revision.

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg
Cc: acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Nathaniel Graham
2018-10-07 20:32:27 UTC
Permalink
ngraham accepted this revision.
ngraham added a comment.
This revision is now accepted and ready to land.
Post by Andrew Crouthamel
Also, it may not be best to choose a Breeze icon based on look, rather than name. Other icon themes may use something entirely different for hint.
For the moment this is probably the best we can do. Dolphin uses the same `visibility`/`hint` switcheroo for the Hidden Files action which I agree is not ideal. I've been mildly irritated by this myself when browsing the code, but never enough to do anything about it. I just tried submitting a patch to change it (D16028 <https://phabricator.kde.org/D16028>) but ran into `arc` problems and gave up.

For now, please stay with `visibility` and `hint`, this is fine.

Typically it's not ideal to use the same icon for two different adjacent things, but I think it's fine for now, and better than no icon.

This looks good! But there's one more thing...

Dolphin currently does not use the KIO code for parts of its places panel, so this change needs to be replicated for the KIO code so that Places panels in the open/save dialogs and Gwenview (etc.) get the change too. Can you submit a patch for KIO too? The code is in `<kio repo>/src/panels/places/placespanel.cpp` Thanks! Once you submit that patch and both are accepted, we can land them both.

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg, ngraham
Cc: ngraham, acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Andrew Crouthamel
2018-10-07 23:56:56 UTC
Permalink
acrouthamel added a comment.


Fair enough, just something that I noticed after dealing with some of that with Gwenview.

Thanks for contributing @alexde!

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg, ngraham
Cc: ngraham, acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Shubham
2018-10-08 03:21:39 UTC
Permalink
shubham set the repository for this revision to R318 Dolphin.

REPOSITORY
R318 Dolphin

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg, ngraham
Cc: ngraham, acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Shubham
2018-10-08 03:28:02 UTC
Permalink
shubham added a comment.


There is too much duplication in dolphin, which should't be there ideally. Dont know why?

REPOSITORY
R318 Dolphin

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg, ngraham
Cc: shubham, ngraham, acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Nathaniel Graham
2018-10-08 04:07:25 UTC
Permalink
ngraham added a comment.
There is too much duplication in dolphin, which should't be there ideally. Why dolphin cant use the same copy from KIO , instead of its seperate copy?
Because this hasn't been done yet: T9795: Use Places Panel code from KIO instead of private implementation <https://phabricator.kde.org/T9795>

REPOSITORY
R318 Dolphin

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg, ngraham
Cc: shubham, ngraham, acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Alex Debus
2018-10-08 13:07:40 UTC
Permalink
alexde added a comment.
Post by Nathaniel Graham
Dolphin currently does not use the KIO code for parts of its places panel, so this change needs to be replicated for the KIO code so that Places panels in the open/save dialogs and Gwenview (etc.) get the change too. Can you submit a patch for KIO too? The code is in `<kio repo>/src/panels/places/placespanel.cpp` Thanks! Once you submit that patch and both are accepted, we can land them both.
Are you sure about the path and file? I could not find it in the kio repository <https://github.com/KDE/kio/tree/master/src>. However, I found another cpp file which looked promising: <kio repo>/src/filewidgets/kfileplacesview.cpp <https://github.com/KDE/kio/blob/master/src/filewidgets/kfileplacesview.cpp>.

There I would propose the following change:

diff --git a/src/filewidgets/kfileplacesview.cpp b/src/filewidgets/kfileplacesview.cpp
index eb41c6ae..b10eef70 100644
--- a/src/filewidgets/kfileplacesview.cpp
+++ b/src/filewidgets/kfileplacesview.cpp
@@ -742,7 +742,7 @@ void KFilePlacesView::contextMenuEvent(QContextMenuEvent *event)
const bool clickOverHeader = delegate->pointIsHeaderArea(event->pos());
if (clickOverHeader) {
const KFilePlacesModel::GroupType type = placesModel->groupType(index);
- hideSection = menu.addAction(i18n("Hide Section"));
+ hideSection = menu.addAction(QIcon::fromTheme(QStringLiteral("hint")), i18n("Hide Section"));
hideSection->setCheckable(true);
hideSection->setChecked(placesModel->isGroupHidden(type));
}
@@ -778,7 +778,7 @@ void KFilePlacesView::contextMenuEvent(QContextMenuEvent *event)
add = menu.addAction(QIcon::fromTheme(QStringLiteral("document-new")), i18n("Add Entry..."));
}

- hide = menu.addAction(i18n("&Hide Entry '%1'", label));
+ hide = menu.addAction(QIcon::fromTheme(QStringLiteral("hint")), i18n("&Hide Entry '%1'", label));
hide->setCheckable(true);
hide->setChecked(placesModel->isHidden(index));
// if a parent is hidden no interaction should be possible with children, show it first to do so
@@ -790,7 +790,7 @@ void KFilePlacesView::contextMenuEvent(QContextMenuEvent *event)

QAction *showAll = nullptr;
if (placesModel->hiddenCount() > 0) {
- showAll = new QAction(i18n("&Show All Entries"), &menu);
+ showAll = new QAction(QIcon::fromTheme(QStringLiteral("visibility")), i18n("&Show All Entries"), &menu);
showAll->setCheckable(true);
showAll->setChecked(d->showAll);
if (mainSeparator == nullptr) {



---------

Furthermore, I found that at some places in the Dolphin source code QStringLiteral is inconsistently used, for instance:

<dolphin repo>/src/panels/places/placespanel.cpp#L211 <https://github.com/KDE/dolphin/blob/master/src/panels/places/placespanel.cpp#L211>

editAction = menu.addAction(QIcon::fromTheme("edit-entry"), i18nc("@item:inmenu", "Edit..."));

and
<dolphin repo>/src/panels/places/placespanel.cpp#L216 <https://github.com/KDE/dolphin/blob/master/src/panels/places/placespanel.cpp#L216>

removeAction = menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("@item:inmenu", "Remove"));

Which version is correct / preferred in which cases?

REPOSITORY
R318 Dolphin

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg, ngraham
Cc: ngraham, acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Nathaniel Graham
2018-10-08 17:33:50 UTC
Permalink
ngraham added a comment.


Argh, you are correct! I gave you the wrong path, sorry.

Using `QStringLiteral("icon-name")` is correct and it should be done everywhere. In places where this is not done, we should fix that. Good material for the next patch, perhaps? :)

REPOSITORY
R318 Dolphin

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg, ngraham
Cc: ngraham, acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Nathaniel Graham
2018-10-09 21:28:41 UTC
Permalink
ngraham closed this revision.

REPOSITORY
R318 Dolphin

REVISION DETAIL
https://phabricator.kde.org/D16019

To: alexde, #vdg, ngraham
Cc: ngraham, acrouthamel, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
Loading...