Changeset View
Changeset View
Standalone View
Standalone View
src/lib/tools/qztools.cpp
Show First 20 Lines • Show All 995 Lines • ▼ Show 20 Line(s) | |||||
996 | QString QzTools::operatingSystemLong() | 996 | QString QzTools::operatingSystemLong() | ||
997 | { | 997 | { | ||
998 | const QString arch = cpuArchitecture(); | 998 | const QString arch = cpuArchitecture(); | ||
999 | if (arch.isEmpty()) | 999 | if (arch.isEmpty()) | ||
1000 | return QzTools::operatingSystem(); | 1000 | return QzTools::operatingSystem(); | ||
1001 | return QzTools::operatingSystem() + QSL(" ") + arch; | 1001 | return QzTools::operatingSystem() + QSL(" ") + arch; | ||
1002 | } | 1002 | } | ||
1003 | 1003 | | |||
1004 | void QzTools::paintDropIndicator(QWidget *widget, const QRect &r) | ||||
1005 | { | ||||
1006 | // Modified code from KFilePlacesView | ||||
1007 | QColor color = widget->palette().brush(QPalette::Normal, QPalette::Highlight).color(); | ||||
1008 | const int x = (r.left() + r.right()) / 2; | ||||
1009 | const int thickness = qRound(r.width() / 2.0); | ||||
1010 | int alpha = 255; | ||||
1011 | const int alphaDec = alpha / (thickness + 1); | ||||
1012 | QStylePainter p(widget); | ||||
1013 | for (int i = 0; i < thickness; i++) { | ||||
1014 | color.setAlpha(alpha); | ||||
1015 | alpha -= alphaDec; | ||||
1016 | p.setPen(color); | ||||
1017 | p.drawLine(x - i, r.top(), x - i, r.bottom()); | ||||
1018 | p.drawLine(x + i, r.top(), x + i, r.bottom()); | ||||
1019 | } | ||||
1020 | } |