┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews
AgeCommit message (Collapse)Author
2025-03-13KFileItemModelRolesUpdater: reset size and count before updating foldersAkseli Lahtinen
Folder count would not update properly when user would delete file from a folder, or add a new file to it. Previously when size value is set to -2 after update, the update will never be called again unless user presses F5. This change will instead reset that -2 to 0 whenever we are requesting for calculating directory sizes. We never updated the count when a file was deleted, so that has been added as well. This change also calculates the item counts from the processedAmount, which is the total amount of items we're processing. From there we remove the unwanted items and get the final count. For remote files, we set the count to -1 since we don't calculate them. BUG: 500502
2025-03-09kstandarditemlistwidget: render overlays in paintMéven Car
This allows to keep the original pixmap in m_pixmap when resizing so it can have nice rendering when being resized and simplifies implementation
2025-03-01kstandarditemlistwidget: make overlay icons independant of preview sizeMéven Car
This consists in replacing the use of KIconUtils::addOverlay to custom adapted function, based on KIconLoader::global()->drawOverlays previous behavior. BUG: 500428
2025-02-24Add smaller statusbar and set it as defaultAkseli Lahtinen
- Statusbar has three modes: Small, FullWidth and Disabled - FullWidth is the original statusbar - Small is the new default statusbar - This statusbar overlays on top of the items instead of taking space - It changes size according to content - Disabled turns statusbar completely off - Zoom slider and space information is only shown in full-width statusbar - Space information is now always on - If user navigates with keyboard, or scrolls to selection, the scrolling will take the statusbar into account - This makes sure the statusbar does not cover any items Related discussion: https://invent.kde.org/system/dolphin/-/issues/50
2025-02-22kitemlistkeyboardsearchmanager: smarter search start positionYifan Zhu
Search from the next position for new search and special repeated key search. Otherwise search from the current position, which is current selected item if something is selected or in selection mode, and 0 (the beginning) otherwise. Test plan: - create directory with files ab1, ab2, and ab3 - click ab2, and press escape to deselect - type ab; verify that ab1 is selected - wait a while, type ab again, verify that ab2 is selected - wait a while, type ab again, verify that ab3 is selected - click ab1, type ab, verify that ab2 is selected BUG: 422951
2025-02-17kfileitemmodel: allow more than 2 single quotes in translated stringsSergey Katunin
This change concerns `timeRoleGroup`.
2025-02-01Ignore diacritical marks for keyboard searchThomas Moerschell
When using keyboard search, normalize the item names and remove marks first. Now, items containing characters with marks can be found using keyboard search. BUG: 482394
2025-01-17Refactor Overlay HandlingMéven Car
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. This garantees consistency in rendering. BUG: 497372
2025-01-15Clean stop-gap porting ifdef for KICONTHEMES_VERSIONMéven Car
That were introduced in: a55c467fbb31d822d89722812388425327830377 38ab14c87a945153e683657483fa4bcf44d6b0fb
2025-01-11KFileItemModelRolesUpdater: add utility cacheSize functionMéven Car
2025-01-11KFileItemModelRolesUpdater: Show emblems even in hover sequenceMéven Car
2025-01-11Icons: when adding overlays pass in the output sizeMéven Car
Instead of the pixmap size that won't be accurate. It allow KGuiAddons::addOverlays to draw larger images to add overlays. Consequently the emblems are not longer dependant scaled based on the pixmap aspect ratio. BUG: 498211
2025-01-09information panel: scale according dprMéven Car
Also use dpr for icons. Amends cebcf8db BUG: 497576
2025-01-07Elide file names in the middle againNate Graham
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. Accordingly, return to middle-elision. BUG: 497664 CCBUG: 404955 FIXED-IN: 25.04.0
2024-12-29Mirror details view mode for right-to-left languagesFelix Ernst
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.
2024-12-29Have special keyboard controls in selection modeFelix Ernst
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. BUG: 458091
2024-12-19dolphinview: Update thumbnail on filename changeAkseli Lahtinen
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. BUG:497555
2024-12-09Fix inline renaming multiple files when renaming changes sorting orderIlia Kats
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.
2024-12-05Adapt to Orca 47Felix Ernst
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.
2024-12-02KItemListSmoothScroller: stop animation on property or targetobject changeAkseli Lahtinen
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
2024-11-29Make "open path" and "open path in new tab" scroll to the selected itemAkseli Lahtinen
**Open Path** When user clicks on "Open Path" after searching for an item, user expects the view to show the item immediately. We wait for the KItemListSmoothScroller to be done with its animation before the scrollbar sizes are being changed. **Open Path in New Tab** When user selects "Open Path in New Tab", we open a new tab to the folder where the file is, then select and set the file current. We need to get the correct tab when opening one, so it has been added as a return value. BUG:495613
2024-11-25Switch to C++20Méven Car
2024-11-19natural sort: exclude extension when comparing filenamesEren Karakas
Currently natural sort compares the entire filenames (basename.extension) when sorting. This causes eg. "a 2.txt" to appear before "a.txt" when sorted by ascending. This is unintuitive since people prioritize basenames more than file extensions. Instead, change natural sort to compare by basename only and fallback to comparing extensions if basenames were equal. This change causes "a.txt" to appear before "a 2.txt" and matches how other platforms such as GNOME and Windows behave. BUG: 416025 BUG: 470538 BUG: 421869 BUG: 312027
2024-10-28Overhaul main view accessibilityFelix Ernst
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/
2024-10-19Add a sort by duration option for videosSomsubhra Bairi
BUG: 482508 Signed-off-by: Somsubhra Bairi <[email protected]>
2024-10-17kitemlistcontroller: process forward/back buttons when double-clickingWolfgang Müller
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 <[email protected]> CCBUG: 485295
2024-10-12KFileItemModel: fix `setData` in the renaming usageJin Liu
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.) BUG: 481561
2024-08-28KItemListRoleEditor: minimize resize() occurencesMéven Car
Adjust document width to match its widget width. BUG: 479695
2024-08-23Use QLocale to display localized time role groupJérôme Lécuyer
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 BUG: 488088
2024-08-17KStandardItemListWidget: remove obselete commentYifan Zhu
2024-08-16Fix display of filename ampersands in actionsJohn Veness
If you added the "Actions for..." button to the toolbar, filenames that contain "&" would not appear correctly in that button. This MR fixes that, and also the button that appears when using "Delete" with selection mode. BUG: 491684
2024-08-13KStandardItemListWidget: select by number of unicode charsYifan Zhu
Previously during rename, the number of QChar is used for selection, which might be different from number of unicode characters. Test plan: - create the file zz❤️❤️.txt - rename the file - verify that the first 4 characters are correctly selected, which didn't work before the patch. BUG: 466814
2024-07-31Kitemlistcontroller: only accept doubleclick for left mouse buttonMéven Car
Add test for double-click activation. BUG: 485295
2024-07-27Port from KIconLoader::drawOverlays to KIconUtils::addOverlaysNicolas Fella
The latter is what most other projects use
2024-07-22Notify users if authorization is required to proceedFelix Ernst
Previous to this commit entering a folder without read access would show the non-descriptive error message "Could not enter folder". If the user actually is not allowed to view the contents of the folder, this is indeed true and this commit will preserve this message as is. However, if an admin protocol is installed, users can actually view the contents of most folders after authorizing themselves as administrators. So this commit changes the error message in those specific circumstances to instead read "Authorization required to enter this folder." and provide a button to authorize themselves. This button is the "Act as Administrator" action. If no admin protocol is installed, this commit has no effect. The idea for this change came from Harald Sitter. I receive funding for changes like this by the Next Generation Internet Initiative, which (as I understand it) will no longer provide funds for future projects like this if the current EU draft budget goes through as it is.
2024-07-18Port away from deprecated KIconEffect APINicolas Fella
2024-07-17Remove dead codeManuel Alcaraz Zambrano
2024-07-05Add support for Plasma's global smooth scrolling settingNathan Misner
KItemListSmoothScroller now checks whether smooth scrolling is enabled globally and listens for any changes to the setting via DBus.
2024-06-16Prefer en_US, "colour" -> "color"Marius P
2024-05-21Haiku build fixesSchrijvers Luc
Co-authored-by: Gerasim Troeglazov <[email protected]>
2024-05-18Avoid implicitly selecting itemsFelix Ernst
Items should only be selected if the user wants to act on them. However, previous to this commit we sometimes selected items even when there is no reason to assume that the user would like to act on them. Such selections are dangerous because they make it more likely that the user manipulates items by accident which they never even explicitly selected. Example: The "Up" action is used to navigate to the parent folder. This will implicitly select the folder one emerged from after opening the parent folder, so just one accidental press of the Delete key will lead to data loss if the press goes unnoticed. This scenario would have been avoided if no folder had been selected automatically. The above example becomes even more dangerous if the user is acting with elevated privileges. The following implicit selections of items are being removed: - Selecting items that are being activated - Selecting folders one emerges from Even though these items will no longer be selected after these actions, they will still be marked as current. The only downside I see is that our indication of which item is "current" is a lot weaker than the selection highlight, so it might be more difficult to spot which folder one has emerged from. However, this could be counter-acted with some other temporary indication if this really turns out to be a problem. The only downside I see is that our indication of which item is "current" is a lot weaker than the selection highlight, so it might be more difficult to spot which folder one has emerged from. However, this could be counter-acted with some other temporary indication if this really turns out to be a problem. BUG: 424723
2024-05-08view: Add setting to trigger user set action with double clickGeorge Florea Bănuș
Default action is select-all.
2024-04-05KItemListController: don't create rubber band for a right click in an empty ↵Amol Godbole
region Rubber band was being incorrectly created for a right click in an empty region. Handle this case in KItemListController::onPress(). BUG: 484881
2024-04-04kitemlist: don't open dir when double-click on expand arrowMéven Car
BUG: 484688
2024-03-30Fix layout in Compact View mode for RTLEugene Popov
This MR fixes the layout in Compact View mode when items are grouped.
2024-03-30Fix selection marker for RTLEugene Popov
This MR makes the selection marker to be shown on the right in RTL mode.
2024-03-27Better support for RTLEugene Popov
This MR fixes some issues related to RTL scripts: - wrong layout in Compact View mode - broken horizontal scrolling in Icon View and Details View modes - broken navigation with left and right arrow keys in Details View mode BUG: 484012 BUG: 449493
2024-03-25Fix right-mouse click crashes on WindowsJulius Künzel
2024-03-23KItemListView: Improve scrollToItem()Eugene Popov
Prevent an item with a long name from scrolling to the right edge when navigating in Compact View mode.
2024-03-09KItemListController::onPress: remove unused screenPos argumentMéven Car
NO_CHANGELOG