{\r
SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES);\r
// load the icons for the action columns\r
- m_Theme.SetWindowTheme(GetSafeHwnd(), L"Explorer", NULL);\r
+// m_Theme.Open(m_hWnd, L"ListView");\r
+ m_Theme.Open(m_hWnd, L"Explorer::ListView;ListView");\r
+ m_Theme.SetWindowTheme(m_hWnd, L"Explorer", NULL);\r
CHintListCtrl::PreSubclassWindow();\r
}\r
\r
}\r
return FALSE;\r
}\r
+\r
void CGitLogListBase::FillBackGround(HDC hdc, int Index,CRect &rect)\r
{ \r
// HBRUSH brush;\r
GetItem(&rItem);\r
\r
GitRev* pLogEntry = (GitRev*)m_arShownList.GetAt(Index);\r
- HBRUSH brush;\r
+ HBRUSH brush = NULL;\r
\r
\r
if (m_Theme.IsAppThemed() && m_bVista)\r
{\r
- m_Theme.Open(m_hWnd, L"Explorer");\r
int state = LISS_NORMAL;\r
if (rItem.state & LVIS_SELECTED)\r
{\r
brush = ::CreateSolidBrush(RGB(156,156,156));\r
else if(pLogEntry->m_Action&CTGitPath::LOGACTIONS_REBASE_EDIT)\r
brush = ::CreateSolidBrush(RGB(200,200,128));\r
+ }\r
\r
- if (brush == NULL)\r
- return;\r
-\r
+ if (brush != NULL)\r
+ {\r
::FillRect(hdc, &rect, brush);\r
::DeleteObject(brush);\r
-\r
}\r
-\r
- if (m_Theme.IsBackgroundPartiallyTransparent(LVP_LISTDETAIL, state))\r
- m_Theme.DrawParentBackground(m_hWnd, hdc, &rect);\r
else\r
- m_Theme.DrawBackground(hdc, LVP_LISTDETAIL, state, &rect, NULL);\r
+ {\r
+ if (m_Theme.IsBackgroundPartiallyTransparent(LVP_LISTITEM, state))\r
+ m_Theme.DrawParentBackground(m_hWnd, hdc, &rect);\r
+\r
+ CRect rectDraw = rect;\r
+ if(rItem.state & LVIS_SELECTED)\r
+ rectDraw.InflateRect(1,0);\r
+ else\r
+ rectDraw.InflateRect(1,1);\r
+\r
+ m_Theme.DrawBackground(hdc, LVP_LISTITEM, state, rectDraw, &rect);\r
+ }\r
}\r
else\r
{\r
str=m_HashMap[data->m_CommitHash][i];\r
\r
CString shortname;\r
- HBRUSH brush=0;\r
- shortname=_T("");\r
+ HBRUSH brush = 0;\r
+ 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
- brush = ::CreateSolidBrush(m_Colors.GetColor(CColors::CurrentBranch));\r
+ colRef = m_Colors.GetColor(CColors::CurrentBranch);\r
else\r
- brush = ::CreateSolidBrush(m_Colors.GetColor(CColors::LocalBranch));\r
+ colRef = m_Colors.GetColor(CColors::LocalBranch);\r
\r
}else if(GetShortName(str,shortname,_T("refs/remotes/")))\r
{\r
- brush = ::CreateSolidBrush(m_Colors.GetColor(CColors::RemoteBranch));\r
+ colRef = m_Colors.GetColor(CColors::RemoteBranch);\r
}\r
else if(GetShortName(str,shortname,_T("refs/tags/")))\r
{\r
- brush = ::CreateSolidBrush(m_Colors.GetColor(CColors::Tag));\r
+ colRef = m_Colors.GetColor(CColors::Tag);\r
}\r
else if(GetShortName(str,shortname,_T("refs/stash")))\r
{\r
- brush = ::CreateSolidBrush(m_Colors.GetColor(CColors::Stash));\r
+ 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
if(!shortname.IsEmpty())\r
GetTextExtentPoint32(hdc, shortname,shortname.GetLength(),&size);\r
\r
rt.SetRect(rt.left,rt.top,rt.left+size.cx,rt.bottom);\r
- rt.right+=4;\r
+ rt.right+=8;\r
+\r
+ //Fill interior of ref label\r
::FillRect(hdc, &rt, brush);\r
- if (rItem.state & LVIS_SELECTED)\r
+\r
+ //Draw edge of label\r
+ CDC W_Dc;\r
+ W_Dc.Attach(hdc);\r
+\r
+ CRect rectEdge = rt;\r
+\r
+ W_Dc.Draw3dRect(rectEdge, m_Colors.Lighten(colRef,100), m_Colors.Darken(colRef,100));\r
+ rectEdge.DeflateRect(1,1);\r
+ W_Dc.Draw3dRect(rectEdge, m_Colors.Lighten(colRef,50), m_Colors.Darken(colRef,50));\r
+\r
+ W_Dc.Detach();\r
+\r
+ //Draw text inside label\r
+ if (m_Theme.IsAppThemed() && m_bVista)\r
{\r
- COLORREF clrOld = ::SetTextColor(hdc,::GetSysColor(COLOR_HIGHLIGHTTEXT)); \r
- ::DrawText(hdc,shortname,shortname.GetLength(),&rt,DT_CENTER);\r
- ::SetTextColor(hdc,clrOld); \r
- }else\r
+ int txtState = LISS_NORMAL;\r
+ if (rItem.state & LVIS_SELECTED)\r
+ txtState = LISS_SELECTED;\r
+\r
+ m_Theme.DrawText(hdc, LVP_LISTITEM, txtState, shortname, -1, DT_CENTER | DT_SINGLELINE | DT_VCENTER, 0, &rt);\r
+ }\r
+ else\r
{\r
- ::DrawText(hdc,shortname,shortname.GetLength(),&rt,DT_CENTER);\r
+ if (rItem.state & LVIS_SELECTED)\r
+ {\r
+ COLORREF clrNew = ::GetSysColor(COLOR_HIGHLIGHTTEXT);\r
+ COLORREF clrOld = ::SetTextColor(hdc,clrNew); \r
+ ::DrawText(hdc,shortname,shortname.GetLength(),&rt,DT_CENTER | DT_SINGLELINE | DT_VCENTER);\r
+ ::SetTextColor(hdc,clrOld);\r
+ }else\r
+ {\r
+ ::DrawText(hdc,shortname,shortname.GetLength(),&rt,DT_CENTER | DT_SINGLELINE | DT_VCENTER);\r
+ }\r
}\r
\r
\r
- ::MoveToEx(hdc,rt.left,rt.top,NULL);\r
- ::LineTo(hdc,rt.right,rt.top);\r
- ::LineTo(hdc,rt.right,rt.bottom);\r
- ::LineTo(hdc,rt.left,rt.bottom);\r
- ::LineTo(hdc,rt.left,rt.top);\r
+ //::MoveToEx(hdc,rt.left,rt.top,NULL);\r
+ //::LineTo(hdc,rt.right,rt.top);\r
+ //::LineTo(hdc,rt.right,rt.bottom);\r
+ //::LineTo(hdc,rt.left,rt.bottom);\r
+ //::LineTo(hdc,rt.left,rt.top);\r
+\r
\r
- rt.left=rt.right+3;\r
+ rt.left=rt.right+1;\r
}\r
if(brush)\r
::DeleteObject(brush);\r
} \r
rt.right=rect.right;\r
\r
- if (rItem.state & LVIS_SELECTED)\r
+ if (m_Theme.IsAppThemed() && m_bVista)\r
{\r
- COLORREF clrOld = ::SetTextColor(hdc,::GetSysColor(COLOR_HIGHLIGHTTEXT)); \r
- ::DrawText(hdc,data->m_Subject,data->m_Subject.GetLength(),&rt,DT_LEFT);\r
- ::SetTextColor(hdc,clrOld); \r
- }else\r
+ int txtState = LISS_NORMAL;\r
+ if (rItem.state & LVIS_SELECTED)\r
+ txtState = LISS_SELECTED;\r
+\r
+ m_Theme.DrawText(hdc, LVP_LISTITEM, txtState, data->m_Subject, -1, DT_LEFT | DT_SINGLELINE | DT_VCENTER, 0, &rt);\r
+ }\r
+ else\r
{\r
- ::DrawText(hdc,data->m_Subject,data->m_Subject.GetLength(),&rt,DT_LEFT);\r
+ if (rItem.state & LVIS_SELECTED)\r
+ {\r
+ COLORREF clrOld = ::SetTextColor(hdc,::GetSysColor(COLOR_HIGHLIGHTTEXT)); \r
+ ::DrawText(hdc,data->m_Subject,data->m_Subject.GetLength(),&rt,DT_LEFT | DT_SINGLELINE | DT_VCENTER);\r
+ ::SetTextColor(hdc,clrOld); \r
+ }else\r
+ {\r
+ ::DrawText(hdc,data->m_Subject,data->m_Subject.GetLength(),&rt,DT_LEFT | DT_SINGLELINE | DT_VCENTER);\r
+ }\r
}\r
- \r
}\r
\r
static COLORREF blend(const COLORREF& col1, const COLORREF& col2, int amount = 128) {\r