1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

[IconProvider] Use fallback oxygen icon theme (in oxygen-fallback.qrc)

Instead of manually setting fallback icons, use globally fallback theme.
This commit is contained in:
nowrep 2014-03-24 16:08:33 +01:00
parent 3c0576fcfa
commit ab638a5525
66 changed files with 161 additions and 110 deletions

View File

@ -325,7 +325,7 @@ void BrowserWindow::setupUi()
statusBar()->setCursor(Qt::ArrowCursor);
m_progressBar = new ProgressBar(statusBar());
m_privateBrowsing = new QLabel(this);
m_privateBrowsing->setPixmap(QPixmap(":/icons/locationbar/privatebrowsing.png"));
m_privateBrowsing->setPixmap(IconProvider::privateBrowsingIcon().pixmap(16));
m_privateBrowsing->setVisible(false);
m_privateBrowsing->setToolTip(tr("Private Browsing Enabled"));
m_adblockIcon = new AdBlockIcon(this);

View File

@ -498,7 +498,7 @@ void MainMenu::init()
connect(action, SIGNAL(triggered()), this, SLOT(showAboutDialog()));
m_actions[QSL("Standard/About")] = action;
action = new QAction(QIcon::fromTheme(QSL("preferences-desktop"), QIcon(QSL(":/icons/theme/settings.png"))), tr("Pr&eferences"), this);
action = new QAction(IconProvider::settingsIcon(), tr("Pr&eferences"), this);
action->setMenuRole(QAction::PreferencesRole);
action->setShortcut(QKeySequence(QKeySequence::Preferences));
connect(action, SIGNAL(triggered()), this, SLOT(showPreferences()));
@ -515,9 +515,9 @@ void MainMenu::init()
connect(m_menuFile, SIGNAL(aboutToShow()), this, SLOT(aboutToShowFileMenu()));
connect(m_menuFile, SIGNAL(aboutToHide()), this, SLOT(aboutToHideFileMenu()));
ADD_ACTION("File/NewTab", m_menuFile, QIcon::fromTheme(QSL("tab-new"), QIcon(QSL(":/icons/menu/tab-new.png"))), tr("New Tab"), SLOT(newTab()), "Ctrl+T");
ADD_ACTION("File/NewWindow", m_menuFile, QIcon::fromTheme(QSL("window-new")), tr("&New Window"), SLOT(newWindow()), "Ctrl+N");
ADD_ACTION("File/NewPrivateWindow", m_menuFile, QIcon(QSL(":/icons/locationbar/privatebrowsing.png")), tr("New &Private Window"), SLOT(newPrivateWindow()), "Ctrl+Shift+P");
ADD_ACTION("File/NewTab", m_menuFile, IconProvider::newTabIcon(), tr("New Tab"), SLOT(newTab()), "Ctrl+T");
ADD_ACTION("File/NewWindow", m_menuFile, IconProvider::newWindowIcon(), tr("&New Window"), SLOT(newWindow()), "Ctrl+N");
ADD_ACTION("File/NewPrivateWindow", m_menuFile, IconProvider::privateBrowsingIcon(), tr("New &Private Window"), SLOT(newPrivateWindow()), "Ctrl+Shift+P");
ADD_ACTION("File/OpenLocation", m_menuFile, QIcon::fromTheme(QSL("document-open-remote")), tr("Open Location"), SLOT(openLocation()), "Ctrl+L");
ADD_ACTION("File/OpenFile", m_menuFile, QIcon::fromTheme(QSL("document-open")), tr("Open &File..."), SLOT(openFile()), "Ctrl+O");
ADD_ACTION("File/CloseWindow", m_menuFile, QIcon::fromTheme(QSL("window-close")), tr("Close Window"), SLOT(closeWindow()), "Ctrl+Shift+W");
@ -561,8 +561,8 @@ void MainMenu::init()
m_menuView->addMenu(sidebarMenu);
ADD_CHECKABLE_ACTION("View/ShowStatusBar", m_menuView, QIcon(), tr("Sta&tus Bar"), SLOT(showStatusBar()), "");
m_menuView->addSeparator();
ADD_ACTION("View/Stop", m_menuView, IconProvider::standardIcon(QStyle::SP_BrowserStop), tr("&Stop"), SLOT(stop()), "Esc");
ADD_ACTION("View/Reload", m_menuView, IconProvider::standardIcon(QStyle::SP_BrowserReload), tr("&Reload"), SLOT(reload()), "F5");
ADD_ACTION("View/Stop", m_menuView, QIcon::fromTheme(QSL("process-stop")), tr("&Stop"), SLOT(stop()), "Esc");
ADD_ACTION("View/Reload", m_menuView, QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), SLOT(reload()), "F5");
m_menuView->addSeparator();
ADD_ACTION("View/ZoomIn", m_menuView, QIcon::fromTheme(QSL("zoom-in")), tr("Zoom &In"), SLOT(zoomIn()), "Ctrl++");
ADD_ACTION("View/ZoomOut", m_menuView, QIcon::fromTheme(QSL("zoom-out")), tr("Zoom &Out"), SLOT(zoomOut()), "Ctrl+-");
@ -585,7 +585,7 @@ void MainMenu::init()
ADD_ACTION("Tools/DownloadManager", m_menuTools, QIcon(), tr("&Download Manager"), SLOT(showDownloadManager()), "Ctrl+Y");
ADD_ACTION("Tools/CookiesManager", m_menuTools, QIcon(), tr("&Cookies Manager"), SLOT(showCookieManager()), "");
ADD_ACTION("Tools/AdBlock", m_menuTools, QIcon(), tr("&AdBlock"), SLOT(showAdBlockDialog()), "");
ADD_ACTION("Tools/RssReader", m_menuTools, QIcon(":/icons/menu/rss.png"), tr("RSS &Reader"), SLOT(showRssManager()), "");
ADD_ACTION("Tools/RssReader", m_menuTools, QIcon(), tr("RSS &Reader"), SLOT(showRssManager()), "");
ADD_ACTION("Tools/WebInspector", m_menuTools, QIcon(), tr("Web In&spector"), SLOT(showWebInspector()), "Ctrl+Shift+I");
ADD_ACTION("Tools/ClearRecentHistory", m_menuTools, QIcon::fromTheme(QSL("edit-clear")), tr("Clear Recent &History"), SLOT(showClearRecentHistoryDialog()), "Ctrl+Shift+Del");
m_menuTools->addSeparator();

View File

@ -17,12 +17,13 @@
* ============================================================ */
#include "bookmarksmanager.h"
#include "ui_bookmarksmanager.h"
#include "bookmarks.h"
#include "bookmarkitem.h"
#include "bookmarksmodel.h"
#include "bookmarkstools.h"
#include "bookmarkitem.h"
#include "bookmarks.h"
#include "mainapplication.h"
#include "browserwindow.h"
#include "iconprovider.h"
#include "qztools.h"
#include <QMenu>
@ -101,9 +102,9 @@ void BookmarksManager::bookmarksSelected(const QList<BookmarkItem*> &items)
void BookmarksManager::createContextMenu(const QPoint &pos)
{
QMenu menu;
QAction* actNewTab = menu.addAction(QIcon::fromTheme("tab-new", QIcon(":/icons/menu/tab-new.png")), tr("Open in new tab"));
QAction* actNewWindow = menu.addAction(QIcon::fromTheme("window-new"), tr("Open in new window"));
QAction* actNewPrivateWindow = menu.addAction(QIcon(":icons/locationbar/privatebrowsing.png"), tr("Open in new private window"));
QAction* actNewTab = menu.addAction(IconProvider::newTabIcon(), tr("Open in new tab"));
QAction* actNewWindow = menu.addAction(IconProvider::newWindowIcon(), tr("Open in new window"));
QAction* actNewPrivateWindow = menu.addAction(IconProvider::privateBrowsingIcon(), tr("Open in new private window"));
menu.addSeparator();
menu.addAction(tr("New Bookmark"), this, SLOT(addBookmark()));

View File

@ -21,7 +21,6 @@
#include "bookmarks.h"
#include "mainapplication.h"
#include "browsinglibrary.h"
#include "iconprovider.h"
#include "browserwindow.h"
#include "qzsettings.h"
#include "tabwidget.h"
@ -153,7 +152,7 @@ void BookmarksMenu::init()
addAction(QIcon::fromTheme("bookmark-new"), tr("Bookmark &This Page"), this, SLOT(bookmarkPage()))->setShortcut(QKeySequence("Ctrl+D"));
addAction(QIcon::fromTheme("bookmark-new-list"), tr("Bookmark &All Tabs"), this, SLOT(bookmarkAllTabs()));
addAction(IconProvider::iconFromTheme("bookmarks-organize"), tr("Organize &Bookmarks"), this, SLOT(showBookmarksManager()))->setShortcut(QKeySequence("Ctrl+Shift+O"));
addAction(QIcon::fromTheme("bookmarks-organize"), tr("Organize &Bookmarks"), this, SLOT(showBookmarksManager()))->setShortcut(QKeySequence("Ctrl+Shift+O"));
addSeparator();
connect(this, SIGNAL(aboutToShow()), this, SLOT(aboutToShow()));

View File

@ -19,8 +19,9 @@
#include "bookmarkstoolbarbutton.h"
#include "bookmarkstools.h"
#include "bookmarkitem.h"
#include "mainapplication.h"
#include "bookmarks.h"
#include "mainapplication.h"
#include "iconprovider.h"
#include <QDragEnterEvent>
#include <QHBoxLayout>
@ -66,8 +67,8 @@ void BookmarksToolbar::contextMenuRequested(const QPoint &pos)
m_clickedBookmark = button ? button->bookmark() : 0;
QMenu menu;
QAction* actNewTab = menu.addAction(QIcon::fromTheme("tab-new", QIcon(":/icons/menu/tab-new.png")), tr("Open in new tab"));
QAction* actNewWindow = menu.addAction(QIcon::fromTheme("window-new"), tr("Open in new window"));
QAction* actNewTab = menu.addAction(IconProvider::newTabIcon(), tr("Open in new tab"));
QAction* actNewWindow = menu.addAction(IconProvider::newWindowIcon(), tr("Open in new window"));
menu.addSeparator();
QAction* actDelete = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
menu.addSeparator();

View File

@ -22,6 +22,7 @@
#include "mainapplication.h"
#include "qztools.h"
#include "settings.h"
#include "iconprovider.h"
#include <QNetworkCookie>
#include <QMessageBox>
@ -202,7 +203,7 @@ void CookieManager::slotRefreshTable()
else {
QTreeWidgetItem* newParent = new QTreeWidgetItem(ui->cookieTree);
newParent->setText(0, cookieDomain);
newParent->setIcon(0, style()->standardIcon(QStyle::SP_DirIcon));
newParent->setIcon(0, IconProvider::standardIcon(QStyle::SP_DirIcon));
newParent->setData(0, Qt::UserRole + 10, cookie.domain());
ui->cookieTree->addTopLevelItem(newParent);
hash[cookieDomain] = newParent;

View File

@ -16,8 +16,6 @@
<file>icons/preferences/extension.png</file>
<file>icons/theme/settings.png</file>
<file>qupzilla.png</file>
<file>icons/locationbar/privatebrowsing.png</file>
<file>icons/locationbar/unknownpage.png</file>
<file>icons/menu/history.png</file>
<file>icons/menu/history_entry.png</file>
<file>icons/menu/tab-new.png</file>
@ -81,5 +79,8 @@
<file>icons/theme/speeddial.png</file>
<file>icons/theme/view-restore.png</file>
<file>icons/other/loading.png</file>
<file>icons/other/empty-page.png</file>
<file>icons/menu/privatebrowsing.png</file>
<file>icons/menu/settings.png</file>
</qresource>
</RCC>

View File

Before

Width:  |  Height:  |  Size: 409 B

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

View File

Before

Width:  |  Height:  |  Size: 530 B

After

Width:  |  Height:  |  Size: 530 B

View File

@ -0,0 +1,43 @@
<RCC>
<qresource prefix="/oxygen-fallback">
<file>oxygen-fallback/index.theme</file>
<file>oxygen-fallback/16x16/go-down.png</file>
<file>oxygen-fallback/16x16/go-home.png</file>
<file>oxygen-fallback/16x16/go-jump-locationbar.png</file>
<file>oxygen-fallback/16x16/go-next.png</file>
<file>oxygen-fallback/16x16/go-previous.png</file>
<file>oxygen-fallback/16x16/go-up.png</file>
<file>oxygen-fallback/16x16/list-add.png</file>
<file>oxygen-fallback/16x16/list-remove.png</file>
<file>oxygen-fallback/16x16/process-stop.png</file>
<file>oxygen-fallback/16x16/tab-new.png</file>
<file>oxygen-fallback/16x16/user-trash-full.png</file>
<file>oxygen-fallback/16x16/view-refresh.png</file>
<file>oxygen-fallback/16x16/view-restore.png</file>
<file>oxygen-fallback/22x22/go-down.png</file>
<file>oxygen-fallback/22x22/go-home.png</file>
<file>oxygen-fallback/22x22/go-jump-locationbar.png</file>
<file>oxygen-fallback/22x22/go-next.png</file>
<file>oxygen-fallback/22x22/go-previous.png</file>
<file>oxygen-fallback/22x22/go-up.png</file>
<file>oxygen-fallback/22x22/list-add.png</file>
<file>oxygen-fallback/22x22/list-remove.png</file>
<file>oxygen-fallback/22x22/process-stop.png</file>
<file>oxygen-fallback/22x22/tab-new.png</file>
<file>oxygen-fallback/22x22/user-trash-full.png</file>
<file>oxygen-fallback/22x22/view-refresh.png</file>
<file>oxygen-fallback/22x22/view-restore.png</file>
<file>oxygen-fallback/32x32/preferences-desktop.png</file>
<file>oxygen-fallback/32x32/preferences-system-network.png</file>
<file>oxygen-fallback/16x16/bookmark-new.png</file>
<file>oxygen-fallback/16x16/bookmarks-organize.png</file>
<file>oxygen-fallback/16x16/configure.png</file>
<file>oxygen-fallback/22x22/bookmark-new.png</file>
<file>oxygen-fallback/22x22/bookmarks-organize.png</file>
<file>oxygen-fallback/22x22/configure.png</file>
<file>oxygen-fallback/16x16/dialog-close.png</file>
<file>oxygen-fallback/22x22/dialog-close.png</file>
<file>oxygen-fallback/16x16/window-new.png</file>
<file>oxygen-fallback/22x22/window-new.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,15 @@
[Icon Theme]
Name=Oxygen
Comment=Oxygen Team
DisplayDepth=32
Inherits=default
Directories=16x16,22x22,32x32
[16x16]
Size=16
[22x22]
Size=22
[32x32]
Size=32

View File

@ -22,7 +22,6 @@
#include "tabwidget.h"
#include "webpage.h"
#include "downloadmanager.h"
#include "iconprovider.h"
#include "networkmanager.h"
#include "qztools.h"
#include "schemehandlers/ftpschemehandler.h"
@ -72,7 +71,7 @@ DownloadItem::DownloadItem(QListWidgetItem* item, QNetworkReply* reply, const QS
ui->setupUi(this);
setMaximumWidth(525);
ui->button->setPixmap(IconProvider::standardIcon(QStyle::SP_BrowserStop).pixmap(20, 20));
ui->button->setPixmap(QIcon::fromTheme(QSL("process-stop")).pixmap(20, 20));
ui->fileName->setText(m_fileName);
ui->downloadInfo->setText(tr("Remaining time unavailable"));
ui->fileIcon->setPixmap(fileIcon);
@ -378,7 +377,7 @@ void DownloadItem::customContextMenuRequested(const QPoint &pos)
menu.addAction(tr("Go to Download Page"), this, SLOT(goToDownloadPage()))->setEnabled(!m_downloadPage.isEmpty());
menu.addAction(QIcon::fromTheme("edit-copy"), tr("Copy Download Link"), this, SLOT(copyDownloadLink()));
menu.addSeparator();
menu.addAction(IconProvider::standardIcon(QStyle::SP_BrowserStop), tr("Cancel downloading"), this, SLOT(stop()))->setEnabled(m_downloading);
menu.addAction(QIcon::fromTheme("process-stop"), tr("Cancel downloading"), this, SLOT(stop()))->setEnabled(m_downloading);
menu.addAction(QIcon::fromTheme("list-remove"), tr("Remove From List"), this, SLOT(clear()))->setEnabled(!m_downloading);
if (m_downloading || ui->downloadInfo->text().startsWith(tr("Cancelled")) || ui->downloadInfo->text().startsWith(tr("Error"))) {

View File

@ -270,7 +270,7 @@ void DownloadManager::downloadFinished(bool success)
if (downloadingAllFilesFinished) {
if (success && qApp->activeWindow() != this) {
mApp->desktopNotifications()->showNotification(QIcon::fromTheme("mail-inbox", QIcon(":icons/notifications/download.png")).pixmap(48), tr("Download Finished"), tr("All files have been successfully downloaded."));
mApp->desktopNotifications()->showNotification(QIcon::fromTheme(QSL("download"), QIcon(":icons/notifications/download.png")).pixmap(48), tr("Download Finished"), tr("All files have been successfully downloaded."));
if (!m_closeOnFinish) {
raise();
activateWindow();

View File

@ -219,7 +219,7 @@ void HistoryMenu::init()
act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowForward), tr("&Forward"), this, SLOT(goForward()));
act->setShortcut(actionShortcut(QKeySequence::Forward, Qt::ALT + Qt::Key_Right, QKeySequence::Back, Qt::ALT + Qt::Key_Left));
act = addAction(IconProvider::iconFromTheme("go-home"), tr("&Home"), this, SLOT(goHome()));
act = addAction(QIcon::fromTheme("go-home"), tr("&Home"), this, SLOT(goHome()));
act->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Home));
act = addAction(QIcon::fromTheme("view-history", QIcon(":/icons/menu/history.png")), tr("Show &All History"), this, SLOT(showHistoryManager()));

View File

@ -524,6 +524,7 @@ RESOURCES += \
data/html.qrc \
data/data.qrc \
data/certs.qrc \
data/oxygen-fallback.qrc
isEqual(QT_MAJOR_VERSION, 5) {
include(3rdparty/qftp.pri)

View File

@ -129,7 +129,7 @@ void LocationCompleterDelegate::paint(QPainter* painter, const QStyleOptionViewI
int tabPos = index.data(LocationCompleterModel::TabPositionTabRole).toInt();
if (drawSwitchToTab() && tabPos != -1) {
const QIcon tabIcon = QIcon(":icons/menu/tab.png");
const QIcon tabIcon = QIcon(QSL(":icons/menu/tab.png"));
QRect iconRect(linkRect);
iconRect.setWidth(m_padding + 16 + m_padding);
tabIcon.paint(painter, iconRect);

View File

@ -28,6 +28,7 @@
#include "searchenginesmanager.h"
#include "searchenginesdialog.h"
#include "networkmanager.h"
#include "iconprovider.h"
#include <QMimeData>
#include <QAbstractItemView>
@ -106,7 +107,7 @@ void WebSearchBar::aboutToShowMenu()
menu->addSeparator();
completeMenuWithAvailableEngines(menu);
menu->addSeparator();
menu->addAction(QIcon(":icons/menu/gear.png"), tr("Manage Search Engines"), this, SLOT(openSearchEnginesDialog()));
menu->addAction(IconProvider::settingsIcon(), tr("Manage Search Engines"), this, SLOT(openSearchEnginesDialog()));
}
void WebSearchBar::addSuggestions(const QStringList &list)

View File

@ -20,7 +20,6 @@
#include "htmlhighlighter.h"
#include "sourceviewersearch.h"
#include "qztools.h"
#include "iconprovider.h"
#include "enhancedmenu.h"
#include "plaineditwithlines.h"
@ -95,7 +94,7 @@ SourceViewer::SourceViewer(QWebFrame* frame, const QString &selectedHtml)
m_actionPaste->setShortcut(QKeySequence("Ctrl+V"));
QMenu* menuView = new QMenu(tr("View"));
menuView->addAction(IconProvider::standardIcon(QStyle::SP_BrowserReload), tr("Reload"), this, SLOT(reload()))->setShortcut(QKeySequence("F5"));
menuView->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("Reload"), this, SLOT(reload()))->setShortcut(QKeySequence("F5"));
menuView->addSeparator();
menuView->addAction(tr("Editable"), this, SLOT(setTextEditable()))->setCheckable(true);
menuView->addAction(tr("Word Wrap"), this, SLOT(setTextWordWrap()))->setCheckable(true);

View File

@ -25,7 +25,6 @@
#include "qzsettings.h"
#include "popuplocationbar.h"
#include "qztools.h"
#include "iconprovider.h"
#include <QVBoxLayout>
#include <QStatusBar>
@ -82,9 +81,9 @@ PopupWindow::PopupWindow(PopupWebView* view)
m_menuBar->addMenu(m_menuEdit);
m_menuView = new QMenu(tr("View"));
m_actionStop = m_menuView->addAction(IconProvider::standardIcon(QStyle::SP_BrowserStop), tr("&Stop"), m_view, SLOT(stop()));
m_actionStop = m_menuView->addAction(QIcon::fromTheme(QSL("process-stop")), tr("&Stop"), m_view, SLOT(stop()));
m_actionStop->setShortcut(QKeySequence("Esc"));
m_actionReload = m_menuView->addAction(IconProvider::standardIcon(QStyle::SP_BrowserReload), tr("&Reload"), m_view, SLOT(reload()));
m_actionReload = m_menuView->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), m_view, SLOT(reload()));
m_actionReload->setShortcut(QKeySequence("F5"));
m_menuView->addSeparator();
m_menuView->addAction(QIcon::fromTheme("zoom-in"), tr("Zoom &In"), m_view, SLOT(zoomIn()))->setShortcut(QKeySequence("Ctrl++"));

View File

@ -53,7 +53,7 @@ RSSManager::RSSManager(BrowserWindow* window, QWidget* parent)
m_reloadButton = new QToolButton(this);
m_reloadButton->setAutoRaise(true);
m_reloadButton->setToolTip(tr("Reload"));
m_reloadButton->setIcon(IconProvider::standardIcon(QStyle::SP_BrowserReload));
m_reloadButton->setIcon(QIcon::fromTheme(QSL("view-refresh")));
ui->tabWidget->setCornerWidget(m_reloadButton);

View File

@ -21,6 +21,7 @@
#include "bookmarkitem.h"
#include "bookmarks.h"
#include "mainapplication.h"
#include "iconprovider.h"
#include <QMenu>
@ -99,9 +100,9 @@ void BookmarksSidebar::deleteBookmarks()
void BookmarksSidebar::createContextMenu(const QPoint &pos)
{
QMenu menu;
QAction* actNewTab = menu.addAction(QIcon::fromTheme("tab-new", QIcon(":/icons/menu/tab-new.png")), tr("Open in new tab"));
QAction* actNewWindow = menu.addAction(QIcon::fromTheme("window-new"), tr("Open in new window"));
QAction* actNewPrivateWindow = menu.addAction(QIcon(":icons/locationbar/privatebrowsing.png"), tr("Open in new private window"));
QAction* actNewTab = menu.addAction(IconProvider::newTabIcon(), tr("Open in new tab"));
QAction* actNewWindow = menu.addAction(IconProvider::newWindowIcon(), tr("Open in new window"));
QAction* actNewPrivateWindow = menu.addAction(IconProvider::privateBrowsingIcon(), tr("Open in new private window"));
menu.addSeparator();
QAction* actDelete = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));

View File

@ -70,95 +70,81 @@ QIcon IconProvider::standardIcon(QStyle::StandardPixmap icon)
{
switch (icon) {
case QStyle::SP_MessageBoxCritical:
return QIcon::fromTheme("dialog-error", QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical));
return QIcon::fromTheme(QSL("dialog-error"), QApplication::style()->standardIcon(icon));
case QStyle::SP_MessageBoxInformation:
return QIcon::fromTheme("dialog-information", QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation));
return QIcon::fromTheme(QSL("dialog-information"), QApplication::style()->standardIcon(icon));
case QStyle::SP_MessageBoxQuestion:
return QIcon::fromTheme("dialog-question", QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion));
return QIcon::fromTheme(QSL("dialog-question"), QApplication::style()->standardIcon(icon));
case QStyle::SP_MessageBoxWarning:
return QIcon::fromTheme("dialog-warning", QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning));
return QIcon::fromTheme(QSL("dialog-warning"), QApplication::style()->standardIcon(icon));
#ifndef QZ_WS_X11
case QStyle::SP_DialogCloseButton:
return QIcon(":/icons/theme/close.png");
return QIcon::fromTheme(QSL("dialog-close"), QApplication::style()->standardIcon(icon));
case QStyle::SP_BrowserStop:
return QIcon(":/icons/theme/stop.png");
return QIcon::fromTheme(QSL("process-stop"), QApplication::style()->standardIcon(icon));
case QStyle::SP_BrowserReload:
return QIcon(":/icons/theme/reload.png");
return QIcon::fromTheme(QSL("view-refresh"), QApplication::style()->standardIcon(icon));
case QStyle::SP_FileDialogToParent:
return QIcon(":/icons/theme/go-up.png");
return QIcon::fromTheme(QSL("go-up"), QApplication::style()->standardIcon(icon));
case QStyle::SP_ArrowUp:
return QIcon::fromTheme(QSL("go-up"), QApplication::style()->standardIcon(icon));
case QStyle::SP_ArrowDown:
return QIcon::fromTheme(QSL("go-down"), QApplication::style()->standardIcon(icon));
case QStyle::SP_ArrowForward:
//RTL Support
if (QApplication::layoutDirection() == Qt::RightToLeft) {
return QIcon(":/icons/theme/back.png");
}
else {
return QIcon(":/icons/theme/forward.png");
return QIcon::fromTheme(QSL("go-previous"), QApplication::style()->standardIcon(icon));
}
return QIcon::fromTheme(QSL("go-next"), QApplication::style()->standardIcon(icon));
case QStyle::SP_ArrowBack:
//RTL Support
if (QApplication::layoutDirection() == Qt::RightToLeft) {
return QIcon(":/icons/theme/forward.png");
return QIcon::fromTheme(QSL("go-next"), QApplication::style()->standardIcon(icon));
}
else {
return QIcon(":/icons/theme/back.png");
}
#endif
return QIcon::fromTheme(QSL("go-previous"), QApplication::style()->standardIcon(icon));
default:
return QApplication::style()->standardIcon(icon);
}
}
QIcon IconProvider::iconFromTheme(const QString &icon)
QIcon IconProvider::newTabIcon()
{
// TODO: This should actually look in :icons/theme for fallback icon, not hardcode every icon
return QIcon::fromTheme(QSL("tab-new"), QIcon(QSL(":/icons/menu/tab-new.png")));
}
if (icon == QLatin1String("go-home")) {
return QIcon::fromTheme("go-home", QIcon(":/icons/theme/home.png"));
}
else if (icon == QLatin1String("text-plain")) {
return QIcon::fromTheme("text-plain", QIcon(":icons/locationbar/unknownpage.png"));
}
else if (icon == QLatin1String("bookmarks-organize")) {
return QIcon::fromTheme("bookmarks-organize", QIcon(":icons/theme/user-bookmarks.png"));
}
else if (icon == QLatin1String("bookmark-new")) {
return QIcon::fromTheme("bookmark-new", QIcon(":icons/theme/user-bookmarks.png"));
}
else if (icon == QLatin1String("list-remove")) {
return QIcon::fromTheme("list-remove", QIcon(":icons/theme/list-remove.png"));
}
else if (icon == QLatin1String("go-next")) {
return QIcon::fromTheme("go-next", QIcon(":icons/theme/go-next.png"));
}
else if (icon == QLatin1String("go-previous")) {
return QIcon::fromTheme("go-previous", QIcon(":icons/theme/go-previous.png"));
}
else if (icon == QLatin1String("view-restore")) {
return QIcon::fromTheme("view-restore", QIcon(":icons/theme/view-restore.png"));
}
else {
return QIcon::fromTheme(icon);
}
QIcon IconProvider::newWindowIcon()
{
return QIcon::fromTheme(QSL("window-new"), QIcon(QSL(":/icons/menu/window-new.png")));
}
QIcon IconProvider::privateBrowsingIcon()
{
return QIcon(QSL(":/icons/menu/privatebrowsing.png"));
}
QIcon IconProvider::settingsIcon()
{
return QIcon(QSL(":/icons/menu/settings.png"));
}
QIcon IconProvider::emptyWebIcon()
{
return QPixmap::fromImage(instance()->m_emptyWebImage);
return QPixmap::fromImage(instance()->emptyWebImage());
}
QImage IconProvider::emptyWebImage()
{
if (instance()->m_emptyWebImage.isNull()) {
instance()->m_emptyWebImage = iconFromTheme("text-plain").pixmap(16, 16).toImage();
instance()->m_emptyWebImage = QPixmap(":icons/other/empty-page.png").toImage();
}
return instance()->m_emptyWebImage;
@ -262,9 +248,5 @@ void IconProvider::clearIconsDatabase()
QIcon IconProvider::iconFromImage(const QImage &image)
{
if (m_emptyWebImage.isNull()) {
m_emptyWebImage = iconFromTheme("text-plain").pixmap(16, 16).toImage();
}
return QIcon(QPixmap::fromImage(image));
}

View File

@ -45,9 +45,13 @@ public:
QPixmap bookmarkIcon() const;
void setBookmarkIcon(const QPixmap &pixmap);
// QStyle equivalents
// QStyle equivalent
static QIcon standardIcon(QStyle::StandardPixmap icon);
static QIcon iconFromTheme(const QString &icon);
static QIcon newTabIcon();
static QIcon newWindowIcon();
static QIcon privateBrowsingIcon();
static QIcon settingsIcon();
// Icon for empty page
static QIcon emptyWebIcon();

View File

@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "toolbutton.h"
#include "iconprovider.h"
#include <QMouseEvent>
#include <QMenu>
@ -36,7 +35,7 @@ ToolButton::ToolButton(QWidget* parent)
void ToolButton::setThemeIcon(const QString &image)
{
m_themeIcon = image;
setIcon(IconProvider::iconFromTheme(image));
setIcon(QIcon::fromTheme(image));
m_usingMultiIcon = false;
}

View File

@ -20,13 +20,13 @@
#include "tabpreview.h"
#include "browserwindow.h"
#include "webtab.h"
#include "iconprovider.h"
#include "toolbutton.h"
#include "settings.h"
#include "tabbedwebview.h"
#include "mainapplication.h"
#include "pluginproxy.h"
#include "proxystyle.h"
#include "iconprovider.h"
#include <QMenu>
#include <QMimeData>
@ -143,7 +143,7 @@ void TabBar::contextMenuRequested(const QPoint &position)
m_clickedTab = index;
QMenu menu;
menu.addAction(QIcon::fromTheme("tab-new", QIcon(":/icons/menu/tab-new.png")), tr("&New tab"), m_window, SLOT(addTab()));
menu.addAction(IconProvider::newTabIcon(), tr("&New tab"), m_window, SLOT(addTab()));
menu.addSeparator();
if (index != -1) {
WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(m_clickedTab));
@ -152,10 +152,10 @@ void TabBar::contextMenuRequested(const QPoint &position)
}
if (m_window->weView(m_clickedTab)->isLoading()) {
menu.addAction(IconProvider::standardIcon(QStyle::SP_BrowserStop), tr("&Stop Tab"), this, SLOT(stopTab()));
menu.addAction(QIcon::fromTheme(QSL("process-stop")), tr("&Stop Tab"), this, SLOT(stopTab()));
}
else {
menu.addAction(IconProvider::standardIcon(QStyle::SP_BrowserReload), tr("&Reload Tab"), this, SLOT(reloadTab()));
menu.addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload Tab"), this, SLOT(reloadTab()));
}
menu.addAction(QIcon::fromTheme("tab-duplicate"), tr("&Duplicate Tab"), this, SLOT(duplicateTab()));

View File

@ -849,8 +849,8 @@ void WebView::createContextMenu(QMenu* menu, const QWebHitTestResult &hitTest, c
pageAction(QWebPage::ToggleItalic)->setText(tr("Italic"));
pageAction(QWebPage::ToggleUnderline)->setText(tr("Underline"));
m_actionReload = new QAction(IconProvider::standardIcon(QStyle::SP_BrowserReload), tr("&Reload"), this);
m_actionStop = new QAction(IconProvider::standardIcon(QStyle::SP_BrowserStop), tr("S&top"), this);
m_actionReload = new QAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), this);
m_actionStop = new QAction(QIcon::fromTheme(QSL("process-stop")), tr("S&top"), this);
connect(m_actionReload, SIGNAL(triggered()), this, SLOT(reload()));
connect(m_actionStop, SIGNAL(triggered()), this, SLOT(stop()));
@ -983,12 +983,12 @@ void WebView::createPageContextMenu(QMenu* menu, const QPoint &pos)
Menu* frameMenu = new Menu(tr("This frame"));
frameMenu->setCloseOnMiddleClick(true);
frameMenu->addAction(tr("Show &only this frame"), this, SLOT(loadClickedFrame()));
Action* act = new Action(QIcon::fromTheme("tab-new", QIcon(":/icons/menu/tab-new.png")), tr("Show this frame in new &tab"));
Action* act = new Action(IconProvider::newTabIcon(), tr("Show this frame in new &tab"));
connect(act, SIGNAL(triggered()), this, SLOT(loadClickedFrameInNewTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(loadClickedFrameInBgTab()));
frameMenu->addAction(act);
frameMenu->addSeparator();
frameMenu->addAction(IconProvider::standardIcon(QStyle::SP_BrowserReload), tr("&Reload"), this, SLOT(reloadClickedFrame()));
frameMenu->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), this, SLOT(reloadClickedFrame()));
frameMenu->addAction(QIcon::fromTheme("document-print"), tr("Print frame"), this, SLOT(printClickedFrame()));
frameMenu->addSeparator();
frameMenu->addAction(QIcon::fromTheme("zoom-in"), tr("Zoom &in"), this, SLOT(clickedFrameZoomIn()));
@ -1001,7 +1001,7 @@ void WebView::createPageContextMenu(QMenu* menu, const QPoint &pos)
}
menu->addSeparator();
menu->addAction(IconProvider::iconFromTheme("bookmark-new"), tr("Book&mark page"), this, SLOT(bookmarkLink()));
menu->addAction(QIcon::fromTheme("bookmark-new"), tr("Book&mark page"), this, SLOT(bookmarkLink()));
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save page as..."), this, SLOT(savePageAs()));
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy page link"), this, SLOT(copyLinkToClipboard()))->setData(url());
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send page link..."), this, SLOT(sendPageByMail()));
@ -1027,7 +1027,7 @@ void WebView::createPageContextMenu(QMenu* menu, const QPoint &pos)
else {
menu->addSeparator();
menu->addAction(QIcon::fromTheme("list-add"), tr("&Add New Page"), this, SLOT(addSpeedDial()));
menu->addAction(QIcon::fromTheme("configure"), tr("&Configure Speed Dial"), this, SLOT(configureSpeedDial()));
menu->addAction(IconProvider::settingsIcon(), tr("&Configure Speed Dial"), this, SLOT(configureSpeedDial()));
}
}
@ -1039,18 +1039,18 @@ void WebView::createLinkContextMenu(QMenu* menu, const QWebHitTestResult &hitTes
}
menu->addSeparator();
Action* act = new Action(QIcon::fromTheme("tab-new", QIcon(":/icons/menu/tab-new.png")), tr("Open link in new &tab"));
Action* act = new Action(IconProvider::newTabIcon(), tr("Open link in new &tab"));
act->setData(hitTest.linkUrl());
connect(act, SIGNAL(triggered()), this, SLOT(userDefinedOpenUrlInNewTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInBgTab()));
menu->addAction(act);
menu->addAction(QIcon::fromTheme("window-new"), tr("Open link in new &window"), this, SLOT(openUrlInNewWindow()))->setData(hitTest.linkUrl());
menu->addAction(QIcon(":icons/locationbar/privatebrowsing.png"), tr("Open link in &private window"), mApp, SLOT(startPrivateBrowsing()))->setData(hitTest.linkUrl());
menu->addAction(IconProvider::newWindowIcon(), tr("Open link in new &window"), this, SLOT(openUrlInNewWindow()))->setData(hitTest.linkUrl());
menu->addAction(IconProvider::privateBrowsingIcon(), tr("Open link in &private window"), mApp, SLOT(startPrivateBrowsing()))->setData(hitTest.linkUrl());
menu->addSeparator();
QVariantList bData;
bData << hitTest.linkUrl() << hitTest.linkTitle();
menu->addAction(IconProvider::iconFromTheme("bookmark-new"), tr("B&ookmark link"), this, SLOT(bookmarkLink()))->setData(bData);
menu->addAction(QIcon::fromTheme("bookmark-new"), tr("B&ookmark link"), this, SLOT(bookmarkLink()))->setData(bData);
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save link as..."), this, SLOT(downloadUrlToDisk()))->setData(hitTest.linkUrl());
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send link..."), this, SLOT(sendLinkByMail()))->setData(hitTest.linkUrl());

View File

@ -167,6 +167,11 @@ int main(int argc, char* argv[])
signal(SIGPIPE, qupzilla_signal_handler);
#endif
if (!QIcon::hasThemeIcon(QSL("document-open"))) {
QIcon::setThemeSearchPaths(QStringList() << QL1S(":/oxygen-fallback"));
QIcon::setThemeName(QSL("oxygen-fallback"));
}
MainApplication app(argc, argv);
if (app.isClosing()) {