Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/krinterdetailedview.cpp
Show First 20 Lines • Show All 367 Lines • ▼ Show 20 Line(s) | 367 | if (textWidth <= width) { | |||
---|---|---|---|---|---|
368 | event->accept(); | 368 | event->accept(); | ||
369 | return true; | 369 | return true; | ||
370 | } | 370 | } | ||
371 | } | 371 | } | ||
372 | } | 372 | } | ||
373 | return QTreeView::viewportEvent(event); | 373 | return QTreeView::viewportEvent(event); | ||
374 | } | 374 | } | ||
375 | 375 | | |||
376 | void KrInterDetailedView::drawRow(QPainter *painter, const QStyleOptionViewItem &options, | ||||
377 | const QModelIndex &index) const | ||||
378 | { | ||||
379 | QTreeView::drawRow(painter, options, index); | ||||
380 | // (always) draw dashed line border around current item row. This is done internally in | ||||
381 | // QTreeView::drawRow() only when panel is focused, we have to repeat it here. | ||||
382 | if (index == currentIndex()) { | ||||
383 | QStyleOptionFocusRect o; | ||||
384 | o.backgroundColor = options.palette.color(QPalette::Normal, QPalette::Background); | ||||
385 | | ||||
386 | const QRect focusRect(0, options.rect.y(), header()->length(), options.rect.height()); | ||||
387 | o.rect = style()->visualRect(layoutDirection(), viewport()->rect(), focusRect); | ||||
388 | | ||||
389 | style()->drawPrimitive(QStyle::PE_FrameFocusRect, &o, painter); | ||||
390 | } | ||||
391 | } | ||||
392 | | ||||
376 | void KrInterDetailedView::setSortMode(KrViewProperties::ColumnType sortColumn, bool descending) | 393 | void KrInterDetailedView::setSortMode(KrViewProperties::ColumnType sortColumn, bool descending) | ||
377 | { | 394 | { | ||
378 | Qt::SortOrder sortDir = descending ? Qt::DescendingOrder : Qt::AscendingOrder; | 395 | Qt::SortOrder sortDir = descending ? Qt::DescendingOrder : Qt::AscendingOrder; | ||
379 | sortByColumn(sortColumn, sortDir); | 396 | sortByColumn(sortColumn, sortDir); | ||
380 | } | 397 | } | ||
381 | 398 | | |||
382 | void KrInterDetailedView::setFileIconSize(int size) | 399 | void KrInterDetailedView::setFileIconSize(int size) | ||
383 | { | 400 | { | ||
Show All 23 Lines |