mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-19 04:44:21 -05:00
added For Friends Context Menu a Title Widget
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1681 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cef9385f5b
commit
6d6798e788
@ -169,6 +169,7 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||||||
menu->addAction(ui.actionAdd_Friend);
|
menu->addAction(ui.actionAdd_Friend);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(ui.actionCreate_new_Profile);
|
menu->addAction(ui.actionCreate_new_Profile);
|
||||||
|
//ui.menupushButton->setPopupMode(QToolButton::MenuButtonPopup);
|
||||||
ui.menupushButton->setMenu(menu);
|
ui.menupushButton->setMenu(menu);
|
||||||
|
|
||||||
updateAvatar();
|
updateAvatar();
|
||||||
@ -208,7 +209,31 @@ void PeersDialog::peertreeWidgetCostumPopupMenu( QPoint point )
|
|||||||
connect( removefriendAct , SIGNAL( triggered() ), this, SLOT( removefriend() ) );
|
connect( removefriendAct , SIGNAL( triggered() ), this, SLOT( removefriend() ) );
|
||||||
|
|
||||||
|
|
||||||
|
QWidget *widget = new QWidget();
|
||||||
|
widget->setStyleSheet( ".QWidget{background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,stop:0 #FEFEFE, stop:1 #E8E8E8); border: 1px solid #CCCCCC;}");
|
||||||
|
|
||||||
|
QHBoxLayout *hbox = new QHBoxLayout();
|
||||||
|
hbox->setMargin(0);
|
||||||
|
hbox->setSpacing(6);
|
||||||
|
|
||||||
|
iconLabel = new QLabel( this );
|
||||||
|
iconLabel->setPixmap(QPixmap::QPixmap(":/images/user/friends24.png"));
|
||||||
|
iconLabel->setMaximumSize( iconLabel->frameSize().height() + 24, 24 );
|
||||||
|
hbox->addWidget(iconLabel);
|
||||||
|
|
||||||
|
textLabel = new QLabel( tr("<strong>Friends</strong>"), this );
|
||||||
|
hbox->addWidget(textLabel);
|
||||||
|
|
||||||
|
spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
hbox->addItem(spacerItem);
|
||||||
|
|
||||||
|
widget->setLayout( hbox );
|
||||||
|
|
||||||
|
QWidgetAction *widgetAction = new QWidgetAction(this);
|
||||||
|
widgetAction->setDefaultWidget(widget);
|
||||||
|
|
||||||
contextMnu.clear();
|
contextMnu.clear();
|
||||||
|
contextMnu.addAction( widgetAction);
|
||||||
contextMnu.addAction( chatAct);
|
contextMnu.addAction( chatAct);
|
||||||
contextMnu.addAction( msgAct);
|
contextMnu.addAction( msgAct);
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
@ -219,7 +244,7 @@ void PeersDialog::peertreeWidgetCostumPopupMenu( QPoint point )
|
|||||||
contextMnu.addAction( exportfriendAct);
|
contextMnu.addAction( exportfriendAct);
|
||||||
contextMnu.addAction( removefriendAct);
|
contextMnu.addAction( removefriendAct);
|
||||||
contextMnu.exec( mevent->globalPos() );
|
contextMnu.exec( mevent->globalPos() );
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,6 +119,10 @@ signals:
|
|||||||
void notifyGroupChat(const QString&,const QString&) ;
|
void notifyGroupChat(const QString&,const QString&) ;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
class QLabel *iconLabel, *textLabel;
|
||||||
|
class QWidget *widget;
|
||||||
|
class QWidgetAction *widgetAction;
|
||||||
|
class QSpacerItem *spacerItem;
|
||||||
|
|
||||||
/* Worker Functions */
|
/* Worker Functions */
|
||||||
/* (1) Update Display */
|
/* (1) Update Display */
|
||||||
@ -126,9 +130,6 @@ private:
|
|||||||
/* (2) Utility Fns */
|
/* (2) Utility Fns */
|
||||||
QTreeWidgetItem *getCurrentPeer();
|
QTreeWidgetItem *getCurrentPeer();
|
||||||
|
|
||||||
// ChatDialog *chatDialog;
|
|
||||||
|
|
||||||
|
|
||||||
/** Define the popup menus for the Context menu */
|
/** Define the popup menus for the Context menu */
|
||||||
QMenu* contextMnu;
|
QMenu* contextMnu;
|
||||||
/** Defines the actions for the context menu */
|
/** Defines the actions for the context menu */
|
||||||
|
Loading…
Reference in New Issue
Block a user