mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Set the Details View colummns width to the preferred column width, by double-clicking the header grips.
BUG: 293315 FIXED-IN: 4.13 REVIEW: 115503
This commit is contained in:
parent
47c8eebe96
commit
15f409de33
2 changed files with 17 additions and 0 deletions
|
@ -327,6 +327,22 @@ void KItemListHeaderWidget::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
|
|||
}
|
||||
}
|
||||
|
||||
void KItemListHeaderWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
|
||||
{
|
||||
QGraphicsItem::mouseDoubleClickEvent(event);
|
||||
|
||||
const int roleIndex = roleIndexAt(event->pos());
|
||||
if (roleIndex >= 0 && isAboveRoleGrip(event->pos(), roleIndex)) {
|
||||
const QByteArray role = m_columns.at(roleIndex);
|
||||
|
||||
qreal previousWidth = columnWidth(role);
|
||||
setColumnWidth(role, preferredColumnWidth(role));
|
||||
qreal currentWidth = columnWidth(role);
|
||||
|
||||
emit columnWidthChanged(role, currentWidth, previousWidth);
|
||||
}
|
||||
}
|
||||
|
||||
void KItemListHeaderWidget::hoverEnterEvent(QGraphicsSceneHoverEvent* event)
|
||||
{
|
||||
QGraphicsWidget::hoverEnterEvent(event);
|
||||
|
|
|
@ -100,6 +100,7 @@ protected:
|
|||
virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
|
||||
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
|
||||
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
|
||||
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event);
|
||||
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* event);
|
||||
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* event);
|
||||
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
|
||||
|
|
Loading…
Reference in a new issue