Changeset View
Changeset View
Standalone View
Standalone View
krusader/DiskUsage/radialMap/segmentTip.cpp
Show All 31 Lines | |||||
32 | #include <KI18n/KLocalizedString> | 32 | #include <KI18n/KLocalizedString> | ||
33 | 33 | | |||
34 | #include "fileTree.h" | 34 | #include "fileTree.h" | ||
35 | 35 | | |||
36 | namespace RadialMap | 36 | namespace RadialMap | ||
37 | { | 37 | { | ||
38 | 38 | | |||
39 | SegmentTip::SegmentTip(uint h) | 39 | SegmentTip::SegmentTip(uint h) | ||
40 | : QWidget(0, Qt::FramelessWindowHint | Qt::Tool | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint) | 40 | : QWidget(nullptr, Qt::FramelessWindowHint | Qt::Tool | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint) | ||
41 | , m_cursorHeight(-h) | 41 | , m_cursorHeight(-h) | ||
42 | { | 42 | { | ||
43 | setAttribute(Qt::WA_NoSystemBackground, true); | 43 | setAttribute(Qt::WA_NoSystemBackground, true); | ||
44 | } | 44 | } | ||
45 | 45 | | |||
46 | void | 46 | void | ||
47 | SegmentTip::moveto(QPoint p, QWidget &canvas, bool placeAbove) | 47 | SegmentTip::moveto(QPoint p, QWidget &canvas, bool placeAbove) | ||
48 | { | 48 | { | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 112 | { | |||
120 | 120 | | |||
121 | if (pc > 0) s2 += QString(" (%1%)").arg(loc.toString(pc)); | 121 | if (pc > 0) s2 += QString(" (%1%)").arg(loc.toString(pc)); | ||
122 | 122 | | |||
123 | m_text = s1; | 123 | m_text = s1; | ||
124 | m_text += '\n'; | 124 | m_text += '\n'; | ||
125 | m_text += s2; | 125 | m_text += s2; | ||
126 | 126 | | |||
127 | if (file->isDir()) { | 127 | if (file->isDir()) { | ||
128 | double files = static_cast<const Directory*>(file)->fileCount(); | 128 | double files = dynamic_cast<const Directory*>(file)->fileCount(); | ||
129 | const uint pc = uint((100 * files) / (double)root->fileCount()); | 129 | const auto pc = uint((100 * files) / (double)root->fileCount()); | ||
130 | QString s3 = i18n("Files: %1", loc.toString(files, 'f', 0)); | 130 | QString s3 = i18n("Files: %1", loc.toString(files, 'f', 0)); | ||
131 | 131 | | |||
132 | if (pc > 0) s3 += QString(" (%1%)").arg(loc.toString(pc)); | 132 | if (pc > 0) s3 += QString(" (%1%)").arg(loc.toString(pc)); | ||
133 | 133 | | |||
134 | maxw = fontMetrics().width(s3); | 134 | maxw = fontMetrics().width(s3); | ||
135 | h += fontMetrics().height(); | 135 | h += fontMetrics().height(); | ||
136 | m_text += '\n'; | 136 | m_text += '\n'; | ||
137 | m_text += s3; | 137 | m_text += s3; | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |