mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-03 11:54:30 -04:00
added functionality when collapse tree change treeicon
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1286 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8688e19c24
commit
39319f8345
2 changed files with 23 additions and 11 deletions
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
#include <QPixmap>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -20,11 +21,18 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
||||||
RemoteMode(mode), nIndex(1), indexSet(1) /* ass zero index cant be used */
|
RemoteMode(mode), nIndex(1), indexSet(1) /* ass zero index cant be used */
|
||||||
{
|
{
|
||||||
setSupportedDragActions(Qt::CopyAction);
|
setSupportedDragActions(Qt::CopyAction);
|
||||||
|
treeStyle();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RemoteDirModel::treeStyle()
|
||||||
|
{
|
||||||
|
categoryIcon.addPixmap(QPixmap(":/images/folder16.png"),
|
||||||
|
QIcon::Normal, QIcon::Off);
|
||||||
|
categoryIcon.addPixmap(QPixmap(":/images/folder_video.png"),
|
||||||
|
QIcon::Normal, QIcon::On);
|
||||||
|
peerIcon = QIcon(":/images/user/identity16.png");
|
||||||
|
}
|
||||||
|
|
||||||
bool RemoteDirModel::hasChildren(const QModelIndex &parent) const
|
bool RemoteDirModel::hasChildren(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
|
@ -249,7 +257,7 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
||||||
switch(coln)
|
switch(coln)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
return(QIcon(":/images/user/identity16.png"));
|
return (QIcon(peerIcon));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -266,7 +274,7 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return(QIcon(":/images/folder16.png"));
|
return(QIcon(categoryIcon));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,10 @@ virtual QStringList mimeTypes () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void update (const QModelIndex &index );
|
void update (const QModelIndex &index );
|
||||||
|
void treeStyle();
|
||||||
|
|
||||||
|
QIcon categoryIcon;
|
||||||
|
QIcon peerIcon;
|
||||||
|
|
||||||
class RemoteIndex
|
class RemoteIndex
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue