mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
use system colors instead of hardcoded constants for drive panes
svn path=/trunk/; revision=6089
This commit is contained in:
parent
d1e179a339
commit
b4f1ad8ce1
2 changed files with 17 additions and 8 deletions
|
@ -189,6 +189,17 @@ void Pane::init()
|
|||
|
||||
SetWindowFont(_hwnd, _out_wrkr._hfont, FALSE);
|
||||
|
||||
// read the color for compressed files from registry
|
||||
HKEY hkeyExplorer = 0;
|
||||
DWORD len = sizeof(_clrCompressed);
|
||||
|
||||
if (RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"), &hkeyExplorer) ||
|
||||
RegQueryValueEx(hkeyExplorer, _T("AltColor"), 0, NULL, (LPBYTE)&_clrCompressed, &len) || len!=sizeof(_clrCompressed))
|
||||
_clrCompressed = RGB(0,0,255);
|
||||
|
||||
if (hkeyExplorer)
|
||||
RegCloseKey(hkeyExplorer);
|
||||
|
||||
// calculate column widths
|
||||
_out_wrkr.init_output(_hwnd);
|
||||
calc_widths(true);
|
||||
|
@ -447,15 +458,15 @@ void Pane::draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol)
|
|||
focusRect.left = img_pos -2;
|
||||
|
||||
if (attrs & FILE_ATTRIBUTE_COMPRESSED)
|
||||
textcolor = COLOR_COMPRESSED;
|
||||
textcolor = _clrCompressed;
|
||||
else
|
||||
textcolor = RGB(0,0,0);
|
||||
|
||||
if (dis->itemState & ODS_FOCUS) {
|
||||
textcolor = RGB(255,255,255);
|
||||
bkcolor = COLOR_SELECTION;
|
||||
textcolor = GetSysColor(COLOR_HIGHLIGHTTEXT);
|
||||
bkcolor = GetSysColor(COLOR_HIGHLIGHT);
|
||||
} else {
|
||||
bkcolor = RGB(255,255,255);
|
||||
bkcolor = GetSysColor(COLOR_WINDOW);
|
||||
}
|
||||
|
||||
HBRUSH hbrush = CreateSolidBrush(bkcolor);
|
||||
|
|
|
@ -26,10 +26,6 @@
|
|||
//
|
||||
|
||||
|
||||
#define COLOR_COMPRESSED RGB(0,0,255)
|
||||
#define COLOR_SELECTION RGB(0,0,128)
|
||||
|
||||
|
||||
#define IDW_TREE_LEFT 3
|
||||
#define IDW_TREE_RIGHT 6
|
||||
#define IDW_HEADER_LEFT 2
|
||||
|
@ -80,6 +76,8 @@ struct Pane : public SubclassedWindow
|
|||
Entry* _root;
|
||||
Entry* _cur;
|
||||
|
||||
COLORREF _clrCompressed;
|
||||
|
||||
void init();
|
||||
void set_header();
|
||||
bool create_header(HWND parent, int id);
|
||||
|
|
Loading…
Reference in a new issue