Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubber-band selection is missing from Compact/Detailed views #521

Closed
agaida opened this issue Jul 2, 2017 · 18 comments
Closed

Rubber-band selection is missing from Compact/Detailed views #521

agaida opened this issue Jul 2, 2017 · 18 comments

Comments

@agaida
Copy link
Member

agaida commented Jul 2, 2017

that is not part of the displayed row.

Reason: try to mark some files in detailed view with mouse only :)

@tsujan
Copy link
Member

tsujan commented Jul 2, 2017

I don't get it. This is the detailed list view and it seems OK to me:

dlv

@agaida
Copy link
Member Author

agaida commented Jul 2, 2017

maybe a video helps https://youtu.be/Gfdv0rgrjrg

@tsujan
Copy link
Member

tsujan commented Jul 2, 2017

Got it but it doesn't seem to me as a problem because although the selection can't be done in that way in the detailed view, SHIFT and CTRL can be used without problem. On the other hand, IMO, adding an empty space to the right or left (if possible at all) would give the detailed view a weird and unprofessional look.

@tsujan
Copy link
Member

tsujan commented Jul 2, 2017

Anyhow, my opinion isn't important in this case because I never use the detailed list view ;)

@agaida
Copy link
Member Author

agaida commented Jul 2, 2017

empty_space

Thinking about something like that

@agaida agaida added the later label Jul 2, 2017
@agaida
Copy link
Member Author

agaida commented Jul 2, 2017

and i didn't see it as a bug and top priority - but when one has an idea to implement it and there is nothing important to do left - why not, a little bit polishing wouldn't hurt. To be honest, it was a bug in the debian tracker - and i closed because of the points you mentioned. a) it is possible b) the implementation is not so lucky (aka horrible) at this point. But there is no bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853201

@tsujan
Copy link
Member

tsujan commented Jul 2, 2017

Dolphin does it with small spaces above and below each item but those spaces aren't easy to use at all -- SHIFT is easier.

I'll think about it but no promise, because there are lots of things more important than this.

BTW, this kind of selection can be called "selection with rubber-band" (rubber-band = that translucent, resizable rectangle).

@tsujan tsujan changed the title detailed list should have some space left at the right side Make rubber-band selection easier in Detailed List view (by adding a space) Jul 3, 2017
@tsujan
Copy link
Member

tsujan commented Apr 16, 2018

@agaida

With a simple change, it's quite possible to let the user do as in the following screenshot whenever he/she wants to select items (there's an optional space on the right, as you suggested):

screengrab-20180416-235109

But, unfortunately, the selection behavior will be erratic and, I think, that's because of a Qt bug. Theoretically, it should be possible to fix the problem in our subclass but how much work would be required, I still have no idea.

@agaida
Copy link
Member Author

agaida commented Apr 17, 2018

its a start :)

@tsujan
Copy link
Member

tsujan commented Apr 17, 2018

Important note:

Actually, this is more than a simple feature request and reveals a deeper problem: We have no rubber-band selection (= the rectangle that's created by pressing the left mouse button and moving the cursor) in compact and detailed list views. Dolphin has them everywhere.

@tsujan tsujan changed the title Make rubber-band selection easier in Detailed List view (by adding a space) Rubber-band selection is missing from Compact/Detailed views Apr 17, 2018
@lxqt lxqt deleted a comment from fulalas Jan 31, 2019
@tsujan
Copy link
Member

tsujan commented Jan 31, 2019

Now that the problem of column customization is solved, back to this:

The compact view does it without needing a rubber-band (although a rubber-band would be nicer with the compact view). So, the problem is either in Qt's tree view or in ours -- other views are list views (QListView). This old bug report exists: https://bugreports.qt.io/browse/QTBUG-3042 (with the Out-of-scope "resolution" -- weird term) . But it doesn't mean that we couldn't have a rubber-band. It needs more investigation.

@tsujan
Copy link
Member

tsujan commented Feb 1, 2019

Update:

It seems possible. This is with a very inefficient fast-food code:

selection

When I'll find time to change this proof-of-concept to a usable code, I don't know.

@tsujan
Copy link
Member

tsujan commented Feb 2, 2019

@agaida Because you opened this:

I succeeded in implementing an effective rubberband selection. But:

(1) The code is somehow complex but not big (actually, it's relatively small). It couldn't be made simpler. The reason was that Qt didn't support that kind of selection for this kind of view and so, I had to enforce it (an entertaining challenge; nothing more).

(2) Even if it goes into the official source, there will be a problem. Adding a right margin to the detailed list view would make it ugly and untidy. Still, with previous PR's, the user could choose custom column resizing and add a right margin easily. So, rubberband selection will be limited to the latter case.

Now, my question: Is it good to add it?

@tsujan
Copy link
Member

tsujan commented Feb 24, 2019

Answering my own question:

The rubber-band selection can be added to the detailed list view because it's cool, its code is adapted from Qt itself, and it's limited to specific functions dealing with mouse events, so that it could be removed easily if it's implemented in Qt > 5.

tsujan added a commit to lxqt/libfm-qt that referenced this issue Feb 24, 2019
Closes lxqt/pcmanfm-qt#521

The code is adapted from Qt source -> "qabstractitemview.cpp".

NOTE: The rubber-band selection can be used more comfortably when columns are not auto-resized.
@agaida
Copy link
Member Author

agaida commented Feb 24, 2019

Cool - but a bit nitpicking - what if we leave a right margin with auto-resize?

@tsujan
Copy link
Member

tsujan commented Feb 24, 2019

It would be ugly. Contrary to appearances, the problem wasn't about that margin but the lack of rubber-band selection with tree-views (yes, contrary to appearances again, the detailed list is a tree-view). But I'll think about it later.

Now we have a nice rubber-band where others don't; one problem at a time ;)

@agaida
Copy link
Member Author

agaida commented Feb 24, 2019

as i said - nitpicking :P

agaida pushed a commit to lxqt/libfm-qt that referenced this issue Feb 24, 2019
Closes lxqt/pcmanfm-qt#521

The code is adapted from Qt source -> "qabstractitemview.cpp".

NOTE: The rubber-band selection can be used more comfortably when columns are not auto-resized.
@tsujan
Copy link
Member

tsujan commented Feb 24, 2019

as i said - nitpicking :P

It's really a design problem to solve. A right margin or a configurable space between rows. It might not be easy to implement but should be investigated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants