Changeset View
Changeset View
Standalone View
Standalone View
ui/side_reviews.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 52 | for ( uint i = 0; i < m_document->pages(); ++i ) | |||
---|---|---|---|---|---|
56 | } | 56 | } | ||
57 | if ( !hasAnnotations ) { | 57 | if ( !hasAnnotations ) { | ||
58 | QPainter p( viewport() ); | 58 | QPainter p( viewport() ); | ||
59 | p.setRenderHint( QPainter::Antialiasing, true ); | 59 | p.setRenderHint( QPainter::Antialiasing, true ); | ||
60 | p.setClipRect( event->rect() ); | 60 | p.setClipRect( event->rect() ); | ||
61 | 61 | | |||
62 | QTextDocument document; | 62 | QTextDocument document; | ||
63 | document.setHtml( i18n( "<div align=center><h3>No annotations</h3>" | 63 | document.setHtml( i18n( "<div align=center><h3>No annotations</h3>" | ||
64 | "To create new annotations press F6 or select <i>Tools -> Review</i>" | 64 | "To create new annotations press F6 or select <i>Tools -> Annotations</i>" | ||
65 | " from the menu.</div>" ) ); | 65 | " from the menu.</div>" ) ); | ||
66 | document.setTextWidth( width() - 50 ); | 66 | document.setTextWidth( width() - 50 ); | ||
67 | 67 | | |||
68 | const uint w = document.size().width() + 20; | 68 | const uint w = document.size().width() + 20; | ||
69 | const uint h = document.size().height() + 20; | 69 | const uint h = document.size().height() + 20; | ||
70 | 70 | | |||
71 | p.setBrush( palette().window() ); | 71 | p.setBrush( palette().window() ); | ||
72 | p.translate( 0.5, 0.5 ); | 72 | p.translate( 0.5, 0.5 ); | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 89 | { | |||
136 | QAction * groupByAuthorAction = toolBar->addAction( QIcon::fromTheme( QStringLiteral("user-identity") ), i18n( "Group by Author" ) ); | 136 | QAction * groupByAuthorAction = toolBar->addAction( QIcon::fromTheme( QStringLiteral("user-identity") ), i18n( "Group by Author" ) ); | ||
137 | groupByAuthorAction->setCheckable( true ); | 137 | groupByAuthorAction->setCheckable( true ); | ||
138 | connect(groupByAuthorAction, &QAction::toggled, this, &Reviews::slotAuthorEnabled); | 138 | connect(groupByAuthorAction, &QAction::toggled, this, &Reviews::slotAuthorEnabled); | ||
139 | groupByAuthorAction->setChecked( Okular::Settings::groupByAuthor() ); | 139 | groupByAuthorAction->setChecked( Okular::Settings::groupByAuthor() ); | ||
140 | 140 | | |||
141 | // - add separator | 141 | // - add separator | ||
142 | toolBar->addSeparator(); | 142 | toolBar->addSeparator(); | ||
143 | // - add Current Page Only button | 143 | // - add Current Page Only button | ||
144 | QAction * curPageOnlyAction = toolBar->addAction( QIcon::fromTheme( QStringLiteral("arrow-down") ), i18n( "Show reviews for current page only" ) ); | 144 | QAction * curPageOnlyAction = toolBar->addAction( QIcon::fromTheme( QStringLiteral("arrow-down") ), i18n( "Show annotations for current page only" ) ); | ||
145 | curPageOnlyAction->setCheckable( true ); | 145 | curPageOnlyAction->setCheckable( true ); | ||
146 | connect(curPageOnlyAction, &QAction::toggled, this, &Reviews::slotCurrentPageOnly); | 146 | connect(curPageOnlyAction, &QAction::toggled, this, &Reviews::slotCurrentPageOnly); | ||
147 | curPageOnlyAction->setChecked( Okular::Settings::currentPageOnly() ); | 147 | curPageOnlyAction->setChecked( Okular::Settings::currentPageOnly() ); | ||
148 | 148 | | |||
149 | // Adds space between left actions, so that the next two buttons are aligned to the right | 149 | // Adds space between left actions, so that the next two buttons are aligned to the right | ||
150 | QWidget * spacer = new QWidget(); | 150 | QWidget * spacer = new QWidget(); | ||
151 | spacer->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); | 151 | spacer->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); | ||
152 | toolBar->addWidget( spacer ); | 152 | toolBar->addWidget( spacer ); | ||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |