From 64d8ee1d09ad9554e5adf00d958c022c85941fac Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@nokia.com>
Date: Wed, 24 Feb 2010 17:55:14 +0100
Subject: [PATCH] Add disabled button image for target add/remove buttons

Reviewed-by: con
---
 .../images/targetaddbutton_disabled.png           | Bin 0 -> 453 bytes
 .../images/targetremovebutton_disabled.png        | Bin 0 -> 433 bytes
 src/plugins/projectexplorer/projectexplorer.qrc   |   2 ++
 src/plugins/projectexplorer/targetselector.cpp    |  12 ++++++++++--
 src/plugins/projectexplorer/targetselector.h      |   2 ++
 5 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 src/plugins/projectexplorer/images/targetaddbutton_disabled.png
 create mode 100644 src/plugins/projectexplorer/images/targetremovebutton_disabled.png

diff --git a/src/plugins/projectexplorer/images/targetaddbutton_disabled.png b/src/plugins/projectexplorer/images/targetaddbutton_disabled.png
new file mode 100644
index 0000000000000000000000000000000000000000..c120cc927ce5bf0b0a1d683234a5dbb333b1ece7
GIT binary patch
literal 453
zcmV;$0XqJPP)<h;3K|Lk000e1NJLTq000{R001ip1^@s6iLUeb00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igJ{
z5G4s66>`b|00BiwL_t(o!|hi~u7n^EEY!$K7m6Oh8+iXicmv&Q;s@QBpgk*-$qOjs
z8_mm$By7Y~byYVFFd`z{Fxs{SQ%cdYESHlp#^3?K9pZ=x9ueUtC*k16ahr_*?zQnz
z_9**9%7_T-x;{2O%ANxGPs(g^HjX3ey4J3xX^J2SjxRlZ-_tM*yFZm>X%%^vWyg1r
zEpNJMOSA>GhvjTG>Sk3{ALpg2DkGj_ilXZ}BVeBA$n)H|-gTW`naM^e<>{)EQfe_T
z+h;mV>wTuP?fqL(6vt#&^+p}0wT<tQZ;F1Z`I?Pi$(czR=N$7qpCaO%YcW|}*JSE>
zP1BqrOOiz2uJ+oC5aMGZA%wYI9reaIj;)E}INrsws>UdaAf<#-N`Fpy9>Op@#Idf%
vqw~rJ<9Sp6dbq9&&vjk+zJEE{G);H`O8DFAB3kH-00000NkvXXu0mjf)G5Ns

literal 0
HcmV?d00001

diff --git a/src/plugins/projectexplorer/images/targetremovebutton_disabled.png b/src/plugins/projectexplorer/images/targetremovebutton_disabled.png
new file mode 100644
index 0000000000000000000000000000000000000000..499647ccb99a068402d8013d6022ddbdb2a9c011
GIT binary patch
literal 433
zcmV;i0Z#sjP)<h;3K|Lk000e1NJLTq000{R001ip1^@s6iLUeb00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igJ{
z5F;&jOfj7R00A*cL_t(o!|hi=j)Wi(Y{ke)4nll@Kk)yL@CS1DAc|g0(B6}K*nl$b
zNG20V`h=<Ks%{!g5D_838ioN9V+?NF_BdIRB#;3Bgb;^_kRc)jauQMqxPsXT0AX#6
z%A&FlQih1I?|ZZ{DvJ&BP0D;~HqSHkeQ({XstSstxPJ7E<A~EVoqp7Homb{{U0=UJ
zj=I^xm*`093@bfsw1t%N<+?~Iop`A$3#HWUMo>!GmAP!xTHhwqT3az6J7+db?{n5P
z&FOyIw%24&%|;uhw~c=@f7Hge)Xb%fQVQ$3-XfxuS}~oi&ltO{iZSM%Ag&NXyi6p7
zaF462*~mHfCgPl*VtI9AS(c!+24jr<p31Uc>)vvCUfowd81bL_--{3e86gDnJb#>Q
bSr+&Ku?y?%?5=*400000NkvXXu0mjfbTqd%

literal 0
HcmV?d00001

diff --git a/src/plugins/projectexplorer/projectexplorer.qrc b/src/plugins/projectexplorer/projectexplorer.qrc
index 4430687501e..ed37bd29433 100644
--- a/src/plugins/projectexplorer/projectexplorer.qrc
+++ b/src/plugins/projectexplorer/projectexplorer.qrc
@@ -40,5 +40,7 @@
         <file>images/build.png</file>
         <file>images/targetpanel_bottom.png</file>
         <file>images/targetpanel_gradient.png</file>
+        <file>images/targetaddbutton_disabled.png</file>
+        <file>images/targetremovebutton_disabled.png</file>
     </qresource>
 </RCC>
diff --git a/src/plugins/projectexplorer/targetselector.cpp b/src/plugins/projectexplorer/targetselector.cpp
index 63d82fe3447..571d1c77418 100644
--- a/src/plugins/projectexplorer/targetselector.cpp
+++ b/src/plugins/projectexplorer/targetselector.cpp
@@ -18,7 +18,9 @@ TargetSelector::TargetSelector(QWidget *parent) :
     m_runselected(QLatin1String(":/projectexplorer/images/targetrunselected.png")),
     m_buildselected(QLatin1String(":/projectexplorer/images/targetbuildselected.png")),
     m_targetaddbutton(QLatin1String(":/projectexplorer/images/targetaddbutton.png")),
+    m_targetaddbuttondisabled(QLatin1String(":/projectexplorer/images/targetaddbutton_disabled.png")),
     m_targetremovebutton(QLatin1String(":/projectexplorer/images/targetremovebutton.png")),
+    m_targetremovebuttondisabled(QLatin1String(":/projectexplorer/images/targetremovebutton_disabled.png")),
     m_currentTargetIndex(-1),
     m_addButtonEnabled(true),
     m_removeButtonEnabled(false)
@@ -190,7 +192,10 @@ void TargetSelector::paintEvent(QPaintEvent *event)
     int x = 1;
     int index = 0;
     QFontMetrics fm(font());
-    p.drawPixmap(x, 1, m_targetremovebutton);
+    if (m_removeButtonEnabled)
+        p.drawPixmap(x, 1, m_targetremovebutton);
+    else
+        p.drawPixmap(x, 1, m_targetremovebuttondisabled);
     x += m_targetremovebutton.width();
     p.setPen(QColor(0, 0, 0));
     p.drawLine(x, 1, x, TARGET_HEIGHT);
@@ -221,5 +226,8 @@ void TargetSelector::paintEvent(QPaintEvent *event)
         ++index;
     }
     // draw add button
-    p.drawPixmap(x, 1, m_targetaddbutton);
+    if (m_addButtonEnabled)
+        p.drawPixmap(x, 1, m_targetaddbutton);
+    else
+        p.drawPixmap(x, 1, m_targetaddbuttondisabled);
 }
diff --git a/src/plugins/projectexplorer/targetselector.h b/src/plugins/projectexplorer/targetselector.h
index 1c06f6dc171..1fa02329514 100644
--- a/src/plugins/projectexplorer/targetselector.h
+++ b/src/plugins/projectexplorer/targetselector.h
@@ -53,7 +53,9 @@ private:
     const QPixmap m_runselected;
     const QPixmap m_buildselected;
     const QPixmap m_targetaddbutton;
+    const QPixmap m_targetaddbuttondisabled;
     const QPixmap m_targetremovebutton;
+    const QPixmap m_targetremovebuttondisabled;
 
     QList<Target> m_targets;
 
-- 
GitLab