OSDN Git Service

Logview: Ajust label colors when selected.
authorJohan 't Hart <johanthart@gmail.com>
Tue, 16 Jun 2009 21:52:23 +0000 (23:52 +0200)
committerJohan 't Hart <johanthart@gmail.com>
Tue, 16 Jun 2009 21:52:23 +0000 (23:52 +0200)
(Not on Vista with themes enabled)

src/TortoiseProc/Colors.h
src/TortoiseProc/GitLogListBase.cpp

index b90c207..55f0607 100644 (file)
@@ -64,10 +64,10 @@ public:
        void SetColor(Colors col, COLORREF cr);\r
 \r
        //mixFactor: 0 -> baseColor, 255 -> newColor\r
-       COLORREF MixColors(COLORREF baseColor, COLORREF newColor, unsigned char mixFactor);\r
+       static COLORREF MixColors(COLORREF baseColor, COLORREF newColor, unsigned char mixFactor);\r
 \r
-       COLORREF Lighten(COLORREF baseColor, unsigned char amount = 100);\r
-       COLORREF Darken(COLORREF baseColor, unsigned char amount = 100);\r
+       static COLORREF Lighten(COLORREF baseColor, unsigned char amount = 100);\r
+       static COLORREF Darken(COLORREF baseColor, unsigned char amount = 100);\r
 \r
        struct COLOR_DATA\r
        {\r
index eca5524..33d45b9 100644 (file)
@@ -429,6 +429,7 @@ void CGitLogListBase::DrawTagBranch(HDC hdc,CRect &rect,INT_PTR index)
                shortname = _T("");\r
                COLORREF colRef = 0;\r
 \r
+               //Determine label color\r
                if(GetShortName(str,shortname,_T("refs/heads/")))\r
                {\r
                        if( shortname == m_CurrentBranch )\r
@@ -449,6 +450,12 @@ void CGitLogListBase::DrawTagBranch(HDC hdc,CRect &rect,INT_PTR index)
                        colRef = m_Colors.GetColor(CColors::Stash);\r
                        shortname=_T("stash");\r
                }\r
+\r
+               //When row selected, ajust label color\r
+               if (!(m_Theme.IsAppThemed() && m_bVista))\r
+                       if (rItem.state & LVIS_SELECTED)\r
+                               colRef = CColors::MixColors(colRef, ::GetSysColor(COLOR_HIGHLIGHT), 150);\r
+\r
                brush = ::CreateSolidBrush(colRef);\r
                \r
 \r