Felix Ernst [Mon, 4 Nov 2024 01:06:29 +0000 (02:06 +0100)]
Skip splitter in Tab order
When moving through Dolphin by repeatedly pressing the Tab key,
there is one seemingly invisible object that catches keyboard
focus. On a default toolbar it receives keyboard focus between the
"Details View Mode" button and the first button of the location
bar. That object is the splitter of the location bar itself, which
never requires manipulation by keyboard. This commit skips this
object by setting its focusProxy to the primaryUrlNavigator()
instead.
Felix Ernst [Mon, 28 Oct 2024 02:58:45 +0000 (03:58 +0100)]
Make Escape move focus from location bar to view
Pressing Escape on the location bar while in breadcrumb mode has no
effect at all. This commit changes this to instead move the focus
to the active view. This is more logical because a user pressing
escape while having focus on the location bar is no longer
interested in interacting and changing the location in the location
bar. They most likely want to act on the current location instead.
Felix Ernst [Mon, 28 Oct 2024 02:22:05 +0000 (03:22 +0100)]
Have "Replace Location" toggle focus of the view
The "Replace Location" action moves focus to the location bar and
selects the full path there so it can easily be replaced with a
different path.
When the full path is already selected, triggering "Replace
Location" will toggle the editable state of the location bar.
This commit makes it, that this also moves the focus to the view.
This way, pressing Ctrl+L multiple times will switch back and forth
between focusing and selecting the location bar path and focusing
the view. This seems more sensible than only partially resetting
the state when the "Replace Location" keyboard shortcut is pressed
twice.
Felix Ernst [Mon, 28 Oct 2024 13:25:10 +0000 (13:25 +0000)]
Overhaul main view accessibility
This commit brings the main view of Dolphin into a usable state
accessibility-wise. Users of screen readers should have a way better
experience while browsing files and folders and navigating along the
file system hierarchy.
This commit fixes most of the remaining already-identified
accessibility issues listed in
https://invent.kde.org/teams/accessibility/collaboration/-/issues/28,
but not all. Namely, these should now be fixed:
1. Orca should read the element type in dolphin (file, folder, device,
link to folder, link to file)
2. Orca should read complete label in icon and compact view mode,
currently it only speaks the name, but there could be additional
information like the number of elements or the file size.
3. Orca is not able to announce Selecting / Unselecting files in
Dolphin. It also never announces how many items are selected in total.
(Announcing the total selection can be done by reading out the view
element or by pressing the Tab key to get to the status bar with the
relevant information.)
4. Dolphin opens on the home directory, but Orca doesn't tell you so.
Consider enclosing the area in a frame/panel which updates its
accessible name each time you modify the current path by entering or
leaving a directory.
5. I don't know what the folder presentation widget is, but it should
be presented as a grid view. Currently, we have a terrible experience
because the entire row of folders is read at once, with no indication
that we can move left and right with the arrows to go between the
elements of a row. When I found that out, however, I discovered that
when you're on the last icon of the first row and press right arrow,
you get to the first icon of the next row, but that's not announced,
instead, the whole row is announced at once
6. Orca should announce the current elements instead of "layered pane"
when the Folder / File view gets the focus in dolphin
7. Orca reads only name in Table View only of Dolphin
8. Items are sometimes confusingly announced as "collapsed" in contexts
in which there is no concept of collapsing/expanding e.g. in icon view
mode.
A lot of code was moved around and renamed. The three accessibility
classes, which all used to be in the same file, are moved into separate
files.
*Acknowledgement*
Thanks to Christian Hempfling and bgt lover for testing as well as
originally identifying a lot of the pain points being addressed here.
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.
https://kde.org/announcements/2024_ngi_openletter/
Felix Ernst [Mon, 23 Sep 2024 15:34:20 +0000 (17:34 +0200)]
Add test to avoid accidental divergence of desktop and phone ui
The dolphinui.rc and dolphinuiforphones.rc file describe parts of
the desktop and phone user interfaces for Dolphin. They are meant
to be different in specific ways, but identical in many others.
This test makes sure that the two ui files stay mostly identical by
requiring any differences between them need to be explicitly
stated/registered as an exception in the test. This way no
accidental divergence of user interfaces can happen.
Felix Ernst [Tue, 17 Sep 2024 09:34:30 +0000 (11:34 +0200)]
Move settings category switcher to the top on mobile
There is not enough horizontal space to show the full Dolphin
settings window on the average phone. This commit saves some
horizontal space by moving the category switcher in Dolphin
settings from being a list on the left to being tabs on the top.
Felix Ernst [Sun, 15 Sep 2024 16:52:49 +0000 (18:52 +0200)]
Add phone UI
Previous to this commit launching Dolphin on phones (e.g. those
running Plasma Mobile) would show Dolphin with its default user
interface optimised for desktop usage. This commit changes this so
instead a phone form factor optimised user interface is used.
The differences to the default UI configuration are:
-Toolbar at bottom
-Icon-only toolbar
-Different actions on the toolbar
-Places panel hidden
-Location bar at the top with a button to show places
-Zoom slider hidden (pinch gestures to zoom still work)
Through these changes Dolphin actually has a good user experience
on phones by default. All the features were already there.
Especially Steffen Hartleib's work to trigger selection mode on
long press leads to great UX when dealing with multiple files.
Still, this might be considered just a start towards making Dolphin
great on phone form factors. Secondary windows that Dolphin might
spawn are not yet adapted, but are usable on Plasma Mobile as they
are anyway.
Wolfgang Müller [Mon, 14 Oct 2024 16:43:28 +0000 (18:43 +0200)]
kitemlistcontroller: process forward/back buttons when double-clicking
Tapping the forward or back mouse buttons quickly enough makes Dolphin
interpret the action as a double-click of the button in question and
handle it in mouseDoubleClickEvent() instead of its normal button
handler. This means that certain button presses might seem delayed or
"swallowed" when quickly navigating forwards or backwards through the
history.
Since a double-click of the forward or back button is currently
meaningless, fix this by emitting a normal mouseButtonPressed event for
those buttons in the double-click handler and skipping any further event
processing.
Co-authored-by: Felix Ernst <felixernst@zohomail.eu>
CCBUG: 485295
Felix Ernst [Mon, 14 Oct 2024 12:44:47 +0000 (14:44 +0200)]
Fix double-click view background feature
c934e803647674b4692668f047b6ffa18121982a was meant to change the
double-click view background feature to only allow double-clicks
with the left mouse button. However, it mistakenly did the exact
opposite and allowed every double-click except ones with the left
mouse button to trigger the feature. This one-liner fixes this.
Jin Liu [Fri, 11 Oct 2024 08:21:14 +0000 (16:21 +0800)]
dolphinview: when rename dialog finishes, immediately update the model and the selection
On sucessful return of the rename dialog, we update
the model and the selection immediately to reflect
the new name. This is to avoid the short duration
after the rename during which the selection is lost.
Currently, after the rename dialog finishes, the selection
is briefly lost for about 1 second until the view
automatically refreshes.
This patch updates the model and selection immediately
after the dialog finishes, so the renamed file is still
selected.
Jin Liu [Fri, 11 Oct 2024 08:17:04 +0000 (16:17 +0800)]
dolphinview: after inline renaming, immediately update the selection
Currently, the inline renaming updates the model and
the list of selected files (m_selectedUrls) immediately
after the user presses enter, but the selection in the
view is not immediately updated. This results in the
selection to be briefly lost for about 1 second until
the view automatically refreshes.
This patch updates the selection immediately after
the user presses enter, so the renamed file is still
selected.
Jin Liu [Fri, 11 Oct 2024 08:08:31 +0000 (16:08 +0800)]
KFileItemModel: fix `setData` in the renaming usage
The `setData` function is used by inline renaming to
update the `text` role (i.e. file name) in the model
before actually do the renaming.
However, the current implementation only updates `text`
and url in KFileItem in this case, leaving the `url` role
and the `m_items` cache untouched. This makes the cache
incoherent, so `index()` won't find the renamed item. It
also makes the `url` role incoherent with the `text` role.
This also fixes the problem mentioned in bug #481561
where when inline renaming fails, it still shows the new
name. (Because `m_model->index` fails to find the new name
and rename it back on job failure.)
Felix Ernst [Thu, 3 Oct 2024 09:18:59 +0000 (11:18 +0200)]
Accessibility: Fix message boxes not being announced
This commit moves the focus to the message of newly shown passive
messages when accessibility software is used. Moving focus to an
object generally means that it will be announced, so this makes
sure that users of accessibility software know when they are being
notified of a change.
KCoreDirLister::itemsDeleted() signal is being emitted twice for the
same url. This results in Dolphin displaying an incorrect location.
Delay changing the url instead of delaying
DolphinView::currentDirectoryRemoved() so that the check for current
directory being removed in KFileItemModel::slotItemsDeleted() occurs
correctly, while still ensuring that KCoreDirLister is not prematurely
modified.
Alexander Lohnau [Mon, 16 Sep 2024 19:31:22 +0000 (21:31 +0200)]
Dolphinpart: Define KPart capabilities instead of deprecated ServiceTypes
By now, Konqueror uses the new mechanism introduced in
https://invent.kde.org/frameworks/kparts/-/merge_requests/86.
Thus, we can avoid using the deprecated SeviceTypes which are also
removed from the official KPluginMetaData API.
Wolfgang Müller [Thu, 19 Sep 2024 09:46:09 +0000 (11:46 +0200)]
Ignore trailing slashes when comparing place URLs
There's two locations where place URLs are compared in Dolphin. One
is in DolphinContextMenu::placeExists, which determines whether or not
to show an "Add to Places" context menu entry. The other one is in
DolphinViewContainer::caption, which provides the place name for use in
the window title, if applicable.
Neither of these functions correctly normalize the URL to account for
trailing slashes. Whilst placeExists() does not even attempt it,
caption() was changed in 681d8bb6c (Fix wrong window titles, 2019-09-15)
to support this using a regular expression.
However, caption() fails to escape the URL before incorporating it in
the regular expression, leading to failed matches and errors like the
following when browsing to directories that do not happen to make up a
valid regular expression:
QString(View)::contains(): called on an invalid QRegularExpression
object (pattern is '\A(?:file:///home/foo/[Z-A]/?)\z')
Instead of relying on complex and possibly brittle regular expressions,
use KFilePlacesModel's closestItem() function to find the closest
matching URL and then finally check whether the normalized URLs match
exactly.
dolphintrash.cpp: Update trash dir on device changes
Make sure we update the trash directory when storage devices are added/changed.
This ensures that whenever a mounted device, for example
USB stick is mounted/unmounted, the contents are properly
updated in the trash folder as well.
Otherwise the trash folder and USB stick trash folder will get
out of sync, making the trash folder behavior unpredictable.
Akseli Lahtinen [Fri, 30 Aug 2024 10:54:56 +0000 (10:54 +0000)]
settings: Fix the Use Current Location button
During the Dolphin settings revamp
(https://invent.kde.org/system/dolphin/-/commit/489b56b68bb29e81337e115c490eea4403001b71?)
this QUrl had been forgot to add back so that the
FoldersTabsSettingsPage knows what is the current url.
This change checks for the main window of dolphin, then gets
the URL of it whenever useCurrentLocation is called.
However, when this is used as KCM, the button is not
created, since there it doesn't make sense.
Carl Schwan [Tue, 27 Aug 2024 22:16:59 +0000 (00:16 +0200)]
Make settings tabbar expanding
Allow to use https://invent.kde.org/plasma/breeze/-/merge_requests/478
but even without the breeze MR, it look better and similar to what we do
with other settings page.
Jérôme Lécuyer [Wed, 21 Aug 2024 23:27:07 +0000 (01:27 +0200)]
Use QLocale to display localized time role group
Use QLocale to format the QDateTime displayed as the role/label of a group.
`QDateTime::toString` format the date and month names in English.
`QLocale::toString` returns them localized.
See the note about day and month names at https://doc.qt.io/qt-6/qdatetime.html#toString
Jin Liu [Mon, 19 Aug 2024 11:15:23 +0000 (11:15 +0000)]
Fix middle-click not following the "Open archives as folder" setting
Previous to this commit middle-clicking an archive would always open it
in a new tab. This contradicts the recent change d27ee07de7558470ef7b497fbe3d3504ce7cad07 which made it so middle-click
would open an item in the second application that is available to open
a file.
With this commit, middle-clicking will treat the archive like a folder
only when GeneralSettings::browseThroughArchives is enabled or when
there is no second application available. Otherwise middle-click will
open the archive in the second available application.
Felix Ernst [Sun, 18 Aug 2024 21:41:34 +0000 (21:41 +0000)]
Implement "Focus Places Panel"
This commit implements an action to move focus to the Places panel
analogous to "Focus Terminal Panel" functionality-wise.
The implementation of the "Focus Terminal Panel" and "Focus Places
Panel" actions is streamlined while improving their code quality.
The "Focus Terminal Panel" action is moved into the "Show Panels"
sub-menu because it makes more sense to be there considering that its
previous location (the "Tools" menu) is meant for external applications
and not for functionality internal to Dolphin.
This commit also makes it so the keyboard focus is moved to and from
the Places panel whenever it is toggled visible or invisible. This is
now consistent with the focus handling when the Terminal panel is shown
or hidden.
The "Focus Places Panel" is one of the actions which was wished for in
KDE's accessibility chat room because people relying on keyboard
controls might need to press the Tab key a lot to move from the view to
the Places panel.
Felix Ernst [Thu, 15 Aug 2024 20:46:39 +0000 (22:46 +0200)]
Make FoldersTabsSettingsPage fully usable for blind users
This commit fixes keyboard navigation for the "Folders & Tabs" page
in Dolphin's settings dialog. It also makes sure that the Orca
screen reader reads out sufficient information for every widget
that can get keyboard focus. These two groups of fixes together
should allow basic usage of this settings page for users relying
on keyboard controls and screen readers.
One weirdness prior to this commit was that for checkboxes with
a short group label in front and the full description behind
screen readers would only read out the label and skip the
explanation what the checkbox actually does. This commit fixes this
by explicitly setting the accessible text for the label. In
practice only reading out the explanation and skipping the label
seemed sufficient and is implemented here, but more specific text
could be provided using this mechanism if needed.