Changeset 14019


Ignore:
Timestamp:
Feb 14, 2013, 11:32:37 PM (9 years ago)
Author:
jordan
Message:

(qt) #5278 'Something strange with the color of progress bars' -- patch by rb07

Location:
trunk/qt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/torrent-delegate-min.cc

    r13244 r14019  
    2222#include <QPixmap>
    2323#include <QPixmapCache>
    24 #include <QStyleOptionProgressBarV2>
     24#include <QStyleOptionProgressBar>
    2525
    2626#include <libtransmission/transmission.h>
     
    158158        myProgressBarStyle->palette.setBrush( QPalette::Highlight, blueBrush );
    159159        myProgressBarStyle->palette.setColor( QPalette::Base, blueBack );
    160         myProgressBarStyle->palette.setColor( QPalette::Background, blueBack );
     160        myProgressBarStyle->palette.setColor( QPalette::Window, blueBack );
    161161    }
    162162    else if ( tor.isSeeding() ) {
    163163        myProgressBarStyle->palette.setBrush( QPalette::Highlight, greenBrush );
    164164        myProgressBarStyle->palette.setColor( QPalette::Base, greenBack );
    165         myProgressBarStyle->palette.setColor( QPalette::Background, greenBack );
     165        myProgressBarStyle->palette.setColor( QPalette::Window, greenBack );
     166    }
     167    else {
     168        myProgressBarStyle->palette.setBrush( QPalette::Highlight, silverBrush );
     169        myProgressBarStyle->palette.setColor( QPalette::Base, silverBack );
     170        myProgressBarStyle->palette.setColor( QPalette::Window, silverBack );
    166171    }
    167172    myProgressBarStyle->state = progressBarState;
  • trunk/qt/torrent-delegate.cc

    r13978 r14019  
    2121#include <QPixmap>
    2222#include <QPixmapCache>
    23 #include <QStyleOptionProgressBarV2>
     23#include <QStyleOptionProgressBar>
    2424
    2525#include "formatter.h"
     
    3636QColor TorrentDelegate :: greenBrush;
    3737QColor TorrentDelegate :: blueBrush;
     38QColor TorrentDelegate :: silverBrush;
    3839QColor TorrentDelegate :: greenBack;
    3940QColor TorrentDelegate :: blueBack;
     41QColor TorrentDelegate :: silverBack;
    4042
    4143TorrentDelegate :: TorrentDelegate( QObject * parent ):
    4244    QStyledItemDelegate( parent ),
    43     myProgressBarStyle( new QStyleOptionProgressBarV2 )
     45    myProgressBarStyle( new QStyleOptionProgressBar )
    4446{
    4547    myProgressBarStyle->minimum = 0;
     
    5153    blueBrush = QColor("steelblue");
    5254    blueBack = QColor("lightgrey");
     55
     56    silverBrush = QColor("silver");
     57    silverBack = QColor("grey");
    5358}
    5459
     
    424429        myProgressBarStyle->palette.setBrush( QPalette::Highlight, blueBrush );
    425430        myProgressBarStyle->palette.setColor( QPalette::Base, blueBack );
    426         myProgressBarStyle->palette.setColor( QPalette::Background, blueBack );
     431        myProgressBarStyle->palette.setColor( QPalette::Window, blueBack );
    427432    }
    428433    else if ( tor.isSeeding() ) {
    429434        myProgressBarStyle->palette.setBrush( QPalette::Highlight, greenBrush );
    430435        myProgressBarStyle->palette.setColor( QPalette::Base, greenBack );
    431         myProgressBarStyle->palette.setColor( QPalette::Background, greenBack );
     436        myProgressBarStyle->palette.setColor( QPalette::Window, greenBack );
     437    }
     438    else {
     439        myProgressBarStyle->palette.setBrush( QPalette::Highlight, silverBrush );
     440        myProgressBarStyle->palette.setColor( QPalette::Base, silverBack );
     441        myProgressBarStyle->palette.setColor( QPalette::Window, silverBack );
    432442    }
    433443    myProgressBarStyle->state = progressBarState;
  • trunk/qt/torrent-delegate.h

    r13244 r14019  
    1717#include <QSize>
    1818
    19 class QStyleOptionProgressBarV2;
     19class QStyleOptionProgressBar;
    2020class QStyleOptionViewItem;
    2121class QStyle;
     
    2828
    2929    public:
    30       static QColor blueBrush, greenBrush;
    31       static QColor blueBack,  greenBack;
     30      static QColor blueBrush, greenBrush, silverBrush;
     31      static QColor blueBack,  greenBack, silverBack;
    3232
    3333    protected:
    34         QStyleOptionProgressBarV2 * myProgressBarStyle;
     34        QStyleOptionProgressBar * myProgressBarStyle;
    3535
    3636    protected:
Note: See TracChangeset for help on using the changeset viewer.