mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 01:42:30 +00:00
Use a better ReactOS Icon as application icon and for start menu button
svn path=/trunk/; revision=6064
This commit is contained in:
parent
fd94f77ea8
commit
b5596b0da8
|
@ -141,8 +141,8 @@ IDB_LOGOV BITMAP DISCARDABLE "res/logov.bmp"
|
|||
|
||||
IDA_EXPLORER ACCELERATORS DISCARDABLE
|
||||
BEGIN
|
||||
0x58, ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT
|
||||
0x53, ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL,
|
||||
"X", ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT
|
||||
"S", ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL,
|
||||
NOINVERT
|
||||
END
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
@ -86,7 +86,7 @@ LRESULT DesktopBar::Init(LPCREATESTRUCT pcs)
|
|||
|
||||
// create start button
|
||||
new PictureButton(Button(_hwnd, ResString(IDS_START), 2, 2, STARTBUTTON_WIDTH, DESKTOPBARBAR_HEIGHT-8, IDC_START, WS_VISIBLE|WS_CHILD|BS_OWNERDRAW),
|
||||
SmallIcon(IDI_STARTMENU));
|
||||
SmallIcon(IDI_STARTMENU)/*, GetStockBrush(WHITE_BRUSH)*/);
|
||||
|
||||
// create task bar
|
||||
_hwndTaskBar = TaskBar::Create(_hwnd);
|
||||
|
|
|
@ -526,10 +526,11 @@ void StartMenuButton::DrawItem(LPDRAWITEMSTRUCT dis)
|
|||
TCHAR title[BUFFER_LEN];
|
||||
GetWindowText(_hwnd, title, BUFFER_LEN);
|
||||
|
||||
BkMode bk_mode(dis->hDC, TRANSPARENT);
|
||||
|
||||
if (dis->itemState & (ODS_DISABLED|ODS_GRAYED))
|
||||
DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
|
||||
else {
|
||||
BkMode mode(dis->hDC, TRANSPARENT);
|
||||
TextColor lcColor(dis->hDC, GetSysColor(text_color));
|
||||
DrawText(dis->hDC, title, -1, &textRect, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
|
||||
}
|
||||
|
|
|
@ -591,7 +591,6 @@ void OwnerdrawnButton::DrawGrayText(LPDRAWITEMSTRUCT dis, LPRECT pRect, LPCTSTR
|
|||
RECT shadowRect = {pRect->left+1, pRect->top+1, pRect->right+1, pRect->bottom+1};
|
||||
DrawText(dis->hDC, title, -1, &shadowRect, dt_flags);
|
||||
|
||||
BkMode mode(dis->hDC, TRANSPARENT);
|
||||
SetTextColor(dis->hDC, gray);
|
||||
DrawText(dis->hDC, title, -1, pRect, dt_flags);
|
||||
} else {
|
||||
|
@ -612,27 +611,39 @@ void OwnerdrawnButton::DrawGrayText(LPDRAWITEMSTRUCT dis, LPRECT pRect, LPCTSTR
|
|||
}
|
||||
|
||||
|
||||
static BOOL DrawButton(HDC hdc, LPRECT prect, UINT state, HBRUSH hbrush)
|
||||
{
|
||||
FillRect(hdc, prect, hbrush);
|
||||
DrawEdge(hdc, prect, EDGE_RAISED, BF_RECT|BF_SOFT);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* not yet used
|
||||
void ColorButton::DrawItem(LPDRAWITEMSTRUCT dis)
|
||||
{
|
||||
UINT style = DFCS_BUTTONPUSH;
|
||||
UINT state = DFCS_BUTTONPUSH;
|
||||
|
||||
if (dis->itemState & ODS_DISABLED)
|
||||
style |= DFCS_INACTIVE;
|
||||
state |= DFCS_INACTIVE;
|
||||
|
||||
RECT textRect = {dis->rcItem.left+2, dis->rcItem.top+2, dis->rcItem.right-4, dis->rcItem.bottom-4};
|
||||
|
||||
if (dis->itemState & ODS_SELECTED) {
|
||||
style |= DFCS_PUSHED;
|
||||
state |= DFCS_PUSHED;
|
||||
++textRect.left; ++textRect.top;
|
||||
++textRect.right; ++textRect.bottom;
|
||||
}
|
||||
|
||||
DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, style);
|
||||
DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, state);
|
||||
//DrawButton(dis->hDC, &dis->rcItem, state, GetSysColorBrush(COLOR_BTNFACE));
|
||||
|
||||
TCHAR title[BUFFER_LEN];
|
||||
GetWindowText(_hwnd, title, BUFFER_LEN);
|
||||
|
||||
BkMode bk_mode(dis->hDC, TRANSPARENT);
|
||||
|
||||
if (dis->itemState & (ODS_DISABLED|ODS_GRAYED))
|
||||
DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
|
||||
else {
|
||||
|
@ -657,36 +668,40 @@ void ColorButton::DrawItem(LPDRAWITEMSTRUCT dis)
|
|||
|
||||
void PictureButton::DrawItem(LPDRAWITEMSTRUCT dis)
|
||||
{
|
||||
UINT style = DFCS_BUTTONPUSH;
|
||||
UINT state = DFCS_BUTTONPUSH;
|
||||
|
||||
if (dis->itemState & ODS_DISABLED)
|
||||
style |= DFCS_INACTIVE;
|
||||
state |= DFCS_INACTIVE;
|
||||
|
||||
POINT iconPos = {dis->rcItem.left+2, (dis->rcItem.top+dis->rcItem.bottom-16)/2};
|
||||
RECT textRect = {dis->rcItem.left+16+4, dis->rcItem.top+2, dis->rcItem.right-4, dis->rcItem.bottom-4};
|
||||
|
||||
if (dis->itemState & ODS_SELECTED) {
|
||||
style |= DFCS_PUSHED;
|
||||
state |= DFCS_PUSHED;
|
||||
++iconPos.x; ++iconPos.y;
|
||||
++textRect.left; ++textRect.top;
|
||||
++textRect.right; ++textRect.bottom;
|
||||
}
|
||||
|
||||
if (_flat) {
|
||||
FillRect(dis->hDC, &dis->rcItem, _hBrush);
|
||||
|
||||
if (GetWindowStyle(_hwnd) & BS_FLAT) // Only with BS_FLAT set, there will be drawn a frame without highlight.
|
||||
DrawEdge(dis->hDC, &dis->rcItem, EDGE_RAISED, BF_RECT|BF_FLAT);
|
||||
} else
|
||||
DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, style);
|
||||
//DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, state);
|
||||
DrawButton(dis->hDC, &dis->rcItem, state, _hBrush);
|
||||
|
||||
DrawIconEx(dis->hDC, iconPos.x, iconPos.y, _hIcon, 16, 16, 0, GetSysColorBrush(COLOR_BTNFACE), DI_NORMAL);
|
||||
DrawIconEx(dis->hDC, iconPos.x, iconPos.y, _hIcon, 16, 16, 0, _hBrush, DI_NORMAL);
|
||||
|
||||
TCHAR title[BUFFER_LEN];
|
||||
GetWindowText(_hwnd, title, BUFFER_LEN);
|
||||
|
||||
BkMode bk_mode(dis->hDC, TRANSPARENT);
|
||||
|
||||
if (dis->itemState & (ODS_DISABLED|ODS_GRAYED))
|
||||
DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_VCENTER/*|DT_CENTER*/);
|
||||
else {
|
||||
//BkMode mode(dis->hDC, TRANSPARENT);
|
||||
TextColor lcColor(dis->hDC, GetSysColor(COLOR_BTNTEXT));
|
||||
DrawText(dis->hDC, title, -1, &textRect, DT_SINGLELINE|DT_VCENTER/*|DT_CENTER*/);
|
||||
}
|
||||
|
|
|
@ -455,13 +455,16 @@ struct PictureButton : public OwnerdrawnButton
|
|||
{
|
||||
typedef OwnerdrawnButton super;
|
||||
|
||||
PictureButton(HWND hwnd, HICON hIcon, bool flat=false)
|
||||
: super(hwnd), _hIcon(hIcon), _flat(flat) {}
|
||||
PictureButton(HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
|
||||
: super(hwnd), _hIcon(hIcon), _hBrush(hbrush), _flat(flat)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT dis);
|
||||
|
||||
HICON _hIcon;
|
||||
HBRUSH _hBrush;
|
||||
bool _flat;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue