Gleb Kasachou [Tue, 17 Jun 2025 05:58:45 +0000 (05:58 +0000)]
Add setting to select filename eliding behavior
Introduces a setting in Content Display Tab that allows to choose how
filenames are truncated when they do not fit in the maximum filename
length, i.e elide.
One scroll with the mouse wheel is supposed to scroll the view by
QApplication::wheelScrollLines, however previous to this commit Dolphin
scrolled the view by QApplication::wheelScrollLines^2 instead, which
was wrong and way too much.
This commit fixes this by defining one line height as the height of the
current default font. This value is multiplied by
QApplication::wheelScrollLines to determine the scroll amount per mouse
wheel scroll.
In details view mode however, where there really are rows to go by,
this commit makes sure to always scroll by full rows. The number of
rows to scroll is determined by rounding up from the scroll amount used
in the other view modes.
fix incorrect view reset when unmounting similarly-named devices
Previously, unmounting a device would incorrectly reset views containing:
- Paths with similar names (e.g. "/media/disk" and "/media/disk_2")
- Substrings of the mounted path
Now only resets views showing either:
1. The exact mounted path (e.g. "/media/disk")
2. Its subdirectories (e.g. "/media/disk/docs")
Victor Blanchard [Wed, 28 May 2025 10:33:52 +0000 (12:33 +0200)]
dolphinview: Add a dynamic view option
Added a 'dynamic view' option, which allows to switch from a 'compact' or 'details' view to an 'icons' view if most of the files in the directory are images or videos. It reverts to the previous view mode when we switch to a directory which doesn't meet that criteria.
The view mode is only changed once so users don't have to undo that for specific folders when they don't want icon view.
A setting is added in the "Display style" section of the general view setting page.
Akseli Lahtinen [Wed, 14 May 2025 11:31:36 +0000 (14:31 +0300)]
Check if the item supports sequencing before looking for sequence pixmaps
This patch checks the item first if the plugin it's using for it's previews even supports sequences. If not, we can then safely ignore the hover action for polling more sequences and avoid unnecessary work.
The sequencing support is false by default, so we set it true only when we know it's possible.
DolphinView: Don't end anchored selection in updateSelectionState
Do not end anchored selection when selection state is updated, such as
when Dolphin is started with --select "thing.txt" flag.
If we end here, and user wants to press shift to select from
current item to X items, this would cause the anchored selection
to start from the clicked item, not from the first selected item.
By changing the version number, this script now runs again, but it
doesn't need to since the change was already made on everyone's systems.
Instead it should just be deleted.
The text would get squeezed and elided prematurely due to some clipping
calculations and paddings created for the clipping.
This slightly modifies the clipping code, that we extend the painted
area and then clip off the excess, instead of moving the area to
specific place and then clipping off the excess.
This also makes sure the text width accounts for one extra character
plus the clippings we do, so that text will always fit the statusbar.
DolphinView: If contextmenu is requested, abort twoClicksRenaming
When using single click to select, user can double click the file to
start renaming it. If user at the same time also opens context menu,
user can delete the file while the renaming prompt is open, which causes
weirdness.
This patch makes sure we abort the double click renaming when context
menu is requested.
DolphinStatusbar: Fix background and margins for non-Breeze styles
There is a bug where non-Breeze styles, such as fusion, do not always have
background color for the small statusbar.
There is also a bug that made the statusbar too small for other themes.
This patch makes us always draw a background, and uses marginLeft and marginRight from QStyle.
Felix Ernst [Sat, 19 Apr 2025 10:57:36 +0000 (12:57 +0200)]
CI: Remove linux-qt6 build
This commit follows the recommendation of our system administrator
Ben Cooksley to remove the linux-qt6 build from the CI for projects
which already have linux-qt6-next and FreeBSD or Windows builds
which also use qt6 (non-next).
See https://mail.kde.org/pipermail/kde-devel/2025-April/003464.html
Felix Ernst [Sat, 19 Apr 2025 12:32:25 +0000 (14:32 +0200)]
Add Filelight menu to Tools menu
The menu for installing and launching Filelight was only available
through the status bar free space info button until now. By default
we do no longer show the free space info button because the status
bar has been changed to show less information by default.
This commit adds the "Manage Disk Space Usage" menu to the "Tools"
menu in the menu bar so it is more discoverable for users.
intended as a fix for icon themes with different `org.kde.dolphin` and
`system-file-manager` icons
https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/issues/3663#issuecomment-2798459480
Also noticed that it should also actually make the upcoming
dolphin on the icon change apply in places where setting the icon is
respected (title bar).
Nate Graham [Tue, 15 Apr 2025 15:31:39 +0000 (09:31 -0600)]
Update kconf update script version to 6
This allows it to run for people upgrading from an ancient version
straight to the current one, and also prevents an error message about
this from appearing in the journal log.
Felix Ernst [Tue, 15 Apr 2025 21:06:26 +0000 (23:06 +0200)]
Fix session restore
Since https://commits.kde.org/kxmlgui/8c9fb02a1d37672b26a03a9dd9e8675743deb269
KXmlGui only triggers a session restore for a window when the
session config contains a "NumberOfWindows" key with a value >= 1.
This commit adds such a key to the Dolphin session config, which
fixes the Dolphin main window restore for KXmlGui versions
containing that commit.
Jin Liu [Thu, 10 Apr 2025 04:30:29 +0000 (12:30 +0800)]
Add a new "view_settings" action
This should replace the "View Mode" button in the toolbar by default. Its
dropdown menu contains more actions related to the view: zoom, sort by,
show additional columns, show hidden files, grouping, show file previews.
The original "view_mode" action is kept so the "Change View Mode" submenu
in the main menu (or in the hamburger menu when this button is invisible)
is unchanged.
Felix Ernst [Mon, 7 Apr 2025 21:09:00 +0000 (21:09 +0000)]
Rewrite search integration
This huge commit is a nearly complete rewrite of the Dolphin search
code. It implements most of the improved Dolphin search UI/UX as
designed and discussed in a collaborative effort by Kristen McWilliam,
Jin Liu, Andy Betts, Tagwerk, a few others and me.
See https://invent.kde.org/system/dolphin/-/issues/46.
# Notable changes
- A toggle to change the search tool is provided as most contributors
deemed that useful in
https://invent.kde.org/system/dolphin/-/merge_requests/642#note_985112.
- The default search is changed to filenamesearch for maximum
reliability.
- Removing all search parameters will take users back to the view state
prior to starting a search instead of keeping the search results open.
- The UI for choosing file types or modification dates has been made
more powerful with more granularity and more options.
- Most search parameters can be configured from a popup menu which
gives us extra space for extra clarity.
- Labels and help buttons as well as hyperlinks to settings makes sure
the user always knows why some search parameters are unavailable in
some contexts.
- Chips show important search parameters while the popup is closed.
They allow quickly removing filters.
- The titles of the search and the input field placeholder message
change to make clear whether file names or file contents are searched.
- When the user actively switches the search tool, whether content
should be searched, or whether to search everywhere, this is preserved
for the initial state of the search bar when the user opens it the next
time after restarting Dolphin.
# Architecture
- The new DolphinQuery class is independent of the UI and contains all
search parameters modifiable in Dolphin as easy setters and getters.
- DolphinQuery objects are also used to update the states of every
component in the search UI. There is now a clear separation of UI and
search configuration/DolphinQuery.
- DolphinQuery is responsible for exporting to and importing from
search URLs.
- The search UI always reflects the currently configured DolphinQuery
no matter if the user changed the UI to change the DolphinQuery or
loaded a DolphinQuery/older search URL which then is reflected in the
UI.
- I tried to simplify all classes and their interaction between each
other as much as possible.
- I added some tests