Commit graph

267 commits

Author SHA1 Message Date
Peter Penz 5798e081f5 Let additional mouse buttons trigger history navigation
Thanks to Sebastian Dörner for the patch!

REVIEW: 101335
BUG: 181823
FIXED-IN: 4.9
2012-03-19 16:53:53 +01:00
Peter Penz d6e10a5942 Use sub-menus for the "Sort By"- and "Additional Information"-menu
This allows doing some grouping for the visible roles by e.g. Image,
Document, Music or whatever.
2012-03-14 16:53:31 +01:00
Peter Penz f041099904 Remove RolesInfoAccessor
Now KFileItemModel provides a way to access the available roles
including their translations. Note that the 3 roles "comments",
"rating" and "tags" have not been implemented yet in KFileItemModel
and turning them on does not work currently.
2012-03-13 16:29:45 +01:00
Peter Penz 956d32ed16 Prevent endless scrolling of list when dragging items
BUG: 295584
FIXED-IN: 4.8.2
2012-03-09 17:58:57 +01:00
Peter Penz 475f8b1261 Details view: Allow to turn off expandable folders like in Dolphin 1.7
The option for turning off expandable folders has been removed with
the new view-engine. Due to several requests this option has been
readded again.

As for 4.8.x no new user-interface strings may be introduced, the
line
  ExpandableFolders=false
must be manually added below the section "[DetailsMode]" in the file
~/.kde/share/config/dolphinrc if the expandable-folders feature
should be disabled.

Thanks to H.H. "cyberbeat" for the initial patch!

BUG: 289090
FIXED-IN: 4.8.2
2012-03-09 16:19:19 +01:00
Peter Penz 08a485349f Allow custom sorting of details-view columns
Fix regression that Dolphin 2.0 did not allow to adjust the sorting
of the details-view columns.

BUG: 164696
FIXED-IN: 4.8.2
2012-03-07 22:18:59 +01:00
Peter Penz 90e6190f13 Update siblings when turning on/off grouping 2012-02-28 17:17:55 +01:00
Peter Penz ee31c709a5 Finetuning of margins and alternate row colors
Thanks to Martin Zilz for the ongoing support.
2012-02-28 16:43:53 +01:00
Peter Penz 21a5a890b3 Whitespace cleanups and documentation fixes 2012-02-23 17:28:03 +01:00
Peter Penz dbc5fd7a49 Fix alternate backgrounds when enabling grouping
Up to now the alternating backgrounds just have been calculated by
checking whether the item index is odd. This does not work well when
grouping is enabled: In this case the alternate background color
of the first item of a group should stay consistent.
2012-02-22 18:31:03 +01:00
Peter Penz bdd0fdf246 Fix possible crash if no model is set
When updating the siblings-information by e.g. a call to
setSupportsItemExpanding() it is possible that the model is not
set yet.
2012-02-21 17:20:27 +01:00
Peter Penz 7deb601f31 Don't trigger assert when switching to details-view
If the visible roles of the details-view are equal to the visible roles
of other views, then switching to the details-view will trigger an
assert because the invisible roles don't get updated.

Thanks to Frank Reininghaus for the detailed analyses!

In the context of this fix optimizations have been done when switching
view-modes: The "don't-animate-workaround" could be removed.

BUG: 294531
FIXED-IN: 4.8.1
2012-02-21 16:49:38 +01:00
Peter Penz 51bd6cfdfa Remember the row- and column-information for visible items
Up to now KItemListView has not been aware to which column or row
an item belongs to. This has been handled internally in
KItemListViewLayouter. But for deciding whether a move-animation
might result in overlapping items it is mandatory to be aware about
the column/row. The current approach to guess a column/row change
by comparing the source- and target-rectangle works very well but
breaks on some corner-cases when e.g. zooming.

Now the layouter allows to access the information. This assures
that in the vertical alignment no move-animation is done between
rows and the in the horizontal alignment no move-animation is
done between the columns.
2012-02-17 16:02:14 +01:00
Peter Penz a5becac42c Compact view: Fix of left margin for first group 2012-02-16 16:37:36 +01:00
Peter Penz 613758b5ec Compact view: Padding- and margin-improvements for grouped alignments 2012-02-16 16:23:00 +01:00
Peter Penz 749362987b Folders Panel: Use the whole width as selection region
As no rubberband-selection is enabled for the Folders Panel it does
not make sense to keep the selection region as small as possible.

BUG: 294111
FIXED-IN: 4.8.1
2012-02-15 16:20:47 +01:00
Peter Penz cf72e48111 Minor padding optimizations 2012-02-14 23:27:01 +01:00
Peter Penz 83130d8e16 Details view: Fix filter issue with sibblings
When the filter has been enabled, the sibblings got not updated. Explicitely
update the sibblings when inserting, removing or moving items. For layouting
implicitely update the sibblings only for recycled widgets.
2012-02-14 23:00:48 +01:00
Peter Penz 55f46ceb9c Details view: Siblings fixes
The siblings should only range within one group.
2012-02-14 20:59:08 +01:00
Peter Penz 0397658b81 Details view: Fix indicator-branches
Up to now no indicator-branches have been drawn when showing a tree. The patch
fixes this so that that the style-dependent branches are drawn.

The main part of the patch is the implementation of
KItemListView::updateSiblingsInformation(). Most of the other changes are
related due to an internal renaming of the expansionsLevel-role to
expandedParentsCount and some related cleanups.

BUG: 290276
FIXED-IN: 4.8.1
2012-02-14 18:05:29 +01:00
Peter Penz 056d12d60f Group header layout fixes
- Don't use a margin for the first group header
- Provide margins between the groups
- Use a more subtle coloring
- Prevent animation glitches when resizing a window
2012-02-11 18:04:53 +01:00
Peter Penz e29e1cda15 Icon-rectangle and selection-toggle optimizations
- No padding should be applied to the icon-rectangle
- Base the selection-toggle size on the icon-size of the style not
  the actual pixmap content, as this might lead to smaller selection-toggles
  when having pixmap-previews with a small height.
2012-02-09 16:05:03 +01:00
Peter Penz 03415d9078 Layout optimizations
- Differ internally between margins and paddings
- Add a small padding in the icons-view and the compact-views
- Optimize the width of the icons-view if previews are shown
2012-02-08 17:48:32 +01:00
Peter Penz 3c83d8f14d Drag and drop: Adjust destination if the item is no directory or desktop-file
The URL of the view should be used as destination target if a dropping is not
done above a directory or desktop-file.

BUG: 293511
FIXED-IN: 4.8.1
2012-02-08 17:48:28 +01:00
Peter Penz a3a19f4a06 Compact view: Don't hide items at the bottom when grouping is turned on
When grouping has been turned on, it was possible that items aligned
at the bottom have been hidden.

BUG: 291640
FIXED-IN: 4.8.1
2012-02-07 17:18:47 +01:00
Peter Penz 5369ee6819 Group header improvements
- Use a simpler background and colors as suggested by Martin Zilz.
  This is just an early draft, I need to post some comparison screenshots to
  Martin for review.
- Fixes of some layout issues that have been revealed because of adjusting
  the group header heights.
- More clever animation/no-animation detection when doing listview-property
  changes in parallel.
2012-02-06 23:31:49 +01:00
Peter Penz 7af39fb960 Fix potential endless loop in layout
Usecase:
- No scrollbar is shown
- Window size will be decreased so that a scrollbar gets necessary

The decreased window size minus the space required for the scrollbar
results in a relayout of the items. In 99 % of all
cases a decreased window size won't result in showing more items in parallel in
comparison to a larger window size. However in the remaining 1 % this can
happen (e.g. see bug 293318 for a sample). This results in an endless loop as
now no scrollbar is required anymore, the layout changes again, the scrollbar
is required again, ...

BUG: 293318
FIXED-IN: 4.8.1
2012-02-05 19:22:34 +01:00
Frank Reininghaus d0933155e2 Replace setExpanded(const QSet<KUrl>&) by expandParentItems(const KUrl&)
The use case of this function (Folders Panel) requires the expansion of
the parent items of a single URL, so it's not needed to handle a full
set of URLs in this function. Moreover, the issue that not only the
parents, but also the URLs themselves were expanded is fixed by this
commit.
(cherry picked from commit 89082ca391)
2012-02-05 15:59:59 +01:00
Peter Penz 72af3125a8 Icons view: Layout optimizations
- Assure that landscape-previews use the whole available width of the icon-area
  instead of only using the square width. This waste of space occured if the
  text-width was larger than the icon-width.

- Only use one margin instead of two between the icons and the text to improve the
  visual appearance (thanks to Martin Zilz for the hint)

BUG: 293268
FIXED-IN: 4.8.1
CCMAIL: martin@kreativkonzentrat.de
2012-02-04 22:22:19 +01:00
Peter Penz 1041f340a2 Show the value "Unknown" for the item-count only after it has been verified
During determining the item-count for directories just show an empty string
until either the item-count has been calculated or if the item-count is unknown.

Thanks to Nikita Skovoroda for the initial proof-of-concept patch.

BUG: 291823
FIXED-IN: 4.8.1
2012-02-03 23:12:12 +01:00
Peter Penz 313a03d448 The autoscroll timer should be only a single-shot timer 2012-02-03 17:06:59 +01:00
Peter Penz e20a6e59ea Folders Panel: Show expansion toggles for directories on ISO-images
When counting the number of sub-directories consider unknown file types
as potential directories. In the "worst case" an expansion toggle will be
shown although the directory contains only files, however from a performance
point of view this seems to be an acceptable compromise.

BUG: 292642
FIXED-IN: 4.8.1
2012-02-03 16:15:22 +01:00
Peter Penz 452c8b8ec8 Fix sorting issue when sorting by "size"
Root cause of the issue was an overflow in:
result = a - b;
where result is 'int' and a and b are 'KIO::filesize_t'.

BUG: 293086
FIXED-IN: 4.8.1
2012-02-02 16:03:15 +01:00
Peter Penz 110dd6de3c Fix pending zooming animation
If doLayout() is invoked with the 'NoAnimation' hint, it must be assured
that any ongoing animations are stopped.
2012-02-02 09:39:28 +01:00
Frank Reininghaus 6db0bec325 First version of a unit test for KItemListController
At the moment, only key press events are tested, and the current item
and selection after the event are verified.
Moreover, this commit makes sure that
KItemListController::keyPressEvent() really does not select anything
if the selection mode is NoSelection.
(cherry picked from commit 7457f4868c)
2012-02-01 22:08:16 +01:00
Peter Penz e854a3221a KFileItemModelRolesUpdater: Optimize updates
The asynchronous resolving to bypass performance bottlenecks is not necessary
anymore as multiple ranges can be inserted in one step now. This solves the issue
that e.g. opening a tree resulted in temporary unknown icons for a short period
of time.
2012-02-01 20:47:19 +01:00
Peter Penz 39348650d5 Don't animate items if the number of grid elements has been changed
Having animated items is useful when e.g. deleting or inserting one
item or when the size or position slightly changes by increasing the
zoom level or the window size. However if the number of rows or columns
change, the animation gets obtrusive and in this case lets just apply
the final layout.
2012-02-01 15:33:27 +01:00
Frank Reininghaus 530b91b9c7 Fix keyboard navigation issue when Home or End are pressed
The problem was that m_keyboardAnchorIndex and m_keyboardAnchorPos were
not updated when Home or End are pressed. This causes the following
unexpected behavior in Icons View: Press Home, then Right, then Down,
then Home, finally Down. One would expect that the first item in the
second row is the current item then, but before this commit, it was the
second one because the controller still remembered that the second
column was active before Home was pressed.
(cherry picked from commit 999234a94a)
2012-01-31 23:19:09 +01:00
Peter Penz 3872938944 Animation optimizations
Prevent that the moving-animation crosses other items when zooming or
changing the window size.
2012-01-31 21:24:38 +01:00
Peter Penz 8121bb14b1 Fix sorting issues
For some roles the sorting has not been implemented.

BUG: 292941
FIXED-IN: 4.8.1
2012-01-31 17:18:05 +01:00
Peter Penz 03bed41e73 Only move the items if at least one direction is within the item size 2012-01-30 16:52:06 +01:00
Peter Penz 6c39b4622f Further animation optimizations
- Assure a proper minimim width in the compact mode.
- Don't calculate the old position of hidden items to animate the
  moving. Just show them directly.
2012-01-30 13:01:13 +01:00
Frank Reininghaus 0a33aad3d2 Fix crash in Compact View if view height is smaller then item height
CCBUG: 292816
FIXED-IN: 4.8.1
(cherry picked from commit f5ecaee9c4)
2012-01-30 10:10:15 +01:00
Peter Penz d05ffe96f9 Make moving animations less obtrusive
Only animate the moving of items if the new position is within the same
row or the same column. Otherwise just fade in the icon on the new position.
This makes the the animations when resizing the window or changing the zoom-level
a lot more pleasant.

CCBUG: 289238
2012-01-29 18:31:57 +01:00
Peter Penz 2f3e84d8fb Fix regression: Respect "natural sorting" setting
BUG: 292270
FIXED-IN: 4.8.1
2012-01-28 22:10:47 +01:00
Peter Penz a89ed94378 Assure to mark an item as unhovered on a drag-leave event
BUG: 292501
FIXED-IN: 4.8.1
2012-01-28 11:04:49 +01:00
Frank Reininghaus c7d6f43a94 Handle folder names containing spaces correctly in the Folders Panel
The problem was that KFileItemModel::setExpanded() used KUrl::url()
to determine the names of the subfolders. This method encodes special
characters, such that comparing the folder names with the unencoded URLs
stored in the model fails.
Using KUrl::path(), which does not encode special characters, fixes the
problem.

CCBUG: 291781
FIXED-IN: 4.8.1
(cherry picked from commit 80d9bfec58)
2012-01-25 21:35:00 +01:00
Frank Reininghaus fbb73966b2 Make sure that Control+click toggles the selection state
This commit fixes a regression caused by the recent commit
9f711b5f2e.
CCBUG: 292250
(cherry picked from commit 84a9cc4bf6)
2012-01-23 19:38:26 +01:00
Frank Reininghaus a043163b61 Do not make items invisible when turning off previews
This commit fixes a problem in KItemListView::doLayout(): This function
assumed that firstVisibleIndex is a constant.
However, if the view is scrolled to the bottom with previews enabled,
and then previews are disabled (and the icon size is much smaller
without previews), this function changes the scroll offset, which also
changes the the first visible index. Using the unchanged variable causes
trouble later on (i.e., it makes items which are actually inside the
view area invisible).
lastVisibleIndex is not needed before the scroll offset change and is
const after that, so its calculation is moved a few lines down.
CCBUG: 291841
FIXED-IN: 4.8.1
(cherry picked from commit cc8f5b4939)
2012-01-19 19:57:51 +01:00
Frank Reininghaus 0b0b2cba93 Make PageUp/PageDown work in Dolphin's new view engine
BUG: 288748
FIXED-IN: 4.8.0
REVIEW: 103721
(cherry picked from commit e56a363aa6)
2012-01-18 10:46:47 +01:00