Felix Ernst [Sat, 27 Aug 2022 09:40:51 +0000 (09:40 +0000)]
This commit removes the ability to enter selection mode by
click-and-holding with a pointing device like a mouse.
This functionality was originally implemented because it seemed
useful to save users the effort of entering selection mode
explicitly by using its corresponding action.
However, click-and-holding to trigger anything is not really an
expected behaviour. (This contrasts with touch devices where
press-and-holding is common to trigger something.)
Aside from the above reasoning, the click-and-hold behaviour was
also buggy so that selection mode was entered in a couple of
situations that weren't strictly about click-and-holding.
So this commit removes the functionality and the bugs.
Kai Uwe Broulik [Wed, 24 Aug 2022 15:00:01 +0000 (17:00 +0200)]
Don't show error message on ERR_USER_CANCELED
There's no point telling the user what they just did.
After https://invent.kde.org/frameworks/kio/-/commit/f192c133eb01bc8448d5ddd97fe20f8e6dbc467d
this error has a text associated with it, so it might
show up in the UI.
Felix Ernst [Thu, 9 Jun 2022 21:23:29 +0000 (23:23 +0200)]
Clean up code that became redundant through framework changes
There were two changes in framework that triggered this commit:
KHamburgerMenu and KToolTipHelper.
When the Dolphin-specific hamburger menu was replaced by
KHamburgerMenu, I didn't clean everything up correctly. Not
anymore!
Help texts also weren't updated accordingly. This commit replaces
any mention of the old hamburger menu which was called "Control"
with text that reflects the current application state.
The other framework change "KToolTipHelper" takes responsibility
for opening links in help texts. So we won't need code to do this
in Dolphin anymore. This means we can also get rid of some
duplicate help texts which only existed because links didn't work
correctly in some places.
Kai Uwe Broulik [Mon, 15 Aug 2022 13:02:13 +0000 (15:02 +0200)]
Don't include `iconOverlays` in rolesData if it is empty
If this role isn't in the model yet, it would be `QVariant::Invalid`
which is obviously a distinct type from an empty string list.
This means `KFileItemModel::setData` treats them non-equal and
potentially does expensive operations on the model, which is
called every time a role is resolved in `KFileItemModelRolesUpdater`.
With this change, the number of pointless layout calculations is
significantly reduced.
Felix Ernst [Wed, 8 Jun 2022 12:23:32 +0000 (14:23 +0200)]
Add "Invert Selection" and "Select All" to bottom bar
In selection mode, a bottom bar with contextual actions appears
when at least one item is selected. This commit makes it so this
bottom bar also contains the "Invert Selection" and "Select All"
actions so users have more complete control over changing what is
and isn't selected while in selection mode.
Felix Ernst [Mon, 16 May 2022 13:53:18 +0000 (15:53 +0200)]
Address Nate's UX feedback: Episode 2
- Make Esc leave selection mode and have it only clear selection
when already outside selection mode.
- Let translators know that the "More" overflow button should only
have a short text on it.
- Fix a crash that happened when any code tried to exit selection
mode even though selection mode had never been enabled to begin
with.
Felix Ernst [Sun, 24 Apr 2022 00:34:43 +0000 (02:34 +0200)]
Keep working towards a reviewable state
- Various code improvements
- Smoother animations
- The bottom bar in General Mode only becomes visible if items are
currently selected
- Removed the selection mode action from the default toolbar since
it can already be toggled in various ways
- More documentation
- Some cleaning
Felix Ernst [Sun, 12 Sep 2021 13:33:39 +0000 (15:33 +0200)]
Add Selection Mode
The selection mode action is a checkable toggle action named
"Select Files and Folders" which has "Space" as the default
shortcut.
In selection mode a bottom bar with contextual actions is shown.
These should mostly mirror the actions which are available through
the right-click context menu aka DolphinContextMenu.
Resizing of the window might make a overflow button appear in the
bottom selection mode bar.
This commit makes press and hold in the view activate selection
mode. This behaviour is not triggered if the press and hold is
used to either start a rubberband selection or a drag operation
within a short time. The length of the short timeframe is defined
by a QStyleHint. This is currently not implemented in touch
because I can't test it.
Mix the selection mode bars' background colors using a nice
combination of colors from the current color scheme
Makes this setting more accessible and makes it consistent with other
KDE applications. Since Dolphin has a separate status bar on each view
container and doesn't use kxmlgui's statusbar, we don't get this menu
entry automatically.
Felix Ernst [Thu, 7 Jul 2022 13:32:28 +0000 (13:32 +0000)]
Improve goActions test
This merge request fixes up a little oversight by me. I will merge this as soon as the pipeline passes.
------------------
Some lines verified that nothing is selected when navigating to a
folder that was not acted on yet. These verifications didn't test
anything meaningful because the folder in question was empty.
This commit adds a file and a folder to the test folder so that
testing if nothing is selected means something.
Felix Ernst [Thu, 7 Jul 2022 10:41:39 +0000 (10:41 +0000)]
Add two autotests
- The first test makes sure that the width of the places panel
doesn't change no matter what other panels are shown or hidden.
There used to be bugs about this.
- The second test is kind of an integration test. It makes sure
that the go actions work correctly. On two occasions we had
the regression here that after going "Up" in the file system
hierarchy the folder one emerged from didn't have keyboard
focus which makes peeking into multiple folders tiresome.
The test also makes sure that going back and forward works
as expected and there are some sanity checks about which
go actions are enabled, which items are selected and that
using tabs doesn't interfere with any of that.
We know that we'll be a `QHelpEvent` from `QEvent::ToolTip`, so do a
static_cast from the event handler (where it's obvious from context),
and then pass it along to `tryShowNameToolTip`.
Remove defunc & now deprecated SHOW_DEPRECATIONS flag
ecm_set_disabled_deprecation_versions() in versions < 5.96 was brokwn
when it comes to SHOW_DEPRECATIONS, warnings for newer deprecations
were disabled if the flag was set or not.
Starting with ECM 5.96 the macro now enables warnings by default,
so the flag is no longer needed.
Felix Ernst [Thu, 16 Jun 2022 09:11:36 +0000 (09:11 +0000)]
Don't consider drops on a row as drops on the row's item
Since d3839617193e92463806580699caa595c892b8a6 in details view mode
clicking anywhere within the row is considered a click on the item.
That commit also changed it so that dropping files anywhere inside
a row would make it so the files are received by the folder of that
row.
This commit reverts the drop behaviour to be identical to the old
one.
I am having trouble explaining why this is better because one can
look at it in different ways. Bottom line is that one doesn't
really feel like one is dropping files inside a folder unless the
mouse cursor is actually directly above a folder's icon or name.
Another argument is that it is normal behaviour to just throw files
onto an application and the files then being opened by it.
Having potentially large parts of the view area covered by the rows
of folders means that there has to be more of a conscious effort to
not drop the files inside one of the folders by accident while with
this commit one has to aim precisely onto a folder to do it
intentionally.
Dāvis Mosāns [Sun, 12 Jun 2022 01:55:12 +0000 (02:55 +0100)]
Fix rare ToolTipManager crash on exit
If tooltips are enabled and you hover over item
while immediately closing Dolphin sometimes it would crash
because native parent might have been destroyed before
DolphinView
Marius P [Sun, 5 Jun 2022 04:36:01 +0000 (07:36 +0300)]
KItemListView fix valgrind issue "Conditional jump or move depends on uninitialised value"
KItemListView::setAlternateBackgrounds(bool) (kitemlistview.cpp:489)
In C++, a data member of an object is not automatically initialized to "zero".
In this case a bool had random values such as the integer 255.