diff options
| author | Peter Penz <[email protected]> | 2012-03-23 22:26:17 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-03-23 22:31:55 +0100 |
| commit | 3f88f79f862a570b68fe64781955cf7d14124127 (patch) | |
| tree | ef9231ea05a90c495f2d59970f2c251204e97c22 /src/kitemviews/kitemlistwidget.h | |
| parent | 3fc96ef97bbea25418bb22a18e82f6b874eedb38 (diff) | |
Details view: Optionally remember user changed column-widths
If the user changed a column-width in the details-view, up to now
the width got reset when changing a directory or when restarting
Dolphin. Now the column-widths automatically get remembered for each
directory in case if the user has modified the width. The automatic
resizing is still turn on per default. The storing of the custom
column-width can easily be reset by right clicking on the header and
selecting "Automatic Column Widths" from the context-menu.
Some finetuning is still necessary (e.g. the "Adjust View Properties"
dialog currently is not aware about this setting) but this will
be fixed during the next weeks.
BUG: 264434
FIXED-IN: 4.9.0
Diffstat (limited to 'src/kitemviews/kitemlistwidget.h')
| -rw-r--r-- | src/kitemviews/kitemlistwidget.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/kitemviews/kitemlistwidget.h b/src/kitemviews/kitemlistwidget.h index 80f944748..66d96d449 100644 --- a/src/kitemviews/kitemlistwidget.h +++ b/src/kitemviews/kitemlistwidget.h @@ -65,8 +65,12 @@ public: void setVisibleRoles(const QList<QByteArray>& roles); QList<QByteArray> visibleRoles() const; - void setVisibleRolesSizes(const QHash<QByteArray, QSizeF> rolesSizes); - QHash<QByteArray, QSizeF> visibleRolesSizes() const; + /** + * Sets the width of a role that should be used if the alignment of the content + * should be done in columns. + */ + void setColumnWidth(const QByteArray& role, qreal width); + qreal columnWidth(const QByteArray& role) const; void setStyleOption(const KItemListStyleOption& option); const KItemListStyleOption& styleOption() const; @@ -133,7 +137,7 @@ public: protected: virtual void dataChanged(const QHash<QByteArray, QVariant>& current, const QSet<QByteArray>& roles = QSet<QByteArray>()); virtual void visibleRolesChanged(const QList<QByteArray>& current, const QList<QByteArray>& previous); - virtual void visibleRolesSizesChanged(const QHash<QByteArray, QSizeF>& current, const QHash<QByteArray, QSizeF>& previous); + virtual void columnWidthChanged(const QByteArray& role, qreal current, qreal previous); virtual void styleOptionChanged(const KItemListStyleOption& current, const KItemListStyleOption& previous); virtual void currentChanged(bool current); virtual void selectedChanged(bool selected); @@ -168,7 +172,7 @@ private: bool m_enabledSelectionToggle; QHash<QByteArray, QVariant> m_data; QList<QByteArray> m_visibleRoles; - QHash<QByteArray, QSizeF> m_visibleRolesSizes; + QHash<QByteArray, qreal> m_columnWidths; KItemListStyleOption m_styleOption; QBitArray m_siblingsInfo; |
