mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-29 17:28:41 -04:00
fixed a few icons and sizeHint functions. Removed unused SFListDelegate files from compilation
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8571 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
18df09e032
commit
ebc8bb072c
38 changed files with 266 additions and 227 deletions
|
@ -245,8 +245,11 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
painter->restore();
|
||||
}
|
||||
|
||||
QSize DLListDelegate::sizeHint(const QStyleOptionViewItem & /*option*/, const QModelIndex & /*index*/) const
|
||||
QSize DLListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
|
||||
{
|
||||
return QSize(50,17);
|
||||
float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString());
|
||||
|
||||
int S = QFontMetricsF(option.font).height() ;
|
||||
return QSize(w,S);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
|
||||
#include <retroshare/rstypes.h>
|
||||
#include "RsAutoUpdatePage.h"
|
||||
|
||||
#include "ui_TransfersDialog.h"
|
||||
|
||||
#define IMAGE_TRANSFERS ":/images/ktorrent32.png"
|
||||
|
||||
class DLListDelegate;
|
||||
class ULListDelegate;
|
||||
|
||||
#include "ui_TransfersDialog.h"
|
||||
|
||||
#define IMAGE_TRANSFERS ":/icons/ktorrent_128.png"
|
||||
|
||||
class DLListDelegate;
|
||||
class ULListDelegate;
|
||||
class QStandardItemModel;
|
||||
class QStandardItem;
|
||||
class DetailsDialog;
|
||||
|
@ -55,16 +55,16 @@ public:
|
|||
|
||||
|
||||
/** Default Constructor */
|
||||
TransfersDialog(QWidget *parent = 0);
|
||||
~TransfersDialog();
|
||||
|
||||
virtual QIcon iconPixmap() const { return QIcon(IMAGE_TRANSFERS) ; } //MainPage
|
||||
virtual QString pageName() const { return tr("File sharing") ; } //MainPage
|
||||
virtual QString helpText() const { return ""; } //MainPage
|
||||
|
||||
virtual UserNotify *getUserNotify(QObject *parent);
|
||||
|
||||
void activatePage(TransfersDialog::Page page) ;
|
||||
TransfersDialog(QWidget *parent = 0);
|
||||
~TransfersDialog();
|
||||
|
||||
virtual QIcon iconPixmap() const { return QIcon(IMAGE_TRANSFERS) ; } //MainPage
|
||||
virtual QString pageName() const { return tr("File sharing") ; } //MainPage
|
||||
virtual QString helpText() const { return ""; } //MainPage
|
||||
|
||||
virtual UserNotify *getUserNotify(QObject *parent);
|
||||
|
||||
void activatePage(TransfersDialog::Page page) ;
|
||||
|
||||
virtual void updateDisplay() ; // derived from RsAutoUpdateWidget
|
||||
|
||||
|
@ -131,16 +131,16 @@ private slots:
|
|||
void chunkProgressive();
|
||||
void chunkStreaming();
|
||||
|
||||
void showDetailsDialog();
|
||||
void updateDetailsDialog();
|
||||
|
||||
void collCreate();
|
||||
void collModif();
|
||||
void collView();
|
||||
void collOpen();
|
||||
|
||||
void setShowDLSizeColumn(bool show);
|
||||
void setShowDLCompleteColumn(bool show);
|
||||
void showDetailsDialog();
|
||||
void updateDetailsDialog();
|
||||
|
||||
void collCreate();
|
||||
void collModif();
|
||||
void collView();
|
||||
void collOpen();
|
||||
|
||||
void setShowDLSizeColumn(bool show);
|
||||
void setShowDLCompleteColumn(bool show);
|
||||
void setShowDLDLSpeedColumn(bool show);
|
||||
void setShowDLProgressColumn(bool show);
|
||||
void setShowDLSourcesColumn(bool show);
|
||||
|
@ -167,21 +167,21 @@ private:
|
|||
ULListDelegate *ULDelegate;
|
||||
|
||||
/** Create the actions on the tray menu or menubar */
|
||||
void createActions();
|
||||
|
||||
/** Defines the actions for the context menu */
|
||||
QAction *showdownInfoAct;
|
||||
QAction *playAct;
|
||||
QAction *cancelAct;
|
||||
QAction *forceCheckAct;
|
||||
QAction *clearCompletedAct;
|
||||
QAction *copyLinkAct;
|
||||
QAction *pasteLinkAct;
|
||||
QAction *rootIsNotDecoratedAct;
|
||||
QAction *rootIsDecoratedAct;
|
||||
QAction *pauseAct;
|
||||
QAction *resumeAct;
|
||||
QAction *openFolderAct;
|
||||
void createActions();
|
||||
|
||||
/** Defines the actions for the context menu */
|
||||
QAction *showdownInfoAct;
|
||||
QAction *playAct;
|
||||
QAction *cancelAct;
|
||||
QAction *forceCheckAct;
|
||||
QAction *clearCompletedAct;
|
||||
QAction *copyLinkAct;
|
||||
QAction *pasteLinkAct;
|
||||
QAction *rootIsNotDecoratedAct;
|
||||
QAction *rootIsDecoratedAct;
|
||||
QAction *pauseAct;
|
||||
QAction *resumeAct;
|
||||
QAction *openFolderAct;
|
||||
QAction *openFileAct;
|
||||
QAction *previewFileAct;
|
||||
// QAction *clearQueuedDwlAct;
|
||||
|
@ -196,20 +196,20 @@ private:
|
|||
QAction *queueBottomAct;
|
||||
QAction *chunkRandomAct;
|
||||
QAction *chunkProgressiveAct;
|
||||
QAction *chunkStreamingAct;
|
||||
QAction *detailsFileAct;
|
||||
QAction *toggleShowCacheTransfersAct;
|
||||
QAction *renameFileAct;
|
||||
QAction *specifyDestinationDirectoryAct;
|
||||
QAction *expandAllAct;
|
||||
QAction *collapseAllAct;
|
||||
QAction *collCreateAct;
|
||||
QAction *collModifAct;
|
||||
QAction *collViewAct;
|
||||
QAction *collOpenAct;
|
||||
|
||||
/** Defines the actions for the header context menu */
|
||||
QAction* showDLSizeAct;
|
||||
QAction *chunkStreamingAct;
|
||||
QAction *detailsFileAct;
|
||||
QAction *toggleShowCacheTransfersAct;
|
||||
QAction *renameFileAct;
|
||||
QAction *specifyDestinationDirectoryAct;
|
||||
QAction *expandAllAct;
|
||||
QAction *collapseAllAct;
|
||||
QAction *collCreateAct;
|
||||
QAction *collModifAct;
|
||||
QAction *collViewAct;
|
||||
QAction *collOpenAct;
|
||||
|
||||
/** Defines the actions for the header context menu */
|
||||
QAction* showDLSizeAct;
|
||||
QAction* showDLCompleteAct;
|
||||
QAction* showDLDLSpeedAct;
|
||||
QAction* showDLProgressAct;
|
||||
|
|
|
@ -174,12 +174,14 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
|
||||
QSize ULListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
|
||||
{
|
||||
return QSize(50,17);
|
||||
QVariant value = index.data(Qt::FontRole);
|
||||
QFont fnt = value.isValid() ? qvariant_cast<QFont>(value) : option.font;
|
||||
QFontMetrics fontMetrics(fnt);
|
||||
const QString text = index.data(Qt::DisplayRole).toString();
|
||||
QRect textRect = QRect(0, 0, 0, fontMetrics.lineSpacing() * (text.count(QLatin1Char('\n')) + 1));
|
||||
return textRect.size();
|
||||
int S = QFontMetricsF(option.font).height() ;
|
||||
return QSize(4*S,S);
|
||||
//return QSize(50,17);
|
||||
//QVariant value = index.data(Qt::FontRole);
|
||||
//QFont fnt = value.isValid() ? qvariant_cast<QFont>(value) : option.font;
|
||||
//QFontMetrics fontMetrics(fnt);
|
||||
//const QString text = index.data(Qt::DisplayRole).toString();
|
||||
//QRect textRect = QRect(0, 0, 0, fontMetrics.lineSpacing() * (text.count(QLatin1Char('\n')) + 1));
|
||||
//return textRect.size();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue