Improve Bookmark action icons and text

This commit updates the "remove bookmark" actions to use the more
specific "bookmark-remove" icon, rather than the more general
"list-remove" icon or the older "edit-delete-bookmarks" icon which does
not exist in the Breeze icon theme. For compatibility's sake, a fallback
is added to try "edit-delete-bookmarks" if "bookmark-remove" is not
found in the active icon theme.

It also uses a longer but clearer string for the "remove all bokmarks"
context menu item.
remotes/origin/work/aacid/android_nss_plugins
Nate Graham 5 years ago
parent 4dd3dc3f39
commit 3c98dcdb0c
  1. 4
      part/bookmarklist.cpp
  2. 6
      part/part.cpp

@ -246,7 +246,7 @@ void BookmarkList::contextMenuForBookmarkItem(const QPoint p, BookmarkItem *bmIt
QMenu menu(this); QMenu menu(this);
QAction *gotobm = menu.addAction(i18n("Go to This Bookmark")); QAction *gotobm = menu.addAction(i18n("Go to This Bookmark"));
QAction *editbm = menu.addAction(QIcon::fromTheme(QStringLiteral("edit-rename")), i18n("Rename Bookmark")); QAction *editbm = menu.addAction(QIcon::fromTheme(QStringLiteral("edit-rename")), i18n("Rename Bookmark"));
QAction *removebm = menu.addAction(QIcon::fromTheme(QStringLiteral("list-remove")), i18n("Remove Bookmark")); QAction *removebm = menu.addAction(QIcon::fromTheme(QStringLiteral("bookmark-remove"), QIcon::fromTheme(QStringLiteral("edit-delete-bookmark"))), i18n("Remove Bookmark"));
QAction *res = menu.exec(QCursor::pos()); QAction *res = menu.exec(QCursor::pos());
if (!res) if (!res)
return; return;
@ -273,7 +273,7 @@ void BookmarkList::contextMenuForFileItem(const QPoint p, FileItem *fItem)
if (!thisdoc) if (!thisdoc)
open = menu.addAction(i18nc("Opens the selected document", "Open Document")); open = menu.addAction(i18nc("Opens the selected document", "Open Document"));
QAction *editbm = menu.addAction(QIcon::fromTheme(QStringLiteral("edit-rename")), i18n("Rename Bookmark")); QAction *editbm = menu.addAction(QIcon::fromTheme(QStringLiteral("edit-rename")), i18n("Rename Bookmark"));
QAction *removebm = menu.addAction(QIcon::fromTheme(QStringLiteral("list-remove")), i18n("Remove Bookmarks")); QAction *removebm = menu.addAction(QIcon::fromTheme(QStringLiteral("bookmark-remove"), QIcon::fromTheme(QStringLiteral("edit-delete-bookmark"))), i18n("Remove all Bookmarks for this Document"));
QAction *res = menu.exec(QCursor::pos()); QAction *res = menu.exec(QCursor::pos());
if (!res) if (!res)
return; return;

@ -2178,7 +2178,7 @@ void Part::updateBookmarksActions()
m_addBookmark->setEnabled(true); m_addBookmark->setEnabled(true);
if (m_document->bookmarkManager()->isBookmarked(m_document->viewport())) { if (m_document->bookmarkManager()->isBookmarked(m_document->viewport())) {
m_addBookmark->setText(i18n("Remove Bookmark")); m_addBookmark->setText(i18n("Remove Bookmark"));
m_addBookmark->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete-bookmark"))); m_addBookmark->setIcon(QIcon::fromTheme(QStringLiteral("bookmark-remove"), QIcon::fromTheme(QStringLiteral("edit-delete-bookmark"))));
m_renameBookmark->setEnabled(true); m_renameBookmark->setEnabled(true);
} else { } else {
m_addBookmark->setText(m_addBookmarkText); m_addBookmark->setText(m_addBookmarkText);
@ -2418,7 +2418,7 @@ bool Part::aboutToShowContextMenu(QMenu * /*menu*/, QAction *action, QMenu *cont
QAction *renameAction = contextMenu->addAction(QIcon::fromTheme(QStringLiteral("edit-rename")), i18n("Rename this Bookmark"), this, &Part::slotRenameBookmarkFromMenu); QAction *renameAction = contextMenu->addAction(QIcon::fromTheme(QStringLiteral("edit-rename")), i18n("Rename this Bookmark"), this, &Part::slotRenameBookmarkFromMenu);
renameAction->setData(ba->property("htmlRef").toString()); renameAction->setData(ba->property("htmlRef").toString());
renameAction->setObjectName(QStringLiteral("OkularPrivateRenameBookmarkActions")); renameAction->setObjectName(QStringLiteral("OkularPrivateRenameBookmarkActions"));
QAction *deleteAction = contextMenu->addAction(QIcon::fromTheme(QStringLiteral("list-remove")), i18n("Remove this Bookmark"), this, &Part::slotRemoveBookmarkFromMenu); QAction *deleteAction = contextMenu->addAction(QIcon::fromTheme(QStringLiteral("bookmark-remove"), QIcon::fromTheme(QStringLiteral("edit-delete-bookmark"))), i18n("Remove this Bookmark"), this, &Part::slotRemoveBookmarkFromMenu);
deleteAction->setData(ba->property("htmlRef").toString()); deleteAction->setData(ba->property("htmlRef").toString());
deleteAction->setObjectName(QStringLiteral("OkularPrivateRenameBookmarkActions")); deleteAction->setObjectName(QStringLiteral("OkularPrivateRenameBookmarkActions"));
} }
@ -2989,7 +2989,7 @@ void Part::showMenu(const Okular::Page *page, const QPoint point, const QString
if (page) { if (page) {
popup->addAction(new OKMenuTitle(popup, i18n("Page %1", page->number() + 1))); popup->addAction(new OKMenuTitle(popup, i18n("Page %1", page->number() + 1)));
if ((!currentPage && m_document->bookmarkManager()->isBookmarked(page->number())) || (currentPage && m_document->bookmarkManager()->isBookmarked(m_document->viewport()))) if ((!currentPage && m_document->bookmarkManager()->isBookmarked(page->number())) || (currentPage && m_document->bookmarkManager()->isBookmarked(m_document->viewport())))
removeBookmark = popup->addAction(QIcon::fromTheme(QStringLiteral("edit-delete-bookmark")), i18n("Remove Bookmark")); removeBookmark = popup->addAction(QIcon::fromTheme(QStringLiteral("bookmark-remove"), QIcon::fromTheme(QStringLiteral("edit-delete-bookmark"))), i18n("Remove Bookmark"));
else else
addBookmark = popup->addAction(QIcon::fromTheme(QStringLiteral("bookmark-new")), i18n("Add Bookmark")); addBookmark = popup->addAction(QIcon::fromTheme(QStringLiteral("bookmark-new")), i18n("Add Bookmark"));
if (m_pageView->canFitPageWidth()) if (m_pageView->canFitPageWidth())

Loading…
Cancel
Save