mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +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
4d9193b85b
commit
2c20502c34
|
@ -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