diff options
| author | Chris Holland <[email protected]> | 2019-05-20 13:47:48 -0400 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2020-11-04 23:16:12 +0000 |
| commit | ac6de72048fb50bca1823b8001fb012158050c25 (patch) | |
| tree | 6a3d6566e5a96676d25df618d5aa9207531de679 /src/kitemviews | |
| parent | e9a39700fc004004b1ff231023e9d5333a2b8317 (diff) | |
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.
Diffstat (limited to 'src/kitemviews')
| -rw-r--r-- | src/kitemviews/kstandarditemlistwidget.h | 15 |
1 files changed, 8 insertions, 7 deletions
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<QByteArray, TextInfo*> 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<QByteArray, TextInfo*> m_textInfo; - QRectF m_textRect; QList<QByteArray> m_sortedVisibleRoles; |
