1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Merge pull request #1118 from pejakm/expcoll

[Sidebar] Expand/collapse buttons for bookmarks sidebar
This commit is contained in:
David Rosca 2014-01-01 06:18:11 -08:00
commit fecb681d24
5 changed files with 78 additions and 27 deletions

View File

@ -75,5 +75,7 @@
<file>icons/browsers/internet-explorer.png</file>
<file>icons/sites/startpage.png</file>
<file>icons/sites/w3.png</file>
<file>icons/faenza/expand.png</file>
<file>icons/faenza/collapse.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

View File

@ -46,12 +46,17 @@ BookmarksSideBar::BookmarksSideBar(QupZilla* mainClass, QWidget* parent)
ui->bookmarksTree->setDragDropReceiver(true, m_bookmarksModel);
ui->bookmarksTree->setMimeType(QLatin1String("application/qupzilla.treewidgetitem.bookmarks"));
ui->expandAll->setIcon(QIcon::fromTheme("view-sort-ascending", QIcon(":/icons/faenza/expand.png")));
ui->collapseAll->setIcon(QIcon::fromTheme("view-sort-descending", QIcon(":/icons/faenza/collapse.png")));
ui->bookmarksTree->setDefaultItemShowMode(TreeWidget::ItemsExpanded);
connect(ui->bookmarksTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint)));
connect(ui->bookmarksTree, SIGNAL(itemControlClicked(QTreeWidgetItem*)), this, SLOT(itemControlClicked(QTreeWidgetItem*)));
connect(ui->bookmarksTree, SIGNAL(itemMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(itemControlClicked(QTreeWidgetItem*)));
connect(ui->bookmarksTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*)));
connect(ui->search, SIGNAL(textChanged(QString)), ui->bookmarksTree, SLOT(filterString(QString)));
connect(ui->collapseAll, SIGNAL(clicked()), ui->bookmarksTree, SLOT(collapseAll()));
connect(ui->expandAll, SIGNAL(clicked()), ui->bookmarksTree, SLOT(expandAll()));
connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark)));
connect(m_bookmarksModel, SIGNAL(bookmarkDeleted(BookmarksModel::Bookmark)), this, SLOT(removeBookmark(BookmarksModel::Bookmark)));

View File

@ -27,34 +27,78 @@
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="search">
<property name="placeholderText">
<string>Search...</string>
</property>
</widget>
</item>
<item>
<widget class="BookmarksTree" name="bookmarksTree">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ContiguousSelection</enum>
</property>
<property name="headerHidden">
<bool>true</bool>
</property>
<attribute name="headerDefaultSectionSize">
<number>330</number>
</attribute>
<column>
<property name="text">
<string notr="true">Bookmark</string>
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
</column>
<property name="spacing">
<number>0</number>
</property>
<item row="3" column="0" colspan="3">
<widget class="BookmarksTree" name="bookmarksTree">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ContiguousSelection</enum>
</property>
<property name="headerHidden">
<bool>true</bool>
</property>
<attribute name="headerDefaultSectionSize">
<number>330</number>
</attribute>
<column>
<property name="text">
<string notr="true">Bookmark</string>
</property>
</column>
</widget>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="search">
<property name="placeholderText">
<string>Search...</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="collapseAll">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Collapse All</string>
</property>
<property name="text">
<string/>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="expandAll">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Expand All</string>
</property>
<property name="text">
<string/>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>