summaryrefslogtreecommitdiffstats
path: root/libkonq/tdefileivi.cc
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-15 03:03:58 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-15 03:03:58 -0500
commit41c013e06c430febb6a5353286573c968ca01440 (patch)
tree0fee1f29c1dc2ac11009aeef169cf9376303d22a /libkonq/tdefileivi.cc
parent9e4aad6b3bc3c1b4781a3c1cef6968640d4f6e67 (diff)
downloadtdebase-41c013e06c430febb6a5353286573c968ca01440.tar.gz
tdebase-41c013e06c430febb6a5353286573c968ca01440.zip
Fix a number of issues with the media tdeioslave
This relates to Bug 1450 Add media disk space overlay and enable by default
Diffstat (limited to 'libkonq/tdefileivi.cc')
-rw-r--r--libkonq/tdefileivi.cc28
1 files changed, 21 insertions, 7 deletions
diff --git a/libkonq/tdefileivi.cc b/libkonq/tdefileivi.cc
index bff31c890..eb7703a83 100644
--- a/libkonq/tdefileivi.cc
+++ b/libkonq/tdefileivi.cc
@@ -440,19 +440,33 @@ void KFileIVI::paintOverlayProgressBar( TQPainter *p ) const
// p->setBrush(TQt::green);
// p->drawPie(rect, 1440, (((100-d->m_progress)*5760)/100));
- // Progress bar
+// // Horizontal progress bar
+// TQRect rect = pixmapRect(true);
+// int verticalOffset = 0;
+// int usedBarWidth = ((d->m_progress*pixmapRect().width())/100);
+// int endPosition = x() + rect.x() + usedBarWidth;
+//
+// p->save();
+//
+// p->setPen(TQPen::NoPen);
+// p->setBrush(TQt::red);
+// p->drawRect(TQRect(x() + rect.x(), y() + rect.y() + (pixmapRect().height() - verticalOffset), usedBarWidth, 1));
+// p->setBrush(TQt::green);
+// p->drawRect(TQRect(endPosition, y() + rect.y() + (pixmapRect().height() - verticalOffset), pixmapRect().width() - usedBarWidth, 1));
+
+ // Vertical progress bar
TQRect rect = pixmapRect(true);
- int verticalOffset = 0;
- int usedBarWidth = ((d->m_progress*pixmapRect().width())/100);
- int endPosition = x() + rect.x() + usedBarWidth;
+ int horizontalOffset = 0;
+ int usedBarHeight = (((100-d->m_progress)*pixmapRect().height())/100);
+ int endPosition = y() + rect.y() + usedBarHeight;
p->save();
p->setPen(TQPen::NoPen);
- p->setBrush(TQt::red);
- p->drawRect(TQRect(x() + rect.x(), y() + rect.y() + (pixmapRect().height() - verticalOffset), usedBarWidth, 1));
p->setBrush(TQt::green);
- p->drawRect(TQRect(endPosition, y() + rect.y() + (pixmapRect().height() - verticalOffset), pixmapRect().width() - usedBarWidth, 1));
+ p->drawRect(TQRect(x() + rect.x() + (pixmapRect().width() - horizontalOffset), y() + rect.y(), 1, usedBarHeight));
+ p->setBrush(TQt::red);
+ p->drawRect(TQRect(x() + rect.x() + (pixmapRect().width() - horizontalOffset), endPosition, 1, pixmapRect().height() - usedBarHeight));
p->restore();
}