From 889e2743f56067acd9a2fc53c782b07fed934cd8 Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 8 Dec 2012 14:10:30 +0100 Subject: [PATCH] New icons for 'new-tab' and 'tab' Also added icon to 'Switch to tab' text in locationbar completer popup. --- src/lib/app/qupzilla.cpp | 2 +- src/lib/data/icons.qrc | 3 ++- src/lib/data/icons/menu/new-tab.png | Bin 0 -> 460 bytes src/lib/data/icons/menu/popup.png | Bin 580 -> 0 bytes src/lib/data/icons/menu/tab.png | Bin 0 -> 328 bytes .../completer/locationcompleterdelegate.cpp | 10 ++++++++-- src/lib/webview/tabbar.cpp | 2 +- src/lib/webview/webview.cpp | 4 ++-- 8 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 src/lib/data/icons/menu/new-tab.png delete mode 100644 src/lib/data/icons/menu/popup.png create mode 100644 src/lib/data/icons/menu/tab.png diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 5ce56cbb2..b4cc05f75 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -317,7 +317,7 @@ void QupZilla::setupMenu() *************/ m_menuFile = new QMenu(tr("&File")); m_menuFile->addAction(QIcon::fromTheme("window-new"), tr("&New Window"), this, SLOT(newWindow()))->setShortcut(QKeySequence("Ctrl+N")); - m_menuFile->addAction(QIcon(":/icons/menu/popup.png"), tr("New Tab"), this, SLOT(addTab()))->setShortcut(QKeySequence("Ctrl+T")); + m_menuFile->addAction(QIcon(":/icons/menu/new-tab.png"), tr("New Tab"), this, SLOT(addTab()))->setShortcut(QKeySequence("Ctrl+T")); m_menuFile->addAction(QIcon::fromTheme("document-open-remote"), tr("Open Location"), this, SLOT(openLocation()))->setShortcut(QKeySequence("Ctrl+L")); m_menuFile->addAction(QIcon::fromTheme("document-open"), tr("Open &File"), this, SLOT(openFile()))->setShortcut(QKeySequence("Ctrl+O")); m_menuFile->addAction(tr("Close Tab"), m_tabWidget, SLOT(closeTab()))->setShortcut(QKeySequence("Ctrl+W")); diff --git a/src/lib/data/icons.qrc b/src/lib/data/icons.qrc index e27dec369..38f376f65 100644 --- a/src/lib/data/icons.qrc +++ b/src/lib/data/icons.qrc @@ -19,7 +19,7 @@ icons/locationbar/unknownpage.png icons/menu/history.png icons/menu/history_entry.png - icons/menu/popup.png + icons/menu/new-tab.png icons/menu/qt.png icons/menu/rss.png icons/other/about.png @@ -69,5 +69,6 @@ icons/sites/yahoo.png icons/sites/youtube.png icons/preferences/preferences-desktop-keyboard-shortcuts.png + icons/menu/tab.png diff --git a/src/lib/data/icons/menu/new-tab.png b/src/lib/data/icons/menu/new-tab.png new file mode 100644 index 0000000000000000000000000000000000000000..d6c5f64e466dd7238f34704ae8d2a22af9960b23 GIT binary patch literal 460 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl~-@bYE>gBzAx2|5jc6O{a<*EO_Nc{S~=bxvj%uXC129)-GApwu|G2 z<78Pwk-uted!{qiT$W^#Gx?*Sdf~Z)&_bP0l+XkK5WxFL literal 0 HcmV?d00001 diff --git a/src/lib/data/icons/menu/popup.png b/src/lib/data/icons/menu/popup.png deleted file mode 100644 index 8e103fc7672b93c36ac609a4d688038e07632c41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 580 zcmV-K0=xZ*P)`YsE`pmwadL6?A1I}h^e2de zlXP?wt)fmYg_`2WlDgQY@uQ|q-{&|qmPQCTdoSm3;9T7IIiiPte5^XT>_N;<$Jm;- zxHSnDDf>_S(B=dYFkqg2>rGW!{g8DPCq3h8J7xP38lcV>#^^BIH@+;;{; zgPfhCSu2xN>tMSeGia`i(?4{kErp!hk92a#IgC6hW$@#GL%ztK7YXF?p|A<=Yd63N zFOQU`ZDqDNg~=1sb(*yb%~}P?BV3frElF;%>jsh#LJCBcXxT~nk~ubN6ZDPTBohLS zaPLb0cj{L#4f7HhIPKM-FAf1Li^8r4=_7-kAIW+&-5DuyOal( SL)F~?0000{NKNS z-@biw@7}E&H?G{gdG*@0OINR6?C$OO@ZtTdS1%_{?tA<8_3PI!SFBq4>C=Z(r%&F! zdlP8P-Jc?jKuWA6$S?RmHo(Am>A(}9iY!kT$B>F!E$1Ei8Web3E-nlT>FR3wzJFE2 z62oIhwkyosuVoScK~TZTML}rg>mzwr`=r)setFont(opt.font); TabPosition pos = index.data(LocationCompleterModel::TabPositionRole).value(); if(m_drawSwitchToTab && pos.windowIndex != -1) { - // TODO: select and paint a nice icon to give better feedback to the user. - drawTextLine(linkRect, tr("Switch to tab"), painter, style, opt, colorLinkRole); + const QIcon tabIcon = QIcon(":icons/menu/tab.png"); + QRect iconRect(linkRect); + iconRect.setWidth(m_padding + 16 + m_padding); + tabIcon.paint(painter, iconRect); + + QRect textRect(linkRect); + textRect.setX(textRect.x() + m_padding + 16 + m_padding); + drawTextLine(textRect, tr("Switch to tab"), painter, style, opt, colorLinkRole); } else { drawHighlightedTextLine(linkRect, link, searchText, painter, style, opt, colorLinkRole); diff --git a/src/lib/webview/tabbar.cpp b/src/lib/webview/tabbar.cpp index 0f383e59a..264f04800 100644 --- a/src/lib/webview/tabbar.cpp +++ b/src/lib/webview/tabbar.cpp @@ -120,7 +120,7 @@ void TabBar::contextMenuRequested(const QPoint &position) m_clickedTab = index; QMenu menu; - menu.addAction(QIcon(":/icons/menu/popup.png"), tr("&New tab"), p_QupZilla, SLOT(addTab())); + menu.addAction(QIcon(":/icons/menu/new-tab.png"), tr("&New tab"), p_QupZilla, SLOT(addTab())); menu.addSeparator(); if (index != -1) { WebTab* webTab = qobject_cast(m_tabWidget->widget(m_clickedTab)); diff --git a/src/lib/webview/webview.cpp b/src/lib/webview/webview.cpp index 24e1a2904..a0cfa10c4 100644 --- a/src/lib/webview/webview.cpp +++ b/src/lib/webview/webview.cpp @@ -803,7 +803,7 @@ void WebView::createPageContextMenu(QMenu* menu, const QPoint &pos) m_clickedFrame = frameAtPos; QMenu* frameMenu = new QMenu(tr("This frame")); frameMenu->addAction(tr("Show &only this frame"), this, SLOT(loadClickedFrame())); - frameMenu->addAction(QIcon(":/icons/menu/popup.png"), tr("Show this frame in new &tab"), this, SLOT(loadClickedFrameInNewTab())); + frameMenu->addAction(QIcon(":/icons/menu/new-tab.png"), tr("Show this frame in new &tab"), this, SLOT(loadClickedFrameInNewTab())); frameMenu->addSeparator(); frameMenu->addAction(qIconProvider->standardIcon(QStyle::SP_BrowserReload), tr("&Reload"), this, SLOT(reloadClickedFrame())); frameMenu->addAction(QIcon::fromTheme("document-print"), tr("Print frame"), this, SLOT(printClickedFrame())); @@ -844,7 +844,7 @@ void WebView::createLinkContextMenu(QMenu* menu, const QWebHitTestResult &hitTes } menu->addSeparator(); - menu->addAction(QIcon(":/icons/menu/popup.png"), tr("Open link in new &tab"), this, SLOT(userDefinedOpenUrlInNewTab()))->setData(hitTest.linkUrl()); + menu->addAction(QIcon(":/icons/menu/new-tab.png"), tr("Open link in new &tab"), this, SLOT(userDefinedOpenUrlInNewTab()))->setData(hitTest.linkUrl()); menu->addAction(QIcon::fromTheme("window-new"), tr("Open link in new &window"), this, SLOT(openUrlInNewWindow()))->setData(hitTest.linkUrl()); menu->addSeparator(); menu->addAction(qIconProvider->fromTheme("user-bookmarks"), tr("B&ookmark link"), this, SLOT(bookmarkLink()))->setData(hitTest.linkUrl());