Use a better ReactOS Icon as application icon and for start menu button

svn path=/trunk/; revision=6064
This commit is contained in:
Martin Fuchs 2003-09-13 23:52:05 +00:00
parent fd94f77ea8
commit b5596b0da8
7 changed files with 36 additions and 17 deletions

View file

@ -141,8 +141,8 @@ IDB_LOGOV BITMAP DISCARDABLE "res/logov.bmp"
IDA_EXPLORER ACCELERATORS DISCARDABLE IDA_EXPLORER ACCELERATORS DISCARDABLE
BEGIN BEGIN
0x58, ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT "X", ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT
0x53, ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL, "S", ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL,
NOINVERT NOINVERT
END END

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

View file

@ -86,7 +86,7 @@ LRESULT DesktopBar::Init(LPCREATESTRUCT pcs)
// create start button // 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), 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 // create task bar
_hwndTaskBar = TaskBar::Create(_hwnd); _hwndTaskBar = TaskBar::Create(_hwnd);

View file

@ -526,10 +526,11 @@ void StartMenuButton::DrawItem(LPDRAWITEMSTRUCT dis)
TCHAR title[BUFFER_LEN]; TCHAR title[BUFFER_LEN];
GetWindowText(_hwnd, title, BUFFER_LEN); GetWindowText(_hwnd, title, BUFFER_LEN);
BkMode bk_mode(dis->hDC, TRANSPARENT);
if (dis->itemState & (ODS_DISABLED|ODS_GRAYED)) if (dis->itemState & (ODS_DISABLED|ODS_GRAYED))
DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER); DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
else { else {
BkMode mode(dis->hDC, TRANSPARENT);
TextColor lcColor(dis->hDC, GetSysColor(text_color)); TextColor lcColor(dis->hDC, GetSysColor(text_color));
DrawText(dis->hDC, title, -1, &textRect, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER); DrawText(dis->hDC, title, -1, &textRect, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
} }

View file

@ -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}; RECT shadowRect = {pRect->left+1, pRect->top+1, pRect->right+1, pRect->bottom+1};
DrawText(dis->hDC, title, -1, &shadowRect, dt_flags); DrawText(dis->hDC, title, -1, &shadowRect, dt_flags);
BkMode mode(dis->hDC, TRANSPARENT);
SetTextColor(dis->hDC, gray); SetTextColor(dis->hDC, gray);
DrawText(dis->hDC, title, -1, pRect, dt_flags); DrawText(dis->hDC, title, -1, pRect, dt_flags);
} else { } 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 /* not yet used
void ColorButton::DrawItem(LPDRAWITEMSTRUCT dis) void ColorButton::DrawItem(LPDRAWITEMSTRUCT dis)
{ {
UINT style = DFCS_BUTTONPUSH; UINT state = DFCS_BUTTONPUSH;
if (dis->itemState & ODS_DISABLED) 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}; RECT textRect = {dis->rcItem.left+2, dis->rcItem.top+2, dis->rcItem.right-4, dis->rcItem.bottom-4};
if (dis->itemState & ODS_SELECTED) { if (dis->itemState & ODS_SELECTED) {
style |= DFCS_PUSHED; state |= DFCS_PUSHED;
++textRect.left; ++textRect.top; ++textRect.left; ++textRect.top;
++textRect.right; ++textRect.bottom; ++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]; TCHAR title[BUFFER_LEN];
GetWindowText(_hwnd, title, BUFFER_LEN); GetWindowText(_hwnd, title, BUFFER_LEN);
BkMode bk_mode(dis->hDC, TRANSPARENT);
if (dis->itemState & (ODS_DISABLED|ODS_GRAYED)) if (dis->itemState & (ODS_DISABLED|ODS_GRAYED))
DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_VCENTER|DT_CENTER); DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
else { else {
@ -657,36 +668,40 @@ void ColorButton::DrawItem(LPDRAWITEMSTRUCT dis)
void PictureButton::DrawItem(LPDRAWITEMSTRUCT dis) void PictureButton::DrawItem(LPDRAWITEMSTRUCT dis)
{ {
UINT style = DFCS_BUTTONPUSH; UINT state = DFCS_BUTTONPUSH;
if (dis->itemState & ODS_DISABLED) 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}; 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}; RECT textRect = {dis->rcItem.left+16+4, dis->rcItem.top+2, dis->rcItem.right-4, dis->rcItem.bottom-4};
if (dis->itemState & ODS_SELECTED) { if (dis->itemState & ODS_SELECTED) {
style |= DFCS_PUSHED; state |= DFCS_PUSHED;
++iconPos.x; ++iconPos.y; ++iconPos.x; ++iconPos.y;
++textRect.left; ++textRect.top; ++textRect.left; ++textRect.top;
++textRect.right; ++textRect.bottom; ++textRect.right; ++textRect.bottom;
} }
if (_flat) { 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. 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); DrawEdge(dis->hDC, &dis->rcItem, EDGE_RAISED, BF_RECT|BF_FLAT);
} else } 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]; TCHAR title[BUFFER_LEN];
GetWindowText(_hwnd, title, BUFFER_LEN); GetWindowText(_hwnd, title, BUFFER_LEN);
BkMode bk_mode(dis->hDC, TRANSPARENT);
if (dis->itemState & (ODS_DISABLED|ODS_GRAYED)) if (dis->itemState & (ODS_DISABLED|ODS_GRAYED))
DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_VCENTER/*|DT_CENTER*/); DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_VCENTER/*|DT_CENTER*/);
else { else {
//BkMode mode(dis->hDC, TRANSPARENT);
TextColor lcColor(dis->hDC, GetSysColor(COLOR_BTNTEXT)); TextColor lcColor(dis->hDC, GetSysColor(COLOR_BTNTEXT));
DrawText(dis->hDC, title, -1, &textRect, DT_SINGLELINE|DT_VCENTER/*|DT_CENTER*/); DrawText(dis->hDC, title, -1, &textRect, DT_SINGLELINE|DT_VCENTER/*|DT_CENTER*/);
} }

View file

@ -455,13 +455,16 @@ struct PictureButton : public OwnerdrawnButton
{ {
typedef OwnerdrawnButton super; typedef OwnerdrawnButton super;
PictureButton(HWND hwnd, HICON hIcon, bool flat=false) PictureButton(HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
: super(hwnd), _hIcon(hIcon), _flat(flat) {} : super(hwnd), _hIcon(hIcon), _hBrush(hbrush), _flat(flat)
{
}
protected: protected:
virtual void DrawItem(LPDRAWITEMSTRUCT dis); virtual void DrawItem(LPDRAWITEMSTRUCT dis);
HICON _hIcon; HICON _hIcon;
HBRUSH _hBrush;
bool _flat; bool _flat;
}; };