mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-24 00:31:32 -04:00
- Moved display button and new forum/channel button into GroupTreeWidget
- Fixed size of display button in FriendsDialog - Updated english translation git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6645 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4ee3bec87e
commit
21eed4c956
13 changed files with 137 additions and 265 deletions
|
@ -95,6 +95,9 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) :
|
|||
ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_NAME_INDEX , tr("Search Title"));
|
||||
ui->filterLineEdit->addFilter(QIcon(), tr("Description"), FILTER_DESC_INDEX , tr("Search Description"));
|
||||
ui->filterLineEdit->setCurrentFilter(FILTER_NAME_INDEX);
|
||||
|
||||
/* Initialize display button */
|
||||
initDisplayMenu(ui->displayButton);
|
||||
}
|
||||
|
||||
GroupTreeWidget::~GroupTreeWidget()
|
||||
|
@ -118,6 +121,20 @@ void GroupTreeWidget::changeEvent(QEvent *e)
|
|||
}
|
||||
}
|
||||
|
||||
void GroupTreeWidget::addToolButton(QToolButton *toolButton)
|
||||
{
|
||||
if (!toolButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Initialize button */
|
||||
toolButton->setAutoRaise(true);
|
||||
toolButton->setIconSize(ui->displayButton->iconSize());
|
||||
toolButton->setFocusPolicy(ui->displayButton->focusPolicy());
|
||||
|
||||
ui->titleBarFrame->layout()->addWidget(toolButton);
|
||||
}
|
||||
|
||||
void GroupTreeWidget::processSettings(RshareSettings *settings, bool load)
|
||||
{
|
||||
if (settings == NULL) {
|
||||
|
|
|
@ -73,10 +73,11 @@ public:
|
|||
GroupTreeWidget(QWidget *parent = 0);
|
||||
~GroupTreeWidget();
|
||||
|
||||
// Add a widget to the tool area
|
||||
void addToolButton(QToolButton *toolButton);
|
||||
|
||||
// Load and save settings (group must be startet from the caller)
|
||||
void processSettings(RshareSettings *settings, bool load);
|
||||
// Initialize the display menu for sorting
|
||||
void initDisplayMenu(QToolButton *toolButton);
|
||||
|
||||
// Add a new category item
|
||||
QTreeWidgetItem *addCategoryItem(const QString &name, const QIcon &icon, bool expand);
|
||||
|
@ -117,6 +118,8 @@ private slots:
|
|||
void sort();
|
||||
|
||||
private:
|
||||
// Initialize the display menu for sorting
|
||||
void initDisplayMenu(QToolButton *toolButton);
|
||||
void calculateScore(QTreeWidgetItem *item, const QString &filterText);
|
||||
void resort(QTreeWidgetItem *categoryItem);
|
||||
void updateColors();
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<height>257</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
|
@ -18,7 +18,54 @@
|
|||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="LineEditClear" name="filterLineEdit"/>
|
||||
<widget class="QFrame" name="titleBarFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="margin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="LineEditClear" name="filterLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="displayButton">
|
||||
<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>32</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="RSTreeWidget" name="treeWidget">
|
||||
|
@ -78,6 +125,8 @@
|
|||
<header>gui/common/RSTreeWidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue