Méven Car [Fri, 7 Feb 2025 10:16:05 +0000 (11:16 +0100)]
Viewproperties: prevent loosing view settings
When they match the hardcoded internal settings, when they should be
kept as long as they don't match the currently set default
viewproperties.
Is saved in metadata the diff with the hardcoded internal defaults
still. A stable default reference allows to change defaults without
changing existing saved viewproperties.
When using keyboard search, normalize the item names and remove marks
first. Now, items containing characters with marks can be found using
keyboard search.
Akseli Lahtinen [Thu, 30 Jan 2025 09:25:12 +0000 (09:25 +0000)]
Change three view buttons into one with menu arrow
Instead of showing three buttons, which is quite visually noisy, show
only one button that is split: First button, when clicked, loops
through the view modes. Second smaller button with the down arrow
shows menu of the available view modes.
See also
https://invent.kde.org/system/dolphin/-/issues/68#toolbar-button-changes
Alternative for https://invent.kde.org/system/dolphin/-/merge_requests/893
Nate Graham [Wed, 29 Jan 2025 18:57:09 +0000 (11:57 -0700)]
Make "Empty trash" icons red
This is a destructive action, and the HIG specifies that icons for
destructive actions should be colored red.
The current icons are black, inconsistent, and semantically incorrect.
edit-delete is red in the Breeze icon theme, and also more semantically
correct since the items in the trash will be deleted. Let's use this
icon instead.
Méven Car [Tue, 14 Jan 2025 17:52:36 +0000 (18:52 +0100)]
Refactor Overlay Handling
Now all overlays icons in kitemviews are added in
KStandardItemListWidget::updatePixmapCache.
data[iconOverlays] now contains icon names.
DolphinFileItemListWidget::refreshCache is the sole responsible of
setting the overlays either coming from KFileItemModelRolesUpdater or
KVersionControlPlugin.
Nate Graham [Fri, 3 Jan 2025 19:45:27 +0000 (12:45 -0700)]
Elide file names in the middle again
In ye olden days, filenames were elided on the right. This prevented
seeing the filename extension and any suffix style text the user
included in the filename (e.g. "myfile 1", "myfile 2" and so on).
In 97f49347482519b9ad53b7596d7462e68b7c2e14, this was changed to elide
in the middle, fixing both problems and bringing Dolphin into Jakobs'
Law style consistency with MacOS Finder and Windows Explorer, and
possibly other file managers too.
However it worsened the situation for users who name their files such
that most of the information was on the left. After some complaints, it
was changed in 99cf24c03def1c0722ba8dbd86a27b9dbc521f43 to right-elide
again, but excluding the filename extension.
Unfortunately user complaints have continued. At this point it's clear
that nothing will satisfy everyone due to diversity of file naming
styles. In such a situation, Jakobs' Law consistency with the rest of
the industry is the best solution short of making it configurable,
which has its own drawbacks.
Felix Ernst [Sat, 4 Jan 2025 17:58:22 +0000 (18:58 +0100)]
Fix focus changing when unminimising on X11
In f220e3b0783a24a6c7195f170297cf4b12a29d85 I made the keyboard
focus move to the places and terminal panel whenever they are
toggled visible. Unfortunately the QDockWidget::visibilityChanged()
signal is also emitted (at least on X11) simply when the window
containing that panel is minimized or restored. This commit
overrides the QDockWidget::event() method to ignore such
spontaneous show or hide events so QDockWidget won't emit the
visibilityChanged() signal then.
Felix Ernst [Sun, 29 Dec 2024 11:42:22 +0000 (11:42 +0000)]
Mirror details view mode for right-to-left languages
This commit implements mirroring of the details view mode for right-to-
left languages. This is the last of the Dolphin view modes which did
not adapt to right-to-left languages correctly.
Implementation-wise this is mostly about adapting the math so all the
information is placed correctly no matter the view mode or layout
direction. While most of the view actually changes the painting code
for right-to-left languages, for the column header I decided to keep
the logic left-to-right and instead reverse the order of the role
columns.
To implement this mirroring I needed to rework quite a bit of logic, so
I used the opportunity to fix some bugs/behaviur quirks:
- Left and right padding is now saved and restored separately instead
of only saving the left padding
- Changing the right padding no longer disables "automatic column
resizing".
- The grip handles for column resizing can now be grabbed when near the
grip handle instead of only allowing grabbing when slightly to the
left of the grip.
- Role column headers now only show a hover highlight effect when the
mouse cursor is actually above that role and not above the grip
handle or the padding.
- There is now a soft-boarder when shrinking the right padding so
shrinking the padding "below zero width" will no longer immediately
clear automatic resize behaviour. So now it is possible to simply
remove the right padding by resizing it to zero width.
BUG: 449211
BUG: 495942
# Acknowledgement
This work is part of a my project funded through the NGI0 Entrust Fund,
a fund established by NLnet with financial support from the European
Commission's Next Generation Internet programme, under the aegis of DG
Communications Networks, Content and Technology.
Felix Ernst [Sun, 29 Dec 2024 11:27:18 +0000 (11:27 +0000)]
Have special keyboard controls in selection mode
Prior to this commit keyboard controls and behaviour of Dolphin's main
view were identical no matter if selection mode was enabled or not.
While selection mode makes it impossible to accidentally clear the
selection by singular mouse clicks, any press of an arrow key on the
keyboard would still clear the full selection which goes against
selection mode's objective.
Furthermore, keyboard-only users had no reason to ever enable selection
mode because it made no difference to them.
This commit changes this by offering a changed control scheme for key
presses while in selection mode. Arrow key presses without modifier now
only move focus between items but do no longer clear or change the
selection. Similarly, Page Up/Down, Home, and End key presses only move
keyboard focus. Enter, Return, and Space key presses now only toggle
the selection for the current item.
The above controls are however mostly unchanged when combining them
with Modifier keys like Shift or Control.
The type-ahead feature is also changed in selection mode to only move
keyboard focus without changing the selection.
This way keyboard users are less likely to clear their selection by
mistake. Regression tests are added for these selection mode controls.
The code changes to change this keyboard behaviour are quite minimal.
Most of the added code is for making selection mode accessible. That's
because we need to make sure the changed control scheme is properly
announced and communicated or a blind user will be left utterly
confused why the normal keyboard controls "stopped working".
Enabling or disabling selection mode is announced to accessibility
software. Furthermore whenever focus goes to the main view, the
selection mode state is also mentioned when active.
Akseli Lahtinen [Thu, 19 Dec 2024 10:04:16 +0000 (10:04 +0000)]
dolphinview: Update thumbnail on filename change
If filename of an item was updated previously, it would modify the model
before the file was actually changed. This led to the model calling
a signal that would try to run a previewjob, but since the filename
is not actually changed yet on disk, it would fail.
This patch moves the model updating after copyjob. Copyjob
will take care of the file renaming if there is already existing file.
We just need to update the model correctly after the job has succeeded.
Akseli Lahtinen [Mon, 16 Dec 2024 12:25:43 +0000 (12:25 +0000)]
DolphinViewContainer: make sure searchbox is initialized before setSearchPath
If searchBox is not initialized, it can't be updated properly
with setSearchPath due to some buttons not existing.
There is also just no need to update it if it's not initialized.
Make sure we check for it's initialized during setting the search path.
Ilia Kats [Mon, 9 Dec 2024 11:31:44 +0000 (11:31 +0000)]
Fix inline renaming multiple files when renaming changes sorting order
Suppose we are renaming file i and the new name will be sorted after
file i+1. We are now pressing ArrowDown to immediately start renaming
file i+1. However, because of the sorting we would not actually end up
renaming what used to be file i+1. What would happen is that editing
would be started in dolphinview.cpp:2065. However, after 100 ms the
timer in KFileItemModel would fire, resulting in the model emitting
itemsMoved(). This would trigger doLayout() in
KItemListView::slotItemsMoved(). doLayout() resizes the
KItemListWidgets, wich causes the renaming to be canceled in
KStandardItemListWidget::resizeEvent().
Now, we start a new renaming operation for the correct widget after the
relayouting is complete.
Felix Ernst [Fri, 1 Nov 2024 23:39:19 +0000 (00:39 +0100)]
Adapt to Orca 47
The screen reader Orca has seen some fundamental changes between
Orca 46 and Orca 47. While they are improvements overall, they do
require changes to Dolphin to preserve the intended user
experience for Orca users.
The biggest change is perhaps that Orca will now not only announce
changes to the currently focused item, but also of its parent,
which means we do not need to pass focus around between file items
and the main view within Dolphin, but can keep focus on the file
items most of the time. This commit implements this.
The only exception of when we cannot have focus on the items within
the main view is when the current location is empty or not loaded
yet. Only then is the focus moved to the view itself and the
placeholderMessage is announced.
This commit worsens the UX for users of Orca 46 or older, so this
should only be merged once most users are on Orca 47 or later.
Felix Ernst [Fri, 29 Nov 2024 17:57:37 +0000 (18:57 +0100)]
Always focus the view after place activation
This one-liner makes sure keyboard focus always moves to the active
view when a place in the places panel is activated. Previously
focus would remain on the places panel if the activated location
was identical to the already displayed location.
This added consistency is helpful because keyboard-only users will
get used to be able to move from the places panel to the view by
pressing the Enter key, even though this does not always work
prior to this commit.
This issue was identified in an accessibility scan done by HAN
University of Applied Science.
Akseli Lahtinen [Mon, 2 Dec 2024 09:40:03 +0000 (11:40 +0200)]
KItemListSmoothScroller: stop animation on property or targetobject change
Due to changes in 15e0c2a98f480f203ce168b6fa9a2e1f2b0ed8f8 we do not
automatically stop animations now on property or targetobject change,
which causes warnings and timeouts.
This patch makes sure we stop them if their state is Running,
before modifying them.
See also:
https://invent.kde.org/system/dolphin/-/merge_requests/857#note_1083279