mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-29 12:44:01 +00:00
Add buttons to collapse and expand all elements
Summary: Adds two buttons on the bottom right to expand and collapse all elements in annotations BUG: 377024 T8553 With latest breeze-icons: {F6687517} Without it: {F6687519} {F6687518} Reviewers: #okular, #vdg, ngraham Subscribers: ndavis, aacid, ngraham, okular-devel Tags: #okular Differential Revision: https://phabricator.kde.org/D18358
This commit is contained in:
parent
fe0c8ad7c9
commit
b669398404
|
@ -146,6 +146,16 @@ Reviews::Reviews( QWidget * parent, Okular::Document * document )
|
|||
connect(curPageOnlyAction, &QAction::toggled, this, &Reviews::slotCurrentPageOnly);
|
||||
curPageOnlyAction->setChecked( Okular::Settings::currentPageOnly() );
|
||||
|
||||
// Adds space between left actions, so that the next two buttons are aligned to the right
|
||||
QWidget * spacer = new QWidget();
|
||||
spacer->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
||||
toolBar->addWidget( spacer );
|
||||
|
||||
QAction * expandAll = toolBar->addAction( QIcon::fromTheme( QStringLiteral("expand-all") ), i18n( "Expand all elements" ) );
|
||||
connect(expandAll, &QAction::triggered, this, &Reviews::slotExpandAll);
|
||||
QAction * collapseAll = toolBar->addAction( QIcon::fromTheme( QStringLiteral("collapse-all") ), i18n( "Collapse all elements" ) );
|
||||
connect(collapseAll, &QAction::triggered, this, &Reviews::slotCollapseAll);
|
||||
|
||||
connect(m_view, &TreeView::activated, this, &Reviews::activated);
|
||||
|
||||
m_view->setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
|
@ -201,6 +211,16 @@ void Reviews::slotCurrentPageOnly( bool on )
|
|||
|
||||
m_view->expandAll();
|
||||
}
|
||||
|
||||
void Reviews::slotExpandAll()
|
||||
{
|
||||
m_view->expandAll();
|
||||
}
|
||||
|
||||
void Reviews::slotCollapseAll()
|
||||
{
|
||||
m_view->collapseAll();
|
||||
}
|
||||
//END GUI Slots
|
||||
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ class Reviews : public QWidget, public Okular::DocumentObserver
|
|||
void slotPageEnabled( bool );
|
||||
void slotAuthorEnabled( bool );
|
||||
void slotCurrentPageOnly( bool );
|
||||
void slotExpandAll();
|
||||
void slotCollapseAll();
|
||||
|
||||
Q_SIGNALS:
|
||||
void openAnnotationWindow( Okular::Annotation *annotation, int pageNumber );
|
||||
|
|
Loading…
Reference in a new issue