┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kstandarditemlistwidget.cpp
AgeCommit message (Collapse)Author
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
2017-02-06[KStandardItemListWidget] Update icon when palette changesKai Uwe Broulik
We can colorize icons based on the user's palette, so clear the pixmap cache when it changes. Differential Revision: https://phabricator.kde.org/D3937
2016-05-13use selected icon state for selected sidebar itemMarco Martin
Since now the breeze icons can be recolored by kiconloader with svg stylesheets, use this feature to recolor the currently selected icon in the sidebar and in the details view (not the icon view) look wouldn't change if used with icon themes that don't support this feature This makes it look more in line with the breeze style REVIEW:127877
2016-04-26Specify a fallback icon to QIcon::fromTheme()Wolfgang Bauer
The default fallback of QIcon::fromTheme() is QIcon(), i.e. a null icon. Set the generic "unknown" icon as fallback to prevent missing icons for filetypes that specify an icon name that doesn't exist. This also gets rid of "QPixmap::scaled: Pixmap is a null pixmap" warnings in that case. BUG: 358958 BUG: 361034 FIXED-IN: 16.04.1 REVIEW: 127713
2016-03-16[CLAZY] Fixed all level 1 and level 2 warnings with small exceptionsArtur Puzio
REVIEW: 126771
2015-03-27review commentsDavid Edmundson
2015-03-25Paint icons at the correct sizeDavid Edmundson
2015-02-24Removed unused KGlobal includes and use KIO/Job instead of KIO/JobClassesEmmanuel Pescosta
2015-02-06Fix includesMontel Laurent
2014-11-10get rid of unused warningsEmmanuel Pescosta
2014-10-27Port to QDebug*. KVBox--Montel Laurent
2014-10-21port Dolphin from KUrl to QUrlLukáš Tinkl
REVIEW: 120688
2014-10-18Fix includesMontel Laurent
2014-10-18Fix includesMontel Laurent
2014-09-12Ported KIcon to QIconEmmanuel Pescosta
REVIEW: 120159
2014-08-22Merge branch 'master' into frameworksEmmanuel Pescosta
Conflicts: dolphin/src/dolphinmainwindow.cpp dolphin/src/dolphinmainwindow.h dolphin/src/dolphinrecenttabsmenu.cpp dolphin/src/dolphinviewcontainer.cpp kfind/CMakeLists.txt
2014-08-04Fix wrong text eliding in some corner cases.Emmanuel Pescosta
BUG: 337104 FIXED-IN: 4.14.0 REVIEW: 119546