From 22880ade4e9cf038bad509648f21452ee9ce27ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mladen=20Pejakovi=C4=87?= Date: Wed, 1 Jan 2014 12:29:19 +0100 Subject: [PATCH] [Sidebar] Expand/collapse buttons for bookmarks sidebar --- src/lib/data/icons.qrc | 2 + src/lib/data/icons/faenza/collapse.png | Bin 0 -> 631 bytes src/lib/data/icons/faenza/expand.png | Bin 0 -> 640 bytes src/lib/sidebar/bookmarkssidebar.cpp | 5 ++ src/lib/sidebar/bookmarkssidebar.ui | 98 ++++++++++++++++++------- 5 files changed, 78 insertions(+), 27 deletions(-) create mode 100644 src/lib/data/icons/faenza/collapse.png create mode 100644 src/lib/data/icons/faenza/expand.png diff --git a/src/lib/data/icons.qrc b/src/lib/data/icons.qrc index a1a934f94..d9f3be0c8 100644 --- a/src/lib/data/icons.qrc +++ b/src/lib/data/icons.qrc @@ -75,5 +75,7 @@ icons/browsers/internet-explorer.png icons/sites/startpage.png icons/sites/w3.png + icons/faenza/expand.png + icons/faenza/collapse.png diff --git a/src/lib/data/icons/faenza/collapse.png b/src/lib/data/icons/faenza/collapse.png new file mode 100644 index 0000000000000000000000000000000000000000..f4341b64e5a89411dcd600643093d5d40fef925e GIT binary patch literal 631 zcmV--0*L*IP)4LJ0db34u?BS zCYuNX86dp*pn!3uQaKC+0%w&<zdE!+ix@)TY!I4f-WL=Mdb0a>n@6# zh+GW@gRg-Tzu*5>L^2|x+!6r30Uws#jVrla?!ja-xdjYnvzeJnr5*usw}hBs7&WET z8^bVa{7nSla;;Xo-RX250zZH`FzEGq_sZq+_R0@UM6P>0o>z|JIJ&OuwrxKLzPH=$ z8~J?xrES~4S&voey6$f_n=gvR;%5bntJUgJI2^XB)#}mGM59nBJhN?k4orZVtEP_Q zOiQKGQy{L1hz@K6H-QfD5r}uY-C`n zbI!fr`NO$J68{4aaDft#2L?b4j8bZTe_GO@-|tV`O7@ckrBZ1GeEC-k4lt+88(u3N9y*KLU>$Ye4C zex-OCl3YnQB-QNc+VUJp?)LWf72tJ3+k#_>XLUZ=;U(G6FE1}ghlhvG!NGw843mUQ zOG^ddS|*eEJv%$wMN$}s;k+^CZ5W30c8KL52%Z94zz5)Yid(=|p-^}xsq6sxIF6?z zeU9UJDjDM5-ricJQfXU(VT$j|(IzbR@0!L>J5lI(Yt=3(jm2hEU;hv<)=EgP=N#1Zcyj`tUAM|>?JCe?&<3`e?=XnoDqtOr7 zb^YVx aXW|b$AX;p&kO&R{0000bookmarksTree->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))); diff --git a/src/lib/sidebar/bookmarkssidebar.ui b/src/lib/sidebar/bookmarkssidebar.ui index ec86c30cd..b059c7c28 100644 --- a/src/lib/sidebar/bookmarkssidebar.ui +++ b/src/lib/sidebar/bookmarkssidebar.ui @@ -27,34 +27,78 @@ 0 - - - Search... - - - - - - - Qt::CustomContextMenu - - - true - - - QAbstractItemView::ContiguousSelection - - - true - - - 330 - - - - Bookmark + + + + 0 - + + 0 + + + + + Qt::CustomContextMenu + + + true + + + QAbstractItemView::ContiguousSelection + + + true + + + 330 + + + + Bookmark + + + + + + + + Search... + + + + + + + Qt::NoFocus + + + Collapse All + + + + + + true + + + + + + + Qt::NoFocus + + + Expand All + + + + + + true + + + +