Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/krinterbriefview.cpp
Show First 20 Lines • Show All 440 Lines • ▼ Show 20 Line(s) | 430 | { | |||
---|---|---|---|---|---|
441 | area.adjust(horizontalOffset(), verticalOffset(), horizontalOffset(), verticalOffset()); | 441 | area.adjust(horizontalOffset(), verticalOffset(), horizontalOffset(), verticalOffset()); | ||
442 | intersectionSet(area, intersectVector); | 442 | intersectionSet(area, intersectVector); | ||
443 | 443 | | |||
444 | foreach(const QModelIndex &mndx, intersectVector) { | 444 | foreach(const QModelIndex &mndx, intersectVector) { | ||
445 | option.state = QStyle::State_None; | 445 | option.state = QStyle::State_None; | ||
446 | option.rect = visualRect(mndx); | 446 | option.rect = visualRect(mndx); | ||
447 | painter.save(); | 447 | painter.save(); | ||
448 | 448 | | |||
449 | bool focus = curr.isValid() && curr.row() == mndx.row() && hasFocus(); | | |||
450 | | ||||
451 | itemDelegate()->paint(&painter, option, mndx); | 449 | itemDelegate()->paint(&painter, option, mndx); | ||
452 | 450 | | |||
453 | if (focus) { | 451 | // (always) draw dashed line border around current item row | ||
452 | const bool isCurrent = curr.isValid() && curr.row() == mndx.row(); | ||||
453 | if (isCurrent) { | ||||
454 | QStyleOptionFocusRect o; | 454 | QStyleOptionFocusRect o; | ||
455 | o.QStyleOption::operator=(option); | 455 | o.QStyleOption::operator=(option); | ||
456 | QPalette::ColorGroup cg = QPalette::Normal; | 456 | QPalette::ColorGroup cg = QPalette::Normal; | ||
457 | o.backgroundColor = option.palette.color(cg, QPalette::Background); | 457 | o.backgroundColor = option.palette.color(cg, QPalette::Background); | ||
458 | | ||||
458 | style()->drawPrimitive(QStyle::PE_FrameFocusRect, &o, &painter); | 459 | style()->drawPrimitive(QStyle::PE_FrameFocusRect, &o, &painter); | ||
459 | } | 460 | } | ||
460 | 461 | | |||
461 | painter.restore(); | 462 | painter.restore(); | ||
462 | } | 463 | } | ||
463 | } | 464 | } | ||
464 | 465 | | |||
465 | int KrInterBriefView::getItemHeight() const | 466 | int KrInterBriefView::getItemHeight() const | ||
▲ Show 20 Lines • Show All 248 Lines • Show Last 20 Lines |