Browse Source

- Handling progress bar text painting ourselves because some styles really don't handle it well (cleanlooks...)

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
6ee9152b21
  1. 4
      src/DLListDelegate.h
  2. 4
      src/FinishedListDelegate.h
  3. 2
      src/GUI.cpp
  4. 7
      src/PreviewListDelegate.h
  5. 7
      src/PropListDelegate.h

4
src/DLListDelegate.h

@ -88,9 +88,11 @@ class DLListDelegate: public QItemDelegate {
newopt.maximum = 100; newopt.maximum = 100;
newopt.minimum = 0; newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled; newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true; newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
painter); painter);
painter->setPen(QColor("Black"));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break; break;
} }
default: default:

4
src/FinishedListDelegate.h

@ -81,9 +81,11 @@ class FinishedListDelegate: public QItemDelegate {
newopt.maximum = 100; newopt.maximum = 100;
newopt.minimum = 0; newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled; newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true; newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
painter); painter);
painter->setPen(QColor("Black"));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break; break;
} }
default: default:

2
src/GUI.cpp

@ -158,7 +158,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent) {
force_exit = false; force_exit = false;
// Resume unfinished torrents // Resume unfinished torrents
BTSession->resumeUnfinishedTorrents(); BTSession->resumeUnfinishedTorrents();
// Load last columns width for download list // Load last columns width for download list
if(!loadColWidthDLList()) { if(!loadColWidthDLList()) {
downloadList->header()->resizeSection(0, 200); downloadList->header()->resizeSection(0, 200);
} }

7
src/PreviewListDelegate.h

@ -63,9 +63,10 @@ class PreviewListDelegate: public QItemDelegate {
newopt.maximum = 100; newopt.maximum = 100;
newopt.minimum = 0; newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled; newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true; newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
painter); painter->setPen(QColor("Black"));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break; break;
} }
default: default:

7
src/PropListDelegate.h

@ -76,9 +76,10 @@ class PropListDelegate: public QItemDelegate {
newopt.maximum = 100; newopt.maximum = 100;
newopt.minimum = 0; newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled; newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true; newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
painter); painter->setPen(QColor("Black"));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break; break;
} }
case PRIORITY:{ case PRIORITY:{

Loading…
Cancel
Save