From 495e1a2d24040a5472bd484262f8f5810c64b1d1 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 24 Nov 2015 15:46:51 +0100 Subject: [PATCH] Use the new Utils::Icon class and update some icons Change-Id: Iff68d059e32507a688abe6f859f029d306b2b6a5 Reviewed-by: Christian Kandeler Reviewed-by: Eike Ziller --- plugins/autotest/autotest.pro | 3 +- plugins/autotest/autotest.qbs | 1 + plugins/autotest/autotest.qrc | 11 +++-- plugins/autotest/autotesticons.h | 43 ++++++++++++++++++ plugins/autotest/images/collapse.png | Bin 205 -> 176 bytes plugins/autotest/images/collapse@2x.png | Bin 0 -> 190 bytes plugins/autotest/images/expand.png | Bin 216 -> 174 bytes plugins/autotest/images/expand@2x.png | Bin 0 -> 190 bytes plugins/autotest/images/leafsort.png | Bin 415 -> 178 bytes plugins/autotest/images/leafsort@2x.png | Bin 0 -> 362 bytes plugins/autotest/images/run.png | Bin 509 -> 0 bytes plugins/autotest/images/runselected.png | Bin 709 -> 0 bytes plugins/autotest/images/runselected_boxes.png | Bin 0 -> 99 bytes .../autotest/images/runselected_boxes@2x.png | Bin 0 -> 104 bytes .../autotest/images/runselected_tickmarks.png | Bin 0 -> 151 bytes .../images/runselected_tickmarks@2x.png | Bin 0 -> 162 bytes plugins/autotest/images/sort.png | Bin 233 -> 139 bytes plugins/autotest/images/sort@2x.png | Bin 0 -> 205 bytes plugins/autotest/images/stop.png | Bin 314 -> 0 bytes plugins/autotest/testnavigationwidget.cpp | 14 +++--- plugins/autotest/testresultspane.cpp | 16 +++++-- 21 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 plugins/autotest/autotesticons.h create mode 100644 plugins/autotest/images/collapse@2x.png create mode 100644 plugins/autotest/images/expand@2x.png create mode 100644 plugins/autotest/images/leafsort@2x.png delete mode 100644 plugins/autotest/images/run.png delete mode 100644 plugins/autotest/images/runselected.png create mode 100644 plugins/autotest/images/runselected_boxes.png create mode 100644 plugins/autotest/images/runselected_boxes@2x.png create mode 100644 plugins/autotest/images/runselected_tickmarks.png create mode 100644 plugins/autotest/images/runselected_tickmarks@2x.png create mode 100644 plugins/autotest/images/sort@2x.png delete mode 100644 plugins/autotest/images/stop.png diff --git a/plugins/autotest/autotest.pro b/plugins/autotest/autotest.pro index 4022cb43990..1a411d34908 100644 --- a/plugins/autotest/autotest.pro +++ b/plugins/autotest/autotest.pro @@ -49,7 +49,8 @@ HEADERS += \ testsettings.h \ testsettingspage.h \ testnavigationwidget.h \ - testxmloutputreader.h + testxmloutputreader.h \ + autotesticons.h RESOURCES += \ autotest.qrc diff --git a/plugins/autotest/autotest.qbs b/plugins/autotest/autotest.qbs index f746d7fae13..704394044c7 100644 --- a/plugins/autotest/autotest.qbs +++ b/plugins/autotest/autotest.qbs @@ -30,6 +30,7 @@ QtcCommercialPlugin { files: [ "autotest.qrc", + "autotesticons.h", "autotest_global.h", "autotestconstants.h", "autotestplugin.cpp", diff --git a/plugins/autotest/autotest.qrc b/plugins/autotest/autotest.qrc index 8c70e3ae3f5..698a86950e4 100644 --- a/plugins/autotest/autotest.qrc +++ b/plugins/autotest/autotest.qrc @@ -4,9 +4,13 @@ images/class.png images/func.png images/expand.png + images/expand@2x.png images/collapse.png + images/collapse@2x.png images/sort.png + images/sort@2x.png images/leafsort.png + images/leafsort@2x.png images/debug.png images/fail.png images/fatal.png @@ -18,9 +22,10 @@ images/blacklisted_fail.png images/blacklisted_pass.png images/benchmark.png - images/run.png - images/runselected.png - images/stop.png + images/runselected_boxes.png + images/runselected_boxes@2x.png + images/runselected_tickmarks.png + images/runselected_tickmarks@2x.png images/data.png diff --git a/plugins/autotest/autotesticons.h b/plugins/autotest/autotesticons.h new file mode 100644 index 00000000000..8454b95f405 --- /dev/null +++ b/plugins/autotest/autotesticons.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd +** All rights reserved. +** For any questions to The Qt Company, please use contact form at +** http://www.qt.io/contact-us +** +** This file is part of the Qt Creator Enterprise Auto Test Add-on. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. +** +** If you have questions regarding the use of this file, please use +** contact form at http://www.qt.io/contact-us +** +****************************************************************************/ + +#ifndef AUTOTESTICONS_H +#define AUTOTESTICONS_H + +#include + +namespace Autotest { +namespace Icons { + +const Utils::Icon EXPAND({ + {QLatin1String(":/images/expand.png"), Utils::Theme::IconsBaseColor}}); +const Utils::Icon COLLAPSE({ + {QLatin1String(":/images/collapse.png"), Utils::Theme::IconsBaseColor}}); +const Utils::Icon SORT_ALPHABETICALLY({ + {QLatin1String(":/images/sort.png"), Utils::Theme::IconsBaseColor}}); +const Utils::Icon SORT_NATURALLY({ + {QLatin1String(":/images/leafsort.png"), Utils::Theme::IconsBaseColor}}); +const Utils::Icon RUN_SELECTED_OVERLAY({ + {QLatin1String(":/images/runselected_boxes.png"), Utils::Theme::BackgroundColorDark}, + {QLatin1String(":/images/runselected_tickmarks.png"), Utils::Theme::IconsBaseColor}}); + +} // namespace Icons +} // namespace Autotest + +#endif // AUTOTESTICONS_H diff --git a/plugins/autotest/images/collapse.png b/plugins/autotest/images/collapse.png index d6da22a5b86804591b12af7205efb0c2d5b08ea6..c8dc840a61e7080a7587a081f6c16078406654e0 100644 GIT binary patch literal 176 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd7G?$phPQVgfdsSyd_r6q7#P^t*qof4oSmIr zTwGjTU0YgOT3cJ&+uQHozyILDgC9SB{QUXz|NsA?G5x*_3=EE*E{-7_(aAfwS$Td) znDa_X>~-kzwk>}@r9ndc{Jp)q1&{1t2q|DZv*W;l0!CMsbo?U=@% bGDe1UkCbS~#fFIt3=9mOu6{1-oD!Mk44ofy`glX=O&z`&N| z?e4a1@p0td-tRLqan6F$jH88rfulD!<|Ns9>7CgMYJ^z1tk^+;!(hk;RJBpw4 zwe1cG36YSLkdP?YrKw~z%fwvpskK|uAx?&<(1g(0E&Wvt3=9mOu6{1-oD!M>-n?C@N4-7Ls_T(cV1I& qq-7oTF_=B4BH_{=zxKB1eGClioXW26kC1!>a+s&9pUXO@geCx(GeWrl literal 0 HcmV?d00001 diff --git a/plugins/autotest/images/expand.png b/plugins/autotest/images/expand.png index a859960ea8d77ebe801a90eb7b572437b3ab54fa..a8b3f4a486e4305952443be5f4c651cee37d9a26 100644 GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd7G?$phPQVgfdsSyd_r6q7#P^t*qof4oSmIr zTwGjTU0YgOT3cJ&+uQHozyILDgC9SB{QUXz|NsA?G5x*_3=H<3E{-7_(aAfwS$Td) znDa_X>~-kzwk>}@r9ndceB6%Rf=6~Rv?&~8WozTsP%1E;p8f8gC#zwerICT#!>!y5 ZkrgTGTSR}FGB7YOc)I$ztaD0e0syw#JIDY4 literal 216 zcmeAS@N?(olHy`uVBq!ia0y~yVBiE{4mJh`h6fYb1Q-|?7>k44ofy`glX=O&z`&N| z?e4z?Djv}DuUP*w&{ zuY3lBz4~|O?p(t^Ek%K=A#K^adtbQh?mE6m`oGjWzH8a#6Z7?YimdIQtZ3|IU|?YI MboFyt=akR{0H>-n?hrY#ju)`spwZZd`x8d>hfg4yMzL#;0+TSYadz9xN)1$Y?@ zzG=(;>uWi4lvH-VT|cR^Q^4ZHiN$k2%RKusfB9;c>k7Y@US07(QL5~GqBsMCr|tdP TBhlAEj$!b0^>bP0l+XkKMLtcG delta 400 zcmdnQIG=ffWIY=L1B3kM|A`C?jA@=Ojv*GkODFI3W_A=fdOzj8lHn001+F@gwAB-$ zbS`)HMl2CzS(~%wEmKp{+TN)w(f^q@2669}@#s2HC>nLW|OJ#W5mlXz$6#YWw- z`?K%!8TU*$Qmdd)0yb`eA+y9L7#y3zu&2J`gjK`T9WVY&dHTEV zSmB)HN$d=p7)~*4=~&~pX2HdbjHMxSpO~GTY``PF_1biXdmeheYYs$JD=Ya&y{=^l z{NpUhc|7bv-7xJVz2LAef@PL!)%6kkN-`y6_^-2NpuolgLZbV;!K}; z%mzDS@;D5NxRgHKx~|ipoc-2$f2H-`?fUN%#B1)K*I3HMVA5dBuzhXV>KGldx8Ijc zWJo?E*U;5r;%S$?mfz6k&_zcfmB6)Ov6DIv{@w2WZ}++R&wp*Z+B;RTn}LCWlfl!~ K&t;ucLK6UElCjYM diff --git a/plugins/autotest/images/leafsort@2x.png b/plugins/autotest/images/leafsort@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..b74a94fc1678428d85426954b8f2255c98a38841 GIT binary patch literal 362 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4h9AWhA=@@4F(2ALr)jS5R21$FYnhrQYdr$ z@#|4q%k=upf2TeyiE6mhiu&sPbDnsJ9I#4HS1i*q`i-J z_5FVO?zfT5<=TDf%wJ;%j{kuZYwz$a5Lvf4b-7C94YdhU$D{l_gl7CxwC(!8XAkFTmb8~uddrpam@O85 ze5ft9!n8rtY~N#TU$zITiZ5d)<-J(VV);t-X5&Wnms0{%H%NPUxtEA6F%9GKXX!l2 zw@G#7d}ii|RKLJKnJ*`7+rwxRHE&11?aM{29UB8Dml)Sba_*e5vG>7@PZft%lhyAp zEBsm2{;WLy%u?Ie3xA$kdG+M$vyKuwidX$*clcd(@TXoBGxzVC^>%yX8~h`(YV+BO R3+8|V(bLt>Wt~$(699iNpGp7# literal 0 HcmV?d00001 diff --git a/plugins/autotest/images/run.png b/plugins/autotest/images/run.png deleted file mode 100644 index e302fe33e0084b483b5e9b7c731f5d1c85e96d71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 509 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7k9fK`hFJ72oqXOqBv9t) zd091yc?*meCU_-nJyBq)m!!faBGM%0ERcJPW$WrNN5|PqLL2|GUvrv%P3I3|*Me@v zo{ZPalrrw@SyB1^Y{mVU`+L93id*>_FIyqIqh@E#`=1|d3-&ju{B!4I5OCU(zCKpt z3xCOcYdwXX;WPKwTedIJh}&yw5k2Q_gY4b|rRL^|**Ry}^ z3##%pvg1|IkVe)?R8#LF26qn=uN&Sqek#IvR=R`#9i zgtO0f@iZ#@YrT*+VN1P#!vT$BZikGyF6OO|d>uVIf@j&rn7Il&?@BQ;F1EN*w11<> z)eraL9Rls1@_${s^)I`C)ZIVJvke12*gpz>t7;#@_4}kQgM$gf>Z?N6R^@LDsdT&~ zlaj~S@MD$Av!=?Lu>PN_cWlnwD43|g`Q%pE#Nu_=-@Dr`+IP;0gTe~DWM4f{&?&L diff --git a/plugins/autotest/images/runselected.png b/plugins/autotest/images/runselected.png deleted file mode 100644 index 328974062effb73ad838265bb8baaf0839525033..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 709 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!todOTemLo9liPLB7O94K*Y z{$m;4%}c+ee?FfQ5y;ZzGGUS+XRn)Y(<0qho4WI6U2whIBfzrQ(X(l~Xs1h^N0Q)G zjCgF9EDXnH z?0lQ@*|^TKI9u_P`mWGK1%VmcZsts7IPiIoqd?1w%P;rzn6g?|x7&Wa_dGml?({wz zrT|};8+)EVe||JZ&)wVGJ7xRrmHYSGd%3W(GHjW%?$ScN>c6eRTkplXXUm>VpC#vR zuVbg8B+Jm&*0!znaN?09!!2939C%v9$q=xS?ZVGJKAfh_qNf%e%(cE#wf^e<|IZG- zob_#1H^YUych|N!DMqXfE0AGde9=R-VTn?p(@BMeX%hleK7>|=mEOITxa+b>(w=SK zOSRNDUA!3R&6?op;m3T?41o*xi3()gb#_{&%k3{^f=%PdzY|^bB?Ln(RHliGk$^D@(Y$f#x@% ziD8TkE-p=KuQ^?#q!okj@i1sHHtl2b{O#y+D~(@a1*`CMQBKKN&DVDgS1*X50p5zopr E04cQ`_y7O^ literal 0 HcmV?d00001 diff --git a/plugins/autotest/images/runselected_tickmarks.png b/plugins/autotest/images/runselected_tickmarks.png new file mode 100644 index 0000000000000000000000000000000000000000..6296f8748da1fad940d19c9c4de130ed3e9d725d GIT binary patch literal 151 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd7G?$phPQVgfdte8d_r7BMMbr>we|J&6A}{g z^Ygp9x)v;0uz&ylt5>gn`0(ND*RS8cef$6azxv0JBMb}-+MX_sAso@k7R;E?}E3Va77`PP?QwR^~aa=Lj3=PSj92`08YTfZZBFrFshhMH>F^7Re zh62-7-DhyXrLokg8`4X z`~FGI;RpZkKOp|Z@UzN^8%s)=x%W<4<|&ns>bWX1u!o)hJ%b;ELS`oG`O4joH-Gc` z!r=M(c@E2)jUKDkzbQ|@64|2or#b!=(~f0s%R-`j S_!$@&7(8A5T-G@yGywood{2h} diff --git a/plugins/autotest/images/sort@2x.png b/plugins/autotest/images/sort@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..1a2e5d9520463a203c9dd440478118f7ee7e6f51 GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4h9AWhA=@@4F(2=DV{ElAr`&KKl~XCczT*D zkHy5OeJ;?Rae#qM_=1SRfyf}9V!QfzhZS0b8CzH%U-n>R30Ty?*Qc_8L3F}mhF7QG zwun?b+WN?lUryLTp+!+-y>hv6f$f3i50I|WYi%5qeyh$~rd+9!AH(~)@z0twcNtScH8Ffkac4$fJrcc=yAPES`qmvv4F FO#q>eL+$_o literal 0 HcmV?d00001 diff --git a/plugins/autotest/images/stop.png b/plugins/autotest/images/stop.png deleted file mode 100644 index 1063d089985794a49542c61f78e8d8514f7f9607..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 314 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7BuiW)N`mv#O3D+9QW+dm z@{>{(JaZG%Q-e|yQz{EjrrIztFx>HUaSW-rwPdm*SF?eDtNPK+QMXFZUrb#px48N% zo19~aK#Yc{j@V?i%S%j@%vN?WpKSSXfBqQ<4y8lW3ce)zpKx7vnCseZCArSJMw0`Z zUrSB3IH~2gkN;AGMRC&H%2?*}#SdH=n=aiKvs)y% #include #include +#include #include #include #include @@ -149,7 +151,7 @@ QList TestNavigationWidget::createToolButtons() QList list; m_filterButton = new QToolButton(m_view); - m_filterButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER))); + m_filterButton->setIcon(Core::Icons::FILTER.icon()); m_filterButton->setToolTip(tr("Filter Test Tree")); m_filterButton->setProperty("noArrow", true); m_filterButton->setAutoRaise(true); @@ -161,15 +163,15 @@ QList TestNavigationWidget::createToolButtons() m_sortAlphabetically = true; m_sort = new QToolButton(this); - m_sort->setIcon((QIcon(QLatin1String(":/images/leafsort.png")))); + m_sort->setIcon(Icons::SORT_NATURALLY.icon()); m_sort->setToolTip(tr("Sort Naturally")); QToolButton *expand = new QToolButton(this); - expand->setIcon(QIcon(QLatin1String(":/images/expand.png"))); + expand->setIcon(Icons::EXPAND.icon()); expand->setToolTip(tr("Expand All")); QToolButton *collapse = new QToolButton(this); - collapse->setIcon(QIcon(QLatin1String(":/images/collapse.png"))); + collapse->setIcon(Icons::COLLAPSE.icon()); collapse->setToolTip(tr("Collapse All")); connect(expand, &QToolButton::clicked, m_view, &TestTreeView::expandAll); @@ -193,11 +195,11 @@ void TestNavigationWidget::onItemActivated(const QModelIndex &index) void TestNavigationWidget::onSortClicked() { if (m_sortAlphabetically) { - m_sort->setIcon((QIcon(QLatin1String(":/images/sort.png")))); + m_sort->setIcon(Icons::SORT_ALPHABETICALLY.icon()); m_sort->setToolTip(tr("Sort Alphabetically")); m_sortFilterModel->setSortMode(TestTreeSortFilterModel::Naturally); } else { - m_sort->setIcon((QIcon(QLatin1String(":/images/leafsort.png")))); + m_sort->setIcon(Icons::SORT_NATURALLY.icon()); m_sort->setToolTip(tr("Sort Naturally")); m_sortFilterModel->setSortMode(TestTreeSortFilterModel::Alphabetically); } diff --git a/plugins/autotest/testresultspane.cpp b/plugins/autotest/testresultspane.cpp index abc91dfb66e..253dc6685ec 100644 --- a/plugins/autotest/testresultspane.cpp +++ b/plugins/autotest/testresultspane.cpp @@ -18,6 +18,7 @@ ****************************************************************************/ #include "autotestplugin.h" +#include "autotesticons.h" #include "testresultspane.h" #include "testresultmodel.h" #include "testresultdelegate.h" @@ -26,10 +27,13 @@ #include "testtreemodel.h" #include +#include #include #include #include +#include + #include #include @@ -127,7 +131,7 @@ TestResultsPane::TestResultsPane(QObject *parent) : void TestResultsPane::createToolButtons() { m_expandCollapse = new QToolButton(m_treeView); - m_expandCollapse->setIcon(QIcon(QLatin1String(":/find/images/expand.png"))); + m_expandCollapse->setIcon(Core::Icons::EXPAND.icon()); m_expandCollapse->setToolTip(tr("Expand All")); m_expandCollapse->setCheckable(true); m_expandCollapse->setChecked(false); @@ -139,25 +143,27 @@ void TestResultsPane::createToolButtons() }); m_runAll = new QToolButton(m_treeView); - m_runAll->setIcon(QIcon(QLatin1String(":/images/run.png"))); + m_runAll->setIcon(ProjectExplorer::Icons::RUN_SMALL.icon()); m_runAll->setToolTip(tr("Run All Tests")); m_runAll->setEnabled(false); connect(m_runAll, &QToolButton::clicked, this, &TestResultsPane::onRunAllTriggered); m_runSelected = new QToolButton(m_treeView); - m_runSelected->setIcon(QIcon(QLatin1String(":/images/runselected.png"))); + Utils::Icon runSelectedIcon = ProjectExplorer::Icons::RUN_SMALL; + runSelectedIcon.append(Icons::RUN_SELECTED_OVERLAY); + m_runSelected->setIcon(runSelectedIcon.icon()); m_runSelected->setToolTip(tr("Run Selected Tests")); m_runSelected->setEnabled(false); connect(m_runSelected, &QToolButton::clicked, this, &TestResultsPane::onRunSelectedTriggered); m_stopTestRun = new QToolButton(m_treeView); - m_stopTestRun->setIcon(QIcon(QLatin1String(":/images/stop.png"))); + m_stopTestRun->setIcon(ProjectExplorer::Icons::STOP_SMALL.icon()); m_stopTestRun->setToolTip(tr("Stop Test Run")); m_stopTestRun->setEnabled(false); connect(m_stopTestRun, &QToolButton::clicked, TestRunner::instance(), &TestRunner::requestStopTestRun); m_filterButton = new QToolButton(m_treeView); - m_filterButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER))); + m_filterButton->setIcon(Core::Icons::FILTER.icon()); m_filterButton->setToolTip(tr("Filter Test Results")); m_filterButton->setProperty("noArrow", true); m_filterButton->setAutoRaise(true);