┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kstandarditemlistwidget.cpp
AgeCommit message (Collapse)Author
2022-04-04Revert "KStandardItemListWidget: handle RtL drawing properly"Felix Ernst
This reverts commit 3ce9d1d19e081fbb9acf020f15652175673bcf5c. This reverts commit ddba4f5fd88c4fa855e3f2eb0d9d95a6290d150a. Aside from the two bugs mentioned below, this also fixes another regression: The spacing on the left of the view does now once again follow the size of its column header. BUG: 451704 BUG: 451341
2022-03-15Fix some compile error against qt6Laurent Montel
2022-02-26KStandardItemListWidget: don't double up the expansion offsetJan Blackquill
2022-02-25Merge branch 'release/21.12'Kai Uwe Broulik
2022-02-25KStandardItemListWidget: handle RtL drawing properlyJanet Blackquill
BUG: 449211
2022-02-23Fix rating pixmap alignment on high-dpi screensKai Uwe Broulik
When calculating layout geometry based on the pixmap size, one needs to divide by `devicePixelRatio`
2022-02-23Ignore empty roles for textRect calculationKai Uwe Broulik
Avoids a text rect taller than the area that actually contains text, as can be seen by hovering files in a folder with "additional roles" that a given file does not contain.
2022-02-13Fix zooming animationEugene Popov
Current implementation of the zooming animation is a bit buggy. This MR fixes the following issues: * in the Icon view mode, the icons sometimes "jump" * in the Compact view mode, the labels sometimes are cut off BUG: 449179
2022-01-29Fix my previous bad mergeFelix Ernst
I failed to notice that the changes didn't apply cleanly. With this commit everything should be a-okay again.
2022-01-29Merge branch 'release/21.12'Felix Ernst
2022-01-29Revert "[DetailsView] Improve zooming"Eugene Popov
This reverts commit 7908aff3b5ebe4484d391c1fc4797e9dae2300b2. Reverting this commit will fix the issue of not being able to rename the last file in Details View and will also make the items in Details View and Compact View have the same height. BUG: 447215 FIXED-IN: 21.12.2
2022-01-16Full row highlight implementationTom Lin
This commit implements full-row selection and hover highlights for the details view mode. This commit also contains fixes for 444680, 444753, both uncovered during this change. BUG: 181438 BUG: 444680 BUG: 444753 FIXED-IN: 22.04
2021-12-28Add name-only tooltip and make logicalHeightHints a pair of qreal and boolLeo Treloar
2021-07-18[DetailsView] Improve zoomingEugene Popov
Under some conditions, when zooming, only the size of the icon is changed, but not the entire item, which visually doesn't look good. The main idea of this MR is that when scaling the whole element should be resized, not just the icon, so I came up with some zoom levels for the main icon sizes. With this commit, zooming will resize the entire element, even if the resizing of the icon doesn't affect the size of the entire element.
2021-07-04Add support for hover sequence thumbnails (via ThumbSequenceCreator)David Lerch
This shows a slideshow of thumbs when the user hovers a file item.
2021-04-19When renaming files, move to next file using tab key or up/downMéven Car
To rename previous file: Up or Shift-Tab To rename next file: Down or Tab Credit goes to msciubidlo FEATURE: 403931 FEATURE: 269987 BUG: 334533 FIXED-IN: 21.08
2020-11-12Fix qrc iconAlexander Lohnau
Apparently the icon was not null, because the mimetype was known. But there was no icon associated with it and we got an icon which is not null, but has a null pixmap.
2020-11-04Move m_textInfo to fix ctor warning, and document why it's protected.Chris Holland
2020-11-01Use QString::rightRef() as suggested by clazyElvis Angelaccio
2020-11-01Fix warnings about scaling pixmapsMartin T. H. Sandsmark
2020-10-23Compile with QT_NO_KEYWORDSAlexander Lohnau
2020-10-23Compile without foreachAlexander Lohnau
2020-10-15Port away from QList::toSet()Elvis Angelaccio
The QSet range constructor requires Qt 5.14. In `DolphinView::slotHeaderContextMenuRequested()` the conversion from QList to QSet was pointless, so we just use a QList now.
2020-08-30Merge branch 'release/20.08'Alexander Lohnau
2020-08-30Fix file preview for desktop files with absolute icon pathsAlexander Lohnau
BUG: 423326 FIXED-IN: 20.08.1
2020-08-25Output of licensedigger + manual cleanup afterwards.Elvis Angelaccio
Unfortunately licensedigger does not strip the trailing * characters. While at it, use a common style for all source files.
2020-07-12Fix selection rect after porting from QFontMetrics::width()Ismael Asensio
After porting from QFontMetrics::width() to QFontMetrics::boundigRect().width() in system/dolphin!10 we have a visual bug on selection rects, that can be seen on details and compact modes. While from https://kdepepo.wordpress.com/2019/08/05/about-deprecation-of-qfontmetricswidth/ the use of `boundingRect()` would seem the right option to use (and I struggle to get the difference between the two methods when applied to a whole string and not a single char), in this case the `horizontalAdvance()` seems to return the value we need. BUG: 421973 FIXED-IN: 20.07.70
2020-07-12Fix selection rect after porting from QFontMetrics::width()Ismael Asensio
After porting from QFontMetrics::width() to QFontMetrics::boundigRect().width() in system/dolphin!10 we have a visual bug on selection rects, that can be seen on details and compact modes. While from https://kdepepo.wordpress.com/2019/08/05/about-deprecation-of-qfontmetricswidth/ the use of `boundingRect()` would seem the right option to use (and I struggle to get the difference between the two methods when applied to a whole string and not a single char), in this case the `horizontalAdvance()` seems to return the value we need. BUG: 421973 FIXED-IN: 20.07.70
2020-05-29Port away from deprecated QFontMetrics::width()Elvis Angelaccio
While the documention says to port to QFontMetrics::horizontalAdvance(), what we actually need is not the horizontal advance, but the width of the text. So we need to port to QFontMetrics::boundingRect().width(). Quoting from https://kdepepo.wordpress.com/2019/08/05/about-deprecation-of-qfontmetricswidth/: "Since it was not clear from the confusingly named function QFontMetrics::width() that it actually returned the horizontal advance, instead of the bounding width, this method is now obsolete. You must port to either QFontMetrics::horizontalAdvance() or QFontMetrics::boundingRect().width(). Please make sure you are aware of the difference, and do not port blindly. I am pretty sure that in most cases QFontMetrics::boundingRect() is what you want, unless you are writing custom text shaping/layouting code. Using the wrong function can cause clipped text or text that suddenly wraps to the next line despite calculating the width that it needs."
2020-05-28Port to non-deprecated variant of QPixmapCache::find()Elvis Angelaccio
We need to pass the pixmap by address, not by reference.
2020-05-28Add some missing const qualifiersElvis Angelaccio
2020-05-18Left-elide file/folders while keeping their extension visibleMéven Car
Summary: Tweak behavior introduced in D19471. BUG: 404955 Test Plan: Before: {F8325282} After: {F8325283} {F8325284} Reviewers: ngraham, #dolphin, elvisangelaccio, #vdg Reviewed By: ngraham, #dolphin, elvisangelaccio, #vdg Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D29794
2019-11-09Remove unnecessary semicolons after Q_UNUSEDElvis Angelaccio
GIT_SILENT
2019-09-16[KStandardItemListWidget] Request the pixmap size we want and let the icon ↵Kai Uwe Broulik
loader scale it I noticed that depending on the configured icon size it would spend a significant amount of time in KPixmapModifier::scale. I don't see a point in requesting a fixed icon size and then scale it down manually as opposed to having the KIconLoader do the scaling for us. Especially for SVGs it could then even serve us a properly rendered SVG for this size rather than a scaled down pixmap version. Differential Revision: https://phabricator.kde.org/D22116
2019-09-08GIT_SILENT: minor qstring optimizationLaurent Montel
2019-08-24Middle-elide file/folder labels so the extension is always visibleNate Graham
Summary: This ensures that the filename extension is always visible, and also is just a nicer way to elide file and folder names in general. BUG: 404955 FIXED-IN: 19.12.0 Test Plan: Details view: {F6648784} Icons view with limited label height: {F6648785} Reviewers: #dolphin, #vdg, elvisangelaccio, GB_2 Reviewed By: #dolphin, #vdg, elvisangelaccio, GB_2 Subscribers: GB_2, ndavis, rooty, elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D19471
2019-05-12Fix indentationElvis Angelaccio
GIT_SILENT
2018-10-24[KStandardItemListWidget] Pass icon state to overlay painterKai Uwe Broulik
Ensures the overlay is painted in the same icon state, especially the selected one so dark overlays turn white. Differential Revision: https://phabricator.kde.org/D16307
2018-09-10Do use QIcon::Selected for non-icon viewKai Uwe Broulik
Fixes a regression introduced by not using the selected state. The views other than icon view actually do have a proper highlighted background. Differential Revision: https://phabricator.kde.org/D15387
2018-09-05[KStandardItemListWidget] Round to icon size before applying scalingKai Uwe Broulik
Otherwise for 22px icons on high dpi we will request either the wrong icons or scale them needlessly. Dolphin requests a pixmap of 22px, this is then multiplied by dpr resulting in 44 which isn't a valid icon size (only 32 or 48 are). Moreover, we will also hit the path where it will scale the pixmap to a proper icon size resulting in blurry icons (and a performance penalty). Differential Revision: https://phabricator.kde.org/D15260
2018-09-04Don't use QIcon::Selected state for selected iconKai Uwe Broulik
This causes selected monochrome Breeze icons to turn white as this state is meant for when the icon is actually painted ontop of e.g. a blue highlighted area in a menu Since the advanced icon configuration (where you could choose a custom hint color and other effects) has been removed in Plasma 5.13 and more importantly the fact that Dolphin always tints the icon in the highlight color disregarding any custom icon effects settings this is an acceptable change. CHANGELOG: Fixed monochrome icons turning invisible when selected BUG: 398014 FIXED-IN: 18.08.2 Differential Revision: https://phabricator.kde.org/D15255
2018-07-11[KStandardItemListWidget] Avoid needless image resizingKai Uwe Broulik
There be rounding errors when scaling pixmaps when keeping aspect ratio Differential Revision: https://phabricator.kde.org/D11319
2018-03-29Fix alignment of icons in Places panel and Compact view modeScott Harvey
Summary: Adjust calculation of icon pixmap Y value; now based off center of text label bounding rectangle. Previously, icons appeared top-aligned when text size was larger than icon size. Centering is done by obtaining the center point of the text frame (`m_textRect.center().y()`) and setting the top `Y` point of the icon to one-half of the scaled icon height (`m_scaled_PixmapSize.height()`) Division is done by `2.0`, to ensure calculations are done with floating-point math, in keeping with `QPointF`, which returns floating-point values. Also includes an adjustment named `midlineShift` (contributed by @zzag), which takes into account the font's midline in respect to the center of the text frame. Certain fonts (i.e. Noto Sans) can have a slightly offset midline, resulting in imperfect alignment of the icon. This small adjustment resolves that potential issue. See before and after screenshots. {F5764918} Before, showing misalignment (with and without debugging wireframes) {F5764920} After, showing correction BUG: 390771 Test Plan: -- Compile Dolphin with patch -- Increase system font size by several points (i.e. 15pt) -- Check that Places panel icons remain centered with the text label -- Select Compact View mode -- Adjust icon size slider to minimum -- Ensure that icons also remain centered in file listing -- Check several combinations of icon size & font size to ensure centering is consistent Reviewers: #dolphin, ngraham, cfeck, elvisangelaccio Reviewed By: #dolphin, ngraham, elvisangelaccio Subscribers: zzag, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D11650
2018-03-29Fix enum-compare-switch clang warningsElvis Angelaccio
We were comparing a value of type `KStandardItemListView::ItemLayout` with values of type `KStandardItemListWidget::Layout`.
2018-03-04Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: bcooksley, markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2018-03-03Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2018-02-05[KStandardItemListWidget] Adjust painting rating to device pixel ratioKai Uwe Broulik
Differential Revision: https://phabricator.kde.org/D10324
2018-01-11[KStandardItemListWidget] Don't paint overlay outside view for ↵Kai Uwe Broulik
devicePixelRatio > 1 Translate the position by devicePixelRatio REVIEW: 129084
2017-11-21Modernize: Use nullptr everywhereKevin Funk
2017-11-18Fix scrolling during inline renaming causes rename of wrong fileAndreas Krutzler
Summary: Scrolling during inline renaming accepts the renaming now, like if one would hit Return for example. I chose this approach because it seems the easiest way to fix this. This also fixes the “possible” Ui glitch where the renaming KTextField doesn’t move along with the list item. Possible glitch, because I don’t know if this is intentional, but for me it looks broken. BUG: 378786 Fixes T7443 Test Plan: * Enable "Rename inline" in dolphin settings * Go to a folder where you have to scroll through items (many files, big zoom,…) * Start to rename a file (context menu, F2, …) * Scroll with mouse wheel * Rename accepted -> file is renamed Reviewers: ngraham, rkflx, #dolphin, elvisangelaccio Reviewed By: ngraham, rkflx, #dolphin, elvisangelaccio Subscribers: anthonyfieroni, elvisangelaccio, #dolphin Maniphest Tasks: T7443 Differential Revision: https://phabricator.kde.org/D8822