| Age | Commit message (Collapse) | Author |
|
Selection background was 0.32 alpha of QPalette::Highlight resolved
against the widget's current palette group. On dark color schemes the
Inactive group sources Highlight from Colors:Window (per KColorScheme's
ChangeSelectionColor effect), so a near-black Window at 0.32 alpha
leaves the selection nearly invisible. Force the Active group so the
scheme's Selection color is used, and raise the alphas (selected
0.32 → 0.70, selected+hovered 0.40 → 0.85, hover-only 0.06 → 0.12) for
adequate contrast on all-dark themes.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
|
|
|
The natural sort comparison helpers compare Qt::strong_ordering values
against the literal 0. The compiler reads that 0 as a null pointer
constant and warns under -Wzero-as-null-pointer-constant.
Use the named ordering helpers is_lt, is_gt and is_neq instead, which
express the same checks without a literal 0. The plain integer
comparisons in the surrounding code are left as they are.
|
|
The updater must not react to its own setData() changes, or it would
resolve the roles again. Instead of disconnecting slotItemsChanged()
around every setData() and reconnecting (a dozen times), add a
setModelData() helper that sets a guard while calling setData(), and
make slotItemsChanged() return early while it is set. The view still
gets itemsChanged and repaints.
This also drops a stray disconnect of itemsMoved (never reconnected)
that a hover-sequence block did while duplicating the itemsChanged
connection.
|
|
When scrollTo() is asked to move to the position the scrollbar already
holds (clamped, e.g. an item at the bottom, or a sub-pixel offset), no
animation runs and scrollingStopped() was never emitted. Callers waiting
for it stayed blocked: KItemListView::scrollToItem() delegates to scrollTo
for any non-zero offset, and DolphinView::renameSelectedItems() only opens
the inline rename editor once scrollingStopped() arrives. So inline rename
silently did nothing for the affected items.
Emit scrollingStopped() in the no-op case too, and add a regression test.
|
|
KIO_VERSION and KFILEMETADATA_VERSION checks up to 6.23 are always true
given the Qt 6.4 / KF 6.23 minimum versions.
|
|
Add an explicit group role to Dolphin views so items can be grouped independently from the active sort role.
Previously, Dolphin's grouped view always used the current sort role as the grouping criterion. This meant that grouping and sorting were tied together, for example grouping by type also required sorting by type.
This change adds a separate Group By menu. It replaces the previous Show in Groups toggle and allows the user to disable grouping, keep the old Same as Sort behavior, or explicitly group by a selected criterion.
When an explicit group role is set, the model keeps groups stable and uses the normal sort role as a secondary key inside each group. The roles
updater also receives the active group role, so roles used only for grouping are still updated correctly.
BUG: 416134
CCBUG: 510670
CCBUG: 513235
CCBUG: 46393
|
|
|
|
Postfix increment creates an unnecessary temporary copy.
|
|
|
|
When items were pressed, we never called the
updateAdditionalInfoTextColor, which caused
some of the text colors get out of sync.
This was especially noticeable in details view
when using an accent color that makes the font
color change to preserve readability.
BUG: 508329
|
|
Parent QMenu to the main window so it is owned and deleted with it.
Register KItemListContainerAccessible in Qt's accessibility cache so
Qt takes ownership and deletes it with the container widget.
|
|
newHoveredWidget is already guarded non-null by the enclosing if-block;
!isAboveSelectionToggle is always true after the preceding early return.
Remove both dead sub-expressions.
|
|
cppcheck warns about calling virtual functions during construction
because dynamic dispatch is not yet fully active at that point.
Replace childCount() with its concrete implementation
view()->model()->count() directly.
|
|
Both classes own a raw pointer freed in the destructor. The implicit shallow
copy would cause a double-free.
Mark copy constructor and operator= as = delete.
Found with cppcheck
|
|
Dolphin reported an incorrect item count in the "Size" column for directories containing 200 or more entries.
Use KIO::ListJob::ListFlag::ExcludeDotAndDotDot and ExcludeHidden to filter entries at the source.
Use a local counter (totalCount) captured via std::shared_ptr in the lambda to ensure each scan job starts from zero and maintains its own state.
Add a fast path using list.size() when showDirectoriesOnly is false to improve performance.
BUG: 509150
|
|
The previous implementation forced a custom background colour
before delegating to the style's PE_PanelItemViewItem primitive.
This interferes with theme‑specific drawing and results in a hard‑coded,
non‑themed highlight that breaks styling across themes.
Remove the explicit brush assignment, allowing the style to
paint the background itself. The focus rectangle handling remains
unchanged and is still drawn only for the active item.
And pass the State_MouseOver to focus rect style option when hovered.
|
|
The typed keys are displayed in the status bar while also displaying
which file name they were auto-completed to (i.e. which file was
selected because of the typing).
This commit contains some refactoring to keep the original status bar
functionality working as expected.
This commit also separates DolphinMainWindow from DolphinStatusBar which
is great news architecture-wise. The status bar is encapsulated within
the DolphinViewContainer.
|
|
This method would adjust the document to "reasonable size" but such
size is set nowhere, nor there is any indication what is a reasonable
size. This leads to the rename field being a lot wider than the
actual item size, making it look broken.
Removing this just keeps the document size same width as
the widget itself, making it more sensible and less broken looking.
|
|
Remove unused `referenceItem` variable in KFileItemModelRolesUpdater
and add Q_FALLTHROUGH() annotation for intentional SingleSelection →
MultiSelection fallthrough in KItemListController.
|
|
highlightEntireRow is true"
This reverts commit 17e55c976581aa58b4500e426fb2925a3d45c308, making drag and drops on non-selected item rows count as drops on the folder of the view, which was the intended behaviour.
The commit being reverted here makes it very difficult to drag and drop items between Dolphin windows, tabs, and split views, whenever the view is full of items. Drag and drop should be a natural and easy interaction with the file system, aiming at the margins to the sides of the view to even be able to drop an item is IMO very uncomfortable. This was also directly pointed out by Cristoph Feck in the bug report https://bugs.kde.org/show_bug.cgi?id=515439#c4.
The bug report also has only one active requester and no duplicates. This is insufficient reason to encumber such a basic behaviour as drag and drop.
|
|
Natural sorting already handled plain numeric chunks, but names containing dots between numeric segments were still ordered lexically in important cases. This broke expected ordering for decimal-style names like 0.09 and 0.1, and for version-like names such as v1.2.3 and v1.2.10.
Teach KFileItemModel's natural string comparison to recognize dotted numeric chains instead of relying solely on QCollator's numeric mode. Compare two-part numeric chains (e.g. 0.09 vs 0.1) as decimal values, and compare longer chains segment by segment like version numbers, while still treating real file extensions separately so names like 1.09.txt keep working correctly.
Add a direct unit test for KFileItemModel::stringCompare covering decimal-style names, version-like dotted numeric names, numeric basenames with extensions, leading-dot names, and the non-natural sorting fallback.
BUG: 411707
|
|
non-Breeze QStyles
For non-Breeze QStyles Dolphin is currently drawing the full highlight effect for items even when they are deselected.
The issues is that it treats keyboard focus as the same state as a selected state, resulting in a persisting highlight effect.
This patch adds and extra check to paint `State_Selected` only when `m_selected` is true, thereby fixing the problem.
**TEST PLAN**
Tested with Oxygen, Fusion, Kvantum, Darkly, MS Windows 9x.
- all of the styles had the issue with the full selected state persisting on mouse deselect
- after this change all of the styles lost the full selected state and retained only their keyboard focus state
**SCREENSHOTS**
Before (MS Windows 9x):

After (MS Windows 9x):

|
|
We should avoid custom painting since that will cause issues with
Union and other styles. We however still use the old hardcoded painting
for Breeze style, which can be removed when Breeze 6.8 is released.
For other styles, we draw using the primitives the QStyle provides.
Also make the icon items less wider for better information density.
CCBUG: 508294
BUG: 508465
|
|
Inline rename was canceled when the edited item scrolled out of view. Scrolling could both finish the edit and recycle the item widget, causing the typed name to be lost.
Keep the inline rename editor alive while the item is temporarily offscreen. Update the editor geometry on scroll, avoid recycling the widget while it is being edited, and suppress the temporary FocusOut triggered by hiding the editor.
If the user interacts with another item while the edited one is offscreen, finish the hidden edit first so normal selection behavior is preserved.
BUG: 506884
|
|
To allow to cancel an edit role when the widget starts being animated.
This was hooked to a function not a signal.
|
|
|
|
For this widget.
If a file is being moved due due to external events, an animation may
start, in which case we better cancel the edit.
If we hook this at the animation start instead of checks spread out, we
can't miss this cancellation anymore.
KStandardItemListWidget gets a cancelRoleEditing slot to cleanly cancel
editing and clean up its internal state.
|
|
Prevent a mem-leak detected with asan.
|
|
Currently, Dolphin's filter bar defaults to plain text, but it actually has a hidden regex functionality too: it tries to auto-detect and switch to a regular expression if characters like '*', '?', or '[' are present in the search string.
This approach has a couple of issues. First, the regex/wildcard functionality is completely hidden from the user. Second, the auto-detection is flawed because those are perfectly valid characters in Linux filenames. If a user tries to filter for a file literally named [draft].txt, the auto-switching kicks in and causes unexpected behavior.
This MR fixes this by making the filtering modes explicit through a ComboBox at the side of the filter bar, with the options 'Plain Text', 'Glob' and 'Regular Expression'. It also adds a button to toggle the case sensitive matching. A visual feedback for when the user is inputting an invalid expression has also been implemented by turning the bar background red and making appear an error symbol.
|
|
BUG: 433937
|
|
So the selection manager can consider the selection has changed.
This makes sense as when editing file name you can only have a single item selected.
BUG: 453262
|
|
Like with leftclick, we should check this for rightclick.
If user has highlightEntireRow enabled and right clicks an
item, the item should be activated.
BUG: 508356
|
|
|
|
|
|
Avoids the item being considered dirty when *we* changed it.
It is guarded in most places but wasn't done in the pixmap animation stuff
causing the item considered dirty whenever hovering it.
|
|
This all seems to be done by the PreviewJob in KIO already.
|
|
is true
Currently when dragging and dropping items in Details view,
even if the "Open files and folders" setting is set
"By clicking anywhere on the row", drag and drop
still behaves differently.
Instead, make the drag and drop follow the setting:
If clicking anywhere on the row causes actions, so
should dropping anywhere on the row.
BUG: 515439
|
|
The preview job does an async stat on the file, so we might as well
use its information to determine the icon.
Also only determine mime type in the final "ResolveAll" step since
it will initially resolve roles but mime type isn't necessarily fast.
|
|
We already support dropping onto desktop files.
This is also something that KDirOperator did but Dolphin does not.
|
|
All temporary file types are identified by glob (file extension),
so we don't need to resolve the final mime type here.
The model filter is generic but effectively right now only used
for filtering temp files. Should this change in the future, it
needs to be revisited.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The mouse events need to modify the keyboard anchor assignments as well,
because selecting an item with a mouse and then navigating with keyboard
wouldn't follow the same selection.
BUG: 508609
|
|
So the new folder is in view.
|
|
Q_CHECK_PTR (other than the name suggests) is intended only to check the
success of memory allocations.
Using it for any pointers instead can be misleading due to the
"Out of memory" log printed in case of hits.
|