Bug 361097 - impossible rename file with long filename in desktop (with folder view)
Summary: impossible rename file with long filename in desktop (with folder view)
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Folder (show other bugs)
Version: 5.6.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-28 16:22 UTC by painless roaster
Modified: 2018-03-16 09:07 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
FolderView rename patch (2.43 KB, patch)
2016-05-16 14:03 UTC, painless roaster
Details
FolderView rename patch - version 2 (3.30 KB, patch)
2016-05-18 05:49 UTC, painless roaster
Details
FolderView rename patch - version 3 (3.26 KB, patch)
2016-05-18 06:14 UTC, painless roaster
Details
FolderView rename patch - version 4 (3.69 KB, patch)
2016-05-19 06:16 UTC, painless roaster
Details
Attachments FolderView rename patch - version 5 (3.97 KB, patch)
2016-05-20 14:00 UTC, painless roaster
Details
FolderView rename patch - version 5 (4.31 KB, patch)
2016-05-20 14:25 UTC, painless roaster
Details
FolderView rename patch - version 5 (4.30 KB, patch)
2016-05-20 15:08 UTC, painless roaster
Details
FolderView rename patch - version 5 (4.24 KB, patch)
2016-05-20 15:09 UTC, painless roaster
Details
desktop record - current state - before patch (1.90 MB, video/ogg)
2016-05-26 17:12 UTC, painless roaster
Details
desktop record - patched state - after patch (1.07 MB, video/ogg)
2016-05-26 17:13 UTC, painless roaster
Details
FolderView rename patch - version 6 (5.09 KB, patch)
2016-05-27 11:46 UTC, painless roaster
Details
FolderView rename patch - version 7 (4.43 KB, patch)
2016-05-28 16:06 UTC, painless roaster
Details
FolderView rename patch - version 8 (6.35 KB, patch)
2016-06-05 08:48 UTC, painless roaster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description painless roaster 2016-03-28 16:22:30 UTC
show long filename as singleline editbox in rename operation
loss old text if i click at end of text

Reproducible: Always

Steps to Reproduce:
bug 1 - show singleline editbox

1. create file long filename ('aaaa bbbb cccc dddd eeee ffff gggg hhhh')
http://jx.dts-soft.cz/kde/rename/rename-01.png
2. enter to rename file (show stupid singleline editbox - in dolphin show comfortable multiline editbox)
http://jx.dts-soft.cz/kde/rename/rename-02.png

bug 2 - impossible mouse click at end of filename

1. create file long filename ('aaaa bbbb cccc dddd eeee ffff gggg hhhh')
http://jx.dts-soft.cz/kde/rename/rename-01.png
2. enter to rename file
http://jx.dts-soft.cz/kde/rename/rename-02.png
3. click on end of filename (loss old filename)
http://jx.dts-soft.cz/kde/rename/rename-03.png

Actual Results:  
show singleline editbox for long filename
impossible mouse operation in editbox - loss old filename

Expected Results:  
show multiline editbox for long filename (as in dolphin - http://jx.dts-soft.cz/kde/rename/rename-dolphin.png)
possible mouse operation in editbox

File operations on desktop must work!
In older versions was not a problem!
Comment 1 painless roaster 2016-03-29 07:58:28 UTC
File operations in the operating system are very important. Please leave a high priority for this bug.
Give the task to novice user to rename file with long filename. He immediately says 'linux does not work'.
Comment 2 Eike Hein 2016-03-29 08:58:29 UTC
Please leave managing bug metadata to those who make use of that metadata. We understand the bug is important to you (this is true of basically everyone who reports a bug).
Comment 3 painless roaster 2016-05-16 14:03:47 UTC
Created attachment 99021 [details]
FolderView rename patch
Comment 4 painless roaster 2016-05-16 14:06:45 UTC
Try patch in attachment, please. I use TextArea instead of TextField.
This patch resolve issues:
 - multiline edit (rename) long filename
 - correct size of edit box
 - escape from edit box if pressed Esc
Comment 5 Eike Hein 2016-05-17 09:20:51 UTC
Promising patch, but there's a few things I don't like about it:
- With short filenames that fit the icon delegate without eliding, the filename often ends up being wrapped in the field anyway, because it's too small and then the scrollbar eats space
- The document margins in TextArea seem to be different, causing the text to move down and to the right a bit when going from the label to edit mode

Would be cool if you could iterate on it a bit more and resubmit.
Comment 6 painless roaster 2016-05-18 05:49:24 UTC
Created attachment 99044 [details]
FolderView rename patch - version 2
Comment 7 painless roaster 2016-05-18 05:52:27 UTC
Try next patch in attachment, please.
This patch resolve issues:
 - dynamic resize of height (only if need add height)
 - initial size
Comment 8 painless roaster 2016-05-18 06:14:41 UTC
Created attachment 99045 [details]
FolderView rename patch - version 3
Comment 9 painless roaster 2016-05-19 06:16:50 UTC
Created attachment 99066 [details]
FolderView rename patch - version 4
Comment 10 painless roaster 2016-05-19 06:19:31 UTC
next verion of patch resolve issues:
 - padding size in textarea
 - dynamic add width if need vertical scroller
 - set size and position by label
Comment 11 painless roaster 2016-05-20 14:00:34 UTC
Created attachment 99094 [details]
Attachments FolderView rename patch - version 5
Comment 12 painless roaster 2016-05-20 14:00:59 UTC
Last patch fixes issue:
 - open file (or folder) if click in textarea.
Comment 13 painless roaster 2016-05-20 14:01:45 UTC
My FolderView patch is finally completed.
Please review it.
Comment 14 Eike Hein 2016-05-20 14:02:49 UTC
Thanks, I'll probably review it after the weekend unless I can get around to it later/tomorrow.
Comment 15 Eike Hein 2016-05-20 14:04:44 UTC
Just taking a quick look at it: I see hard-coded numbers like 12 and 28, which is probably wrong (do they work with different font sizes and themes?). If they're right they need code comments explaining why.
Comment 16 painless roaster 2016-05-20 14:25:32 UTC
Created attachment 99096 [details]
FolderView rename patch - version 5
Comment 17 painless roaster 2016-05-20 14:30:57 UTC
Now patch contain comment of numerical constants. If you known variables or constants for these dimensions, please replace it.
I tested these values for all sizes of icons in breeze theme. Editing looks very good for short and long multilines filenames.
Comment 18 Eike Hein 2016-05-20 14:49:40 UTC
What for themes other than Breeze? And for other font sizes?
Comment 19 painless roaster 2016-05-20 14:59:18 UTC
Oxygen OK, Fusion OK.
Font size 8 - 12 OK.
Comment 20 painless roaster 2016-05-20 15:08:32 UTC
Created attachment 99099 [details]
FolderView rename patch - version 5

optimize use of numerical contants
Comment 21 painless roaster 2016-05-20 15:09:48 UTC
Created attachment 99100 [details]
FolderView rename patch - version 5

fix header of patch
Comment 22 painless roaster 2016-05-26 17:12:52 UTC
Created attachment 99203 [details]
desktop record - current state - before patch
Comment 23 painless roaster 2016-05-26 17:13:27 UTC
Created attachment 99204 [details]
desktop record - patched state - after patch
Comment 24 painless roaster 2016-05-26 17:18:46 UTC
Hi. Any news about this ticket? I created a video with current and patched state. Current state is horrible.

Tip for quick apply patch:
# cd /usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui
# patch < FolderView_05.patch
# killall plasmashell; plasmashell &
Comment 25 Eike Hein 2016-05-26 20:11:55 UTC
Sorry, I haven't had time to deal with it yet due to being very busy with rewriting the Task Manager. I know the patch in its currenty form will be unacceptable because it contains magic values, which isn't ok - it will likely break with different themes or system settings. Hard-coding pixel measurements in that fashion is not OK code. But I want to tell you how to fix it and for that I need to find some time.
Comment 26 painless roaster 2016-05-27 11:46:27 UTC
Created attachment 99214 [details]
FolderView rename patch - version 6
Comment 27 painless roaster 2016-05-27 11:51:48 UTC
Hi, magic numbers are now removed. Now is exactly the same editing position and the position of the label.
It is now acceptable?
Comment 28 Eike Hein 2016-05-27 16:18:18 UTC
There still seem to be some magic numbers like the two 60s, and I don't like the hacky approach to getting the scrollbar width ...
Comment 29 painless roaster 2016-05-27 16:41:33 UTC
I do not like a few months broken operating system. :-)
Please know of ways to identify width scroller in textarea?
Comment 30 Anthony Fieroni 2016-05-28 14:26:04 UTC
Patch looks good, but when you write qml keep in your mind it is different from C++. You can make
visible: targetItem != null
setted targetItem to null will set automatically visible to false :) So it's not needed to initialize properties to -1, just add exactly what you want like a logic and it will work
property int maxHeight: theme.mSize(theme.defaultFont).height * (plasmoid.configuration.textLines + 1)
Do not set width and hieght to 60 and do not get difference between Qt.ScrollBarAlwaysOn - Qt.ScrollBarAlwaysOff, this is make it by Qt. So patch can be twice a small and more compact. You can add to review here -> https://git.reviewboard.kde.org/r/
Comment 31 painless roaster 2016-05-28 16:06:26 UTC
Created attachment 99230 [details]
FolderView rename patch - version 7
Comment 32 painless roaster 2016-05-28 16:07:05 UTC
Thank you for review. Manual handling with ScrollBarAlwaysOn/Off is solution for add width if need vertical scroller. It provides persistent text wrapping.

Please try the new version of patch.
I removed redundant code, magic constants and hack.
Comment 33 painless roaster 2016-06-05 08:48:11 UTC
Created attachment 99379 [details]
FolderView rename patch - version 8

fix popup mode (position and size)
Comment 34 painless roaster 2016-06-08 10:10:26 UTC
Eike Hein:

You can review last version of patch? Now it might already be complete. I hope. :-)
Comment 35 Alexander Mentyu 2017-12-13 09:35:16 UTC
renaming long file names on desktop: ok
multiline edit box: ok
click on the end of file name: ok


Distribution: KDE neon Developer Edition - Unstable Branches
Plasma: 5.11.90
Frameworks: 5.42.0
Qt: 5.9.3
Kernel 4.10.0-42-generic


Netrunner Rolling
Plasma: 5.11.4
Apps: 17.08.3
Frameworks: 5.40.0
Qt: 5.9.3
Kernel: 4.14.3-1-MANJARO
Comment 36 Nate Graham 2018-03-15 17:41:36 UTC
Works fine for me too in Plasma 5.12.3 and git master. Either the patch was committed, or the issue was resolved in another capacity. Painlessroaster, please re-open the bug if you can reproduce this in Plasma 5.12.3.
Comment 37 Eike Hein 2018-03-16 09:07:29 UTC
It was committed after 5.12.3 fwiw (yesterday).