From 1585606c4cc5cc95d367588a3414a294cd253a90 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 19 Nov 2010 21:52:56 +0000 Subject: [PATCH] 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 --- retroshare-gui/src/gui/NetworkDialog.cpp | 2 +- retroshare-gui/src/gui/NetworkView.ui | 44 +++---------------- .../src/gui/elastic/graphwidget.cpp | 4 +- retroshare-gui/src/gui/elastic/node.cpp | 16 +++---- 4 files changed, 16 insertions(+), 50 deletions(-) diff --git a/retroshare-gui/src/gui/NetworkDialog.cpp b/retroshare-gui/src/gui/NetworkDialog.cpp index f76978d4d..3c5dad7b6 100644 --- a/retroshare-gui/src/gui/NetworkDialog.cpp +++ b/retroshare-gui/src/gui/NetworkDialog.cpp @@ -524,7 +524,7 @@ void NetworkDialog::insertConnect() // Color each Background column in the Network Tab except the first one => 1-9 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); diff --git a/retroshare-gui/src/gui/NetworkView.ui b/retroshare-gui/src/gui/NetworkView.ui index 43ca36e9b..23f7702b7 100644 --- a/retroshare-gui/src/gui/NetworkView.ui +++ b/retroshare-gui/src/gui/NetworkView.ui @@ -35,11 +35,11 @@ - Refresh + Redraw - + Qt::Horizontal @@ -53,38 +53,6 @@ - - - false - - - - Basic - - - - - Friends - - - - - Extended - - - - - - - - false - - - Display mode: - - - - 0 @@ -97,14 +65,14 @@ - + - Friends level: + Friendship level: - + 10 @@ -117,7 +85,7 @@ - + Edge length: diff --git a/retroshare-gui/src/gui/elastic/graphwidget.cpp b/retroshare-gui/src/gui/elastic/graphwidget.cpp index 1d5c432f1..d4bfd70d5 100644 --- a/retroshare-gui/src/gui/elastic/graphwidget.cpp +++ b/retroshare-gui/src/gui/elastic/graphwidget.cpp @@ -175,8 +175,8 @@ GraphWidget::NodeId GraphWidget::addNode(const std::string& node_short_string,co qreal x1,y1,x2,y2 ; sceneRect().getCoords(&x1,&y1,&x2,&y2) ; - float f1 = rand()/(float)RAND_MAX ; - float f2 = rand()/(float)RAND_MAX ; + float f1 = (type == GraphWidget::ELASTIC_NODE_TYPE_OWN)?0.5:(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)); } diff --git a/retroshare-gui/src/gui/elastic/node.cpp b/retroshare-gui/src/gui/elastic/node.cpp index ca99b9ec8..c3d6b8c8d 100644 --- a/retroshare-gui/src/gui/elastic/node.cpp +++ b/retroshare-gui/src/gui/elastic/node.cpp @@ -240,27 +240,25 @@ QPainterPath Node::shape() const 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 auth_color[3] = { QColor(Qt::darkYellow), QColor(Qt::darkGreen), QColor(Qt::darkBlue) } ; + + QColor col0(type_color[_type]) ; painter->setPen(Qt::NoPen); painter->setBrush(Qt::darkGray); painter->drawEllipse(-7, -7, 20, 20); - QColor col0(type_color[_type]) ; - QColor col1(auth_color[_auth]) ; - QRadialGradient gradient(-3, -3, 10); if (option->state & QStyle::State_Sunken) { gradient.setCenter(3, 3); gradient.setFocalPoint(3, 3); - gradient.setColorAt(1, col0.light(120)); - gradient.setColorAt(0, col1.light(120)); + gradient.setColorAt(1, col0.light(120).dark(100+_auth*100)); + gradient.setColorAt(0, col0.light(70).dark(100+_auth*100)); } else { - gradient.setColorAt(0, col0); - gradient.setColorAt(1, col1); + gradient.setColorAt(1, col0.light(50).dark(100+_auth*100)); + gradient.setColorAt(0, col0.dark(100+_auth*100)); } painter->setBrush(gradient); painter->setPen(QPen(Qt::black, 0)); @@ -299,7 +297,7 @@ void Node::mousePressEvent(QGraphicsSceneMouseEvent *event) void Node::peerDetails() { std::cerr << "Calling peer details" << std::endl; - ConfCertDialog::showIt(_ssl_id, ConfCertDialog::PageDetails); + ConfCertDialog::showIt(_gpg_id, ConfCertDialog::PageDetails); } void Node::makeFriend() {