]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kstandarditemlistwidget.h
dolphinmainwindow: zoom action is now a KToolBarPopupAction
[dolphin.git] / src / kitemviews / kstandarditemlistwidget.h
index 588ec3548e89aea48e70f3aeabda509962a2553b..cabe3a8c963a0aa24c1a28803deb92610f054bf6 100644 (file)
@@ -105,10 +105,10 @@ public:
 
     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
 
-    QRectF iconRect() const override;
     QRectF textRect() const override;
     QRectF textFocusRect() const override;
-    QRectF selectionRect() const override;
+    QRectF selectionRectFull() const override;
+    QRectF selectionRectCore() const override;
     QRectF expansionToggleRect() const override;
     QRectF selectionToggleRect() const override;
     QPixmap createDragPixmap(const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
@@ -158,8 +158,8 @@ protected:
     void setTextColor(const QColor &color);
     QColor textColor(const QWidget &widget) const;
 
-    void setOverlay(const QPixmap &overlay);
-    QPixmap overlay() const;
+    void setOverlays(QHash<Qt::Corner, QString> &overlay);
+    QHash<Qt::Corner, QString> overlays() const;
 
     /**
      * @see KStandardItemListWidgetInformant::roleText().
@@ -176,7 +176,7 @@ protected:
     void dataChanged(const QHash<QByteArray, QVariant> &current, const QSet<QByteArray> &roles = QSet<QByteArray>()) override;
     void visibleRolesChanged(const QList<QByteArray> &current, const QList<QByteArray> &previous) override;
     void columnWidthChanged(const QByteArray &role, qreal current, qreal previous) override;
-    void sidePaddingChanged(qreal width) override;
+    void sidePaddingChanged(qreal leftPaddingWidth, qreal rightPaddingWidth) override;
     void styleOptionChanged(const KItemListStyleOption &current, const KItemListStyleOption &previous) override;
     void hoveredChanged(bool hovered) override;
     void selectedChanged(bool selected) override;
@@ -212,12 +212,19 @@ private:
     void updateCompactLayoutTextCache();
     void updateDetailsLayoutTextCache();
 
+    QPixmap addOverlays(const QPixmap &pixmap,
+                        const QHash<Qt::Corner, QString> &overlays,
+                        const QSize &size,
+                        qreal devicePixelRatioF,
+                        QIcon::Mode mode = QIcon::Normal) const;
+
     void drawPixmap(QPainter *painter, const QPixmap &pixmap);
+    /** Draw the lines and arrows that visualize the expanded state and level of this row. */
     void drawSiblingsInformation(QPainter *painter);
 
     QRectF roleEditingRect(const QByteArray &role) const;
 
-    QString elideRightKeepExtension(const QString &text, int elidingWidth) const;
+    QString elideText(QString text, qreal elidingWidth) const;
 
     /**
      * Escapes text for display purposes.
@@ -232,7 +239,7 @@ private:
      */
     void closeRoleEditor();
 
-    QPixmap pixmapForIcon(const QString &name, const QStringList &overlays, int size, QIcon::Mode mode) const;
+    QPixmap pixmapForIcon(const QString &name, const QSize &size, QIcon::Mode mode) const;
 
     /**
      * @return Preferred size of the rating-image based on the given
@@ -273,7 +280,6 @@ private:
 
     qreal m_columnWidthSum;
     QRectF m_iconRect; // Cache for KItemListWidget::iconRect()
-    QPixmap m_hoverPixmap; // Cache for modified m_pixmap when hovering the item
 
     QRectF m_textRect;
 
@@ -284,7 +290,7 @@ private:
     QColor m_customTextColor;
     QColor m_additionalInfoTextColor;
 
-    QPixmap m_overlay;
+    QHash<Qt::Corner, QString> m_overlays;
     QPixmap m_rating;
 
     KItemListRoleEditor *m_roleEditor;