Changeset 11097
- Timestamp:
- Aug 2, 2010, 6:31:27 PM (12 years ago)
- Location:
- trunk/qt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt/torrent-delegate-min.cc
r11092 r11097 57 57 const bool isMagnet( !tor.hasMetadata( ) ); 58 58 const QString nameStr = (isMagnet ? progressString( tor ) : tor.name( ) ); 59 const QSize nameSize( nameFM.size( 0, nameStr ));59 const int nameWidth = nameFM.width( nameStr ); 60 60 61 61 QFont statusFont( option.font ); … … 63 63 const QFontMetrics statusFM( statusFont ); 64 64 const QString statusStr( shortStatusString( tor ) ); 65 const QSize statusSize( statusFM.size( 0, statusStr ));65 const int statusWidth = statusFM.width( statusStr ); 66 66 67 67 const QSize m( margin( *style ) ); 68 68 69 return QSize( m.width()*2 + iconSize + GUI_PAD + name Size.width()70 + GUI_PAD + status Size.width()69 return QSize( m.width()*2 + iconSize + GUI_PAD + nameWidth 70 + GUI_PAD + statusWidth 71 71 + GUI_PAD + BAR_WIDTH, 72 m.height()*2 + std::max( name Size.height(), (int)BAR_HEIGHT ) );72 m.height()*2 + std::max( nameFM.height(), (int)BAR_HEIGHT ) ); 73 73 } 74 74 … … 84 84 const bool isMagnet( !tor.hasMetadata( ) ); 85 85 const QString nameStr = (isMagnet ? progressString( tor ) : tor.name( ) ); 86 const QSize nameSize( nameFM.size( 0, nameStr ) );87 86 88 87 QFont statusFont( option.font ); -
trunk/qt/torrent-delegate.cc
r11092 r11097 279 279 const QFontMetrics nameFM( nameFont ); 280 280 const QString nameStr( tor.name( ) ); 281 const QSize nameSize( nameFM.size( 0, nameStr ));281 const int nameWidth = nameFM.width( nameStr ); 282 282 QFont statusFont( option.font ); 283 283 statusFont.setPointSize( int( option.font.pointSize( ) * 0.9 ) ); 284 284 const QFontMetrics statusFM( statusFont ); 285 285 const QString statusStr( statusString( tor ) ); 286 const QSize statusSize( statusFM.size( 0, statusStr ));286 const int statusWidth = statusFM.width( statusStr ); 287 287 QFont progressFont( statusFont ); 288 288 const QFontMetrics progressFM( progressFont ); 289 289 const QString progressStr( progressString( tor ) ); 290 const QSize progressSize( progressFM.size( 0, progressStr ));290 const int progressWidth = progressFM.width( progressStr ); 291 291 const QSize m( margin( *style ) ); 292 return QSize( m.width()*2 + iconSize + GUI_PAD + MAX3( name Size.width(), statusSize.width(), progressSize.width()),292 return QSize( m.width()*2 + iconSize + GUI_PAD + MAX3( nameWidth, statusWidth, progressWidth ), 293 293 //m.height()*3 + nameFM.lineSpacing() + statusFM.lineSpacing()*2 + progressFM.lineSpacing() ); 294 294 m.height()*3 + nameFM.lineSpacing() + statusFM.lineSpacing() + BAR_HEIGHT + progressFM.lineSpacing() ); -
trunk/qt/tracker-delegate.cc
r11092 r11097 13 13 #include <iostream> 14 14 15 #include <QApplication>16 #include <QBrush>17 #include <QFont>18 #include <QFontMetrics>19 #include <QIcon>20 #include <QModelIndex>21 15 #include <QPainter> 22 16 #include <QPixmap> 23 #include <QPixmapCache>24 #include <QStyleOptionProgressBarV2>25 17 #include <QTextDocument> 26 #include <QUrl>27 18 28 19 #include <libtransmission/transmission.h>
Note: See TracChangeset
for help on using the changeset viewer.