Felix Ernst [Thu, 26 May 2022 08:38:15 +0000 (10:38 +0200)]
Remove hover highlight before opening view context menu
If one was fast to open the right-click context menu on the row of
an item in details view mode, the hover highlight would persist
while the context menu for the view was open.
This one-liner makes it so the highlight on the row is always
removed before the right-click context menu for the view is opened
so it is as clear as possible that the newly opened context menu
has no relation to the fileItem.
Felix Ernst [Tue, 24 May 2022 12:46:45 +0000 (14:46 +0200)]
Fix paste on row while in details view mode
Before this change, right-clicking the row of an unselected item
in details view mode would be in a weird state:
- It didn't really count as a click on the item because the item
didn't get selected by this click before opening the context
menu.
- It didn't really count as a click on the view background either
because the actions that showed up depended on the item in
that row.
This commit fixes this by considering a right-click in the same row
as an unselected item as a click on the view background.
The behaviour of right-clicking the icon or name of a file directly
is unchanged.
This fixes the following bugs:
- The Paste action that shows up when right-clicking in the
unselected row of a folder now works (instead of doing
nothing). It now pastes the clipboard contents onto the view
background.
- When right-clicking the unselected row of a file (not a folder)
a Paste action once again shows up.
Travis Burrows [Thu, 26 May 2022 12:38:22 +0000 (12:38 +0000)]
Extend selection rectangle to left edge
This commit changes it so the sizes of selection rectangles and hover
highlights in compact and details view mode is identical for all items.
Before this commit, selection rectangles in lists would have varying
indentation of the left edge of the selection rectangle depending on
the preview image's width-to-height ratio. This would cause a sort of
"ragged edge" in both compact and details list view when multiple items
were selected.
This commit doesn't change anything about icon view mode.
fix: service-menu-installer ignoring symlinks on un-install
service-menu-installer ignores <package-name>.tar.gz-dir/uninstall.sh
if this is actualy just a symbolic link to install.sh in the same directory
(hardlinks and copies work)
canonicalPath() is used to get the name of the file on disk and returns install.sh
in the case of a symbolic link. install.sh without any arguments is called instead
of uninstall.sh consequently and no de-installation takes place.
replace canonicalPath() with absolutePath() as used in the rest of source file
In KF6 KMoreTools should become it's own library and thus the KNS3 prefix should get removed.
Considering that the classes are not in any namespace, having a namespaced include is not needed and only causes noise.
oioi 555 [Mon, 2 May 2022 20:25:24 +0000 (20:25 +0000)]
Re-add "Open Terminal Here" feature
This is equivalent to the "Open Terminal Here" feature that existed until Version 20.12.
If the user has selected folders, replace "Open Terminal" in the context menu with "Open Terminal Here".
When more than 5 folders are selected, a modal window will ask the user if they are sure they want to
open all 6 or more terminal windows.
In Detail View, users can also select a file,
which will open a terminal at the location of that file.
Felix Ernst [Wed, 27 Apr 2022 10:40:40 +0000 (10:40 +0000)]
Fix terminal panel not keeping up with dir changes
The terminal panel is supposed to show the same location as the
currently active Dolphin view at all times.
However there was an issue when the terminal is supposed to
quickly switch to a new location and then back again to the old
one. The terminal ignored the switch to the old location unless it
had already fully switched to the new location. Because it isn't
particularly fast at fully switching to the new location, it would
never do the expected thing of switching back to the old location.
This commit makes it so the switch to the old location is only
ignored if there are no in-progress switches to a different
location.
BUG: 391380
BUG: 416690
FIXED-IN: 22.04.2
Not totally sure if this fixes everything but it seems like an improvement.
Currently, Dolphin doesn't have the ability to sort by file extension (sorting by type means that files will be sorted by mimetype but not by extension). This MR fixes this shortcoming.
Felix Ernst [Wed, 20 Apr 2022 21:44:05 +0000 (21:44 +0000)]
Don't deselect on Ctrl+Right-Click
(Part of my work towards !273)
Currently, when items are selected and a user right-clicks a selected item
while having the Ctrl key pressed down, the item is first
deselected and then a context menu is opened that doesn't involve
the item that was just deselected.
This is slightly confusing because normally one right-clicks an
item to see its context menu. Right-click being able to deselect
an item seems like unintended functionality in the first place but
in this scenario it also means that the intended opening of a
context menu for the pressed item doesn't even happen.
There is a good chance that nobody is even aware of this behaviour
because the normal way to deselect an item would be to
Ctrl+Left-Click if anything. Why would someone choose to open a
context menu and deselect items in a single step? Why would they
have selected an item they don't want to open a context menu for in
the first place?
Because of a discussion in this merge request deselecting on Ctrl+Middle-Click was also
removed for consistency with Ctrl+Right-Click and
Ctrl+Shift+Middle-Click.
This commit also makes a later implementation of a selection mode
more straightforward.
Accepts Ark's special dnd mime types so that archive contents can
be dragged onto a place to extract and/or (mount and) switch to the
hovered location.
Felix Ernst [Fri, 8 Apr 2022 09:07:23 +0000 (11:07 +0200)]
Add symmetric padding on right side of details view
There have been some reports that users were unable to figure out
that the padding on the left of the left-most "name" column can be
used for deselecting or for dropping file items. All of these
reports were by people using a Dolphin version in which that
padding was way too narrow because of a regression (that has since
been fixed). Nonetheless this highlights the potential problem that
some users might be unable to notice/figure out the usefulness of
the left padding.
This commit adds a similar area on the right side of the view when
the column widths are set automatically by Dolphin. The width of
the right padding column mirrors the width of the left padding
column when sized automatically. Both can manually be hidden or
resized similarly to resizing other columns.
There are various usability advantages to having this padding by
default on both sides of the view and not only on the left:
- The right margin is more discoverable since the item highlight
ends right before the padding column
- Less mouse travel time to reach either of the areas
- More than double the likelihood of users figuring out the
advantages of these padding areas for deselecting or dropping
- More visual symmetry
I had suggested also having this kind of right padding even before
the initial implementation of the left padding. The contributor
implementing it was in favour of it. It only wasn't implemented
because the contributor said it was impossible without a lot of
work. Turns out adding two characters at the right position seems
to suffice in most ways.
This commit does not contain the string change of renaming "Leading
Column Padding" to "Column Padding" (since it changes two paddings
now) to not infringe on the string freeze.
Since d3839617193e92463806580699caa595c892b8a6 dragging the
highlighted row of already selected items in the details view mode
will begin a drag operation of all selected items.
As a unintended side-effect of this change, dragging the row of a
previously unselected item while holding the control key would also
begin a drag operation.
After this commit, dragging the row of a previously unselected item
while holding the control key in details view mode will instead
create a rubberband. Ctrl-dragging the item's icon or text directly will drag the item as expected.
With this change, using multiple rubberbands to select scattered
items among a list of items should be as convenient as it was
previously.
Aside from the two bugs mentioned below, this also fixes another
regression: The spacing on the left of the view does now once again
follow the size of its column header.
Felix Ernst [Sat, 2 Apr 2022 17:00:58 +0000 (17:00 +0000)]
Refactor DolphinContextMenu so its actions are retrievable
This mostly red MR should have no visible effect. It is part of my work towards !273.
There are two calls necessary to open the DolphinContextMenu:
One to construct it and one to execute/show it.
Before this commit, the actual populating of the ContextMenu was
done on execute. This meant that the actions of the ContextMenu
couldn't be looked at or changed without first showing the Menu
to the user. It also meant that the construction itself didn't
actually do much constructing/populating at all which might seem
a bit unintuitive.
This commit changes this behaviour so the DolphinContextMenu is
actually populated fully on construction. The executing/showing of
the ContextMenu now does just that and nothing more.
Previously, some actions in the context menu were actually not
wired up to anything and instead the DolphinContextMenu or the
DolphinMainWindow executed some code after the user had clicked
such a dummy action from the ContextMenu. Now all the actions are
properly constructed beforehand and no special handling is
necessary when the ContextMenu hides itself.
This commit removes the pos parameter from the DolphinContextMenu
constructor. This parameter contained the position where the Menu
would be shown later. This information isn't necessary to have on
construction and was already part of the exec(pos) call in the
first place. The variable m_pos that stored the value is removed.
This commit also removes a "customActions" functionality that can
supposedly be used to add further custom actions to the
DolphinContextMenu but this functionality isn't ever used
anywhere so its usefulness is questionable. It also wouldn't be
difficult to re-add this functionality if it was ever required for
something.
This commit also addresses an old TODO in dolphinpart.cpp that
asked for the calls for opening the DolphinContextMenu to actually
contain the information for which items the DolphinContextMenu is
supposed to be constructed. Before this, only the item that was
directly clicked was transmitted and then DolphinContextMenu
retrieved the currently selected set of items by itself.
It makes more sense that DolphinContextMenu would be informed on
construction which items it is supposed to show context actions
for.
Most of this is necessary so we are able to show the contextual
actions anywhere else than in the ContextMenu in the future.
I am targeting 22.08 with this MR because it makes no sense to merge a refactor for the upcoming release already.
Alexander Lohnau [Tue, 15 Mar 2022 19:01:55 +0000 (20:01 +0100)]
Install servicemenus in new install location
Since KIO 5.85, this new file location is preferred over the
KServiceTypeTrader results.
With this change, single desktop files from the KDE store are installed
in the correct location. If however a custom install script is used,
developers need to adjust their scripts.
Because the "kio/servicemenus" locations is different than the one
KAuthorized allows by default, we have to mark the file as executable.