From ac6de72048fb50bca1823b8001fb012158050c25 Mon Sep 17 00:00:00 2001 From: Chris Holland Date: Mon, 20 May 2019 13:47:48 -0400 Subject: Draw 2 Rectangles below mount points to represent a disk capacity bar Draws overtop text that's goes below the baseline like a 'j'. It's fairly difficult to add extra space below the text as the places view is a "details" view, so the text is vertically centered in the widget's "row" as you'd desire it to in the main file view. We can make the widget 8px taller, adding 4px above and below so there's adequate room for the capacitybar, but that wastes 4px for each mount point. Ideally we'd use the "compact" view, which displays the text/size in a column beside the icon. However the compact view was not designed to take up the entire width of the viewport. It's also designed to overflow with a horizontal scrollbar. --- src/kitemviews/kstandarditemlistwidget.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/kitemviews') diff --git a/src/kitemviews/kstandarditemlistwidget.h b/src/kitemviews/kstandarditemlistwidget.h index d036aae66..cda7cbfd1 100644 --- a/src/kitemviews/kstandarditemlistwidget.h +++ b/src/kitemviews/kstandarditemlistwidget.h @@ -171,6 +171,14 @@ protected: void hideEvent(QHideEvent* event) override; bool event(QEvent *event) override; +protected: + struct TextInfo + { + QPointF pos; + QStaticText staticText; + }; + QHash m_textInfo; + public slots: void finishRoleEditing(); @@ -239,13 +247,6 @@ private: QRectF m_iconRect; // Cache for KItemListWidget::iconRect() QPixmap m_hoverPixmap; // Cache for modified m_pixmap when hovering the item - struct TextInfo - { - QPointF pos; - QStaticText staticText; - }; - QHash m_textInfo; - QRectF m_textRect; QList m_sortedVisibleRoles; -- cgit v1.3