mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
Merge pull request #445 from PhenomRetroShare/Add_MergeDisplayMenuToHeaderContextMenu
Move Display button's menu to Header context menu on FriendList.
This commit is contained in:
commit
2921d9eac2
@ -187,8 +187,9 @@ void FriendList::addToolButton(QToolButton *toolButton)
|
|||||||
|
|
||||||
/* Initialize button */
|
/* Initialize button */
|
||||||
toolButton->setAutoRaise(true);
|
toolButton->setAutoRaise(true);
|
||||||
toolButton->setIconSize(ui->displayButton->iconSize());
|
float S = QFontMetricsF(ui->filterLineEdit->font()).height() ;
|
||||||
toolButton->setFocusPolicy(ui->displayButton->focusPolicy());
|
toolButton->setIconSize(QSize(S*1.5,S*1.5));
|
||||||
|
toolButton->setFocusPolicy(Qt::NoFocus);
|
||||||
|
|
||||||
ui->titleBarFrame->layout()->addWidget(toolButton);
|
ui->titleBarFrame->layout()->addWidget(toolButton);
|
||||||
}
|
}
|
||||||
@ -2283,16 +2284,16 @@ void FriendList::addPeerToExpand(const std::string &gpgId)
|
|||||||
|
|
||||||
void FriendList::createDisplayMenu()
|
void FriendList::createDisplayMenu()
|
||||||
{
|
{
|
||||||
QMenu *displayMenu = new QMenu(this);
|
QMenu *displayMenu = new QMenu(tr("Show"), this);
|
||||||
connect(displayMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
|
connect(displayMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
|
||||||
|
|
||||||
displayMenu->addAction(ui->actionHideOfflineFriends);
|
displayMenu->addAction(ui->actionHideOfflineFriends);
|
||||||
displayMenu->addAction(ui->actionShowState);
|
displayMenu->addAction(ui->actionShowState);
|
||||||
displayMenu->addAction(ui->actionShowGroups);
|
displayMenu->addAction(ui->actionShowGroups);
|
||||||
displayMenu->addAction(ui->actionExportFriendlist);
|
|
||||||
displayMenu->addAction(ui->actionImportFriendlist);
|
|
||||||
|
|
||||||
ui->displayButton->setMenu(displayMenu);
|
ui->peerTreeWidget->addHeaderContextMenuMenu(displayMenu);
|
||||||
|
ui->peerTreeWidget->addHeaderContextMenuAction(ui->actionExportFriendlist);
|
||||||
|
ui->peerTreeWidget->addHeaderContextMenuAction(ui->actionImportFriendlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FriendList::updateMenu()
|
void FriendList::updateMenu()
|
||||||
|
@ -53,38 +53,6 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="LineEditClear" name="filterLineEdit"/>
|
<widget class="LineEditClear" name="filterLineEdit"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="displayButton">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>30</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::NoFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Display</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../images.qrc">
|
|
||||||
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="popupMode">
|
|
||||||
<enum>QToolButton::InstantPopup</enum>
|
|
||||||
</property>
|
|
||||||
<property name="autoRaise">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -188,8 +156,6 @@
|
|||||||
<header>gui/common/RSTreeWidget.h</header>
|
<header>gui/common/RSTreeWidget.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources/>
|
||||||
<include location="../images.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
Loading…
Reference in New Issue
Block a user