NetworkView:

- corrected bug in popup menu 
	- used more saturated colors to improve clarity
	- used darker colors for less trusted peers
	- fixed ownId node position to the center
NetworkDialog:
	- changed color of own  lign to yellow to comply with color code in NetworkView



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3826 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-11-19 21:52:56 +00:00
parent 63b32b0794
commit 1585606c4c
4 changed files with 16 additions and 50 deletions

View File

@ -524,7 +524,7 @@ void NetworkDialog::insertConnect()
// Color each Background column in the Network Tab except the first one => 1-9 // Color each Background column in the Network Tab except the first one => 1-9
for(int i=0;i<10;++i) for(int i=0;i<10;++i)
{ {
self_item->setBackground(i,QBrush(QColor("#45ff45"))); self_item->setBackground(i,Qt::yellow) ;//QBrush(QColor("#45ff45")));
} }
connectWidget->addTopLevelItem(self_item); connectWidget->addTopLevelItem(self_item);

View File

@ -35,11 +35,11 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QPushButton" name="refreshButton"> <widget class="QPushButton" name="refreshButton">
<property name="text"> <property name="text">
<string>Refresh</string> <string>Redraw</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="7"> <item row="0" column="5">
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -53,38 +53,6 @@
</spacer> </spacer>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QComboBox" name="comboBox">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Basic</string>
</property>
</item>
<item>
<property name="text">
<string>Friends</string>
</property>
</item>
<item>
<property name="text">
<string>Extended</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Display mode:</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QSpinBox" name="maxFriendLevelSB"> <widget class="QSpinBox" name="maxFriendLevelSB">
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
@ -97,14 +65,14 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="1">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>Friends level:</string> <string>Friendship level:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="6"> <item row="0" column="4">
<widget class="QSpinBox" name="edgeLengthSB"> <widget class="QSpinBox" name="edgeLengthSB">
<property name="minimum"> <property name="minimum">
<number>10</number> <number>10</number>
@ -117,7 +85,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="5"> <item row="0" column="3">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Edge length:</string> <string>Edge length:</string>

View File

@ -175,8 +175,8 @@ GraphWidget::NodeId GraphWidget::addNode(const std::string& node_short_string,co
qreal x1,y1,x2,y2 ; qreal x1,y1,x2,y2 ;
sceneRect().getCoords(&x1,&y1,&x2,&y2) ; sceneRect().getCoords(&x1,&y1,&x2,&y2) ;
float f1 = rand()/(float)RAND_MAX ; float f1 = (type == GraphWidget::ELASTIC_NODE_TYPE_OWN)?0.5:(rand()/(float)RAND_MAX) ;
float f2 = rand()/(float)RAND_MAX ; float f2 = (type == GraphWidget::ELASTIC_NODE_TYPE_OWN)?0.5:(rand()/(float)RAND_MAX) ;
node->setPos(x1+f1*(x2-x1),y1+f2*(y2-y1)); node->setPos(x1+f1*(x2-x1),y1+f2*(y2-y1));
} }

View File

@ -240,27 +240,25 @@ QPainterPath Node::shape() const
void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
{ {
static QColor type_color[4] = { QColor(Qt::yellow), QColor(Qt::green), QColor(Qt::cyan), QColor(Qt::black) } ; static QColor type_color[4] = { QColor(Qt::yellow), QColor(Qt::green), QColor(Qt::cyan), QColor(Qt::black) } ;
static QColor auth_color[3] = { QColor(Qt::darkYellow), QColor(Qt::darkGreen), QColor(Qt::darkBlue) } ;
QColor col0(type_color[_type]) ;
painter->setPen(Qt::NoPen); painter->setPen(Qt::NoPen);
painter->setBrush(Qt::darkGray); painter->setBrush(Qt::darkGray);
painter->drawEllipse(-7, -7, 20, 20); painter->drawEllipse(-7, -7, 20, 20);
QColor col0(type_color[_type]) ;
QColor col1(auth_color[_auth]) ;
QRadialGradient gradient(-3, -3, 10); QRadialGradient gradient(-3, -3, 10);
if (option->state & QStyle::State_Sunken) if (option->state & QStyle::State_Sunken)
{ {
gradient.setCenter(3, 3); gradient.setCenter(3, 3);
gradient.setFocalPoint(3, 3); gradient.setFocalPoint(3, 3);
gradient.setColorAt(1, col0.light(120)); gradient.setColorAt(1, col0.light(120).dark(100+_auth*100));
gradient.setColorAt(0, col1.light(120)); gradient.setColorAt(0, col0.light(70).dark(100+_auth*100));
} }
else else
{ {
gradient.setColorAt(0, col0); gradient.setColorAt(1, col0.light(50).dark(100+_auth*100));
gradient.setColorAt(1, col1); gradient.setColorAt(0, col0.dark(100+_auth*100));
} }
painter->setBrush(gradient); painter->setBrush(gradient);
painter->setPen(QPen(Qt::black, 0)); painter->setPen(QPen(Qt::black, 0));
@ -299,7 +297,7 @@ void Node::mousePressEvent(QGraphicsSceneMouseEvent *event)
void Node::peerDetails() void Node::peerDetails()
{ {
std::cerr << "Calling peer details" << std::endl; std::cerr << "Calling peer details" << std::endl;
ConfCertDialog::showIt(_ssl_id, ConfCertDialog::PageDetails); ConfCertDialog::showIt(_gpg_id, ConfCertDialog::PageDetails);
} }
void Node::makeFriend() void Node::makeFriend()
{ {