From 2438b61d8e76f8ea016217150be711a1467c32d0 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 13 Nov 2011 16:20:42 +0100 Subject: Bring back the selection-markers Still some finetuning is necessary, but lets first bring back the missing features from Dolphin 1.x to 2.0 before starting with this. --- src/kitemviews/kitemlistwidget.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/kitemviews/kitemlistwidget.h') diff --git a/src/kitemviews/kitemlistwidget.h b/src/kitemviews/kitemlistwidget.h index 2df19a610..a624950b8 100644 --- a/src/kitemviews/kitemlistwidget.h +++ b/src/kitemviews/kitemlistwidget.h @@ -29,6 +29,7 @@ #include +class KItemListSelectionToggle; class QPropertyAnimation; /** @@ -68,6 +69,8 @@ public: void setStyleOption(const KItemListStyleOption& option); const KItemListStyleOption& styleOption() const; + // TODO: Hides QGraphicsItem::setSelected()/isSelected(). Replace + // this by using the default mechanism. void setSelected(bool selected); bool isSelected() const; @@ -80,6 +83,9 @@ public: void setAlternatingBackgroundColors(bool enable); bool alternatingBackgroundColors() const; + void setEnabledSelectionToggle(bool enabled); + bool enabledSelectionToggle() const; + /** * @return True if \a point is inside KItemListWidget::hoverRect(), * KItemListWidget::textRect(), KItemListWidget::selectionToggleRect() @@ -129,7 +135,11 @@ protected: */ qreal hoverOpacity() const; +private slots: + void slotHoverAnimationFinished(); + private: + void initializeSelectionToggle(); void setHoverOpacity(qreal opacity); void clearHoverCache(); void drawTextBackground(QPainter* painter); @@ -142,6 +152,7 @@ private: bool m_current; bool m_hovered; bool m_alternatingBackgroundColors; + bool m_enabledSelectionToggle; QHash m_data; QList m_visibleRoles; QHash m_visibleRolesSizes; @@ -150,6 +161,8 @@ private: qreal m_hoverOpacity; mutable QPixmap* m_hoverCache; QPropertyAnimation* m_hoverAnimation; + + KItemListSelectionToggle* m_selectionToggle; }; #endif -- cgit v1.3.1