From b5596b0da81557f9b96cad713d237aff3270d34c Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sat, 13 Sep 2003 23:52:05 +0000 Subject: [PATCH] Use a better ReactOS Icon as application icon and for start menu button svn path=/trunk/; revision=6064 --- .../subsys/system/explorer/explorer_intres.rc | 4 +- .../subsys/system/explorer/res/reactos.ico | Bin 3638 -> 3638 bytes .../subsys/system/explorer/res/startmenu.ico | Bin 1406 -> 1406 bytes .../system/explorer/taskbar/desktopbar.cpp | 2 +- .../system/explorer/taskbar/startmenu.cpp | 3 +- .../subsys/system/explorer/utility/window.cpp | 37 ++++++++++++------ .../subsys/system/explorer/utility/window.h | 7 +++- 7 files changed, 36 insertions(+), 17 deletions(-) diff --git a/reactos/subsys/system/explorer/explorer_intres.rc b/reactos/subsys/system/explorer/explorer_intres.rc index d3e7fce2709..e5053b4a1b8 100644 --- a/reactos/subsys/system/explorer/explorer_intres.rc +++ b/reactos/subsys/system/explorer/explorer_intres.rc @@ -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 diff --git a/reactos/subsys/system/explorer/res/reactos.ico b/reactos/subsys/system/explorer/res/reactos.ico index c0c0ac504ce4b3b7aad7a0347993185e080712b6..a8369c76aa286b05bae515e1fb130e70b4f53295 100644 GIT binary patch delta 1034 zcmZuv!D5JE?)QQN$?|PPA%#eB!cE(flM(!;1?7^cNQ{z ziTDHg01tbgIjp+_<{*r(W_Du~3u>3{_v*c>>X{$R55Bw}AB&J{TtT%PqIPvb6wX88 z+$+7UIabAK2$Yd`1X8T3Smd5V(NKePW!XzbR0P+HL?Vlbxssg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f3966e7af1b62a..778ae5b1d0fd734c288cffc4d257dbc294dbbc40 100644 GIT binary patch delta 249 zcmYLDyA8rH5IsbYm8+&S~zyt|VGlv}`#z$(67MrFu z9x!HcwhQ189H=YO(Dxs~InGeg{shYoClz-g#DMiuG_itP6wW{NsyrsUGFxr-mz?Oj bCVCLjGXWOZ6|f{aW8Xr9O|JvdH2v`ghMj1~ delta 259 zcmZurOA5j;5FM~3G7K1}2XN;R#Fbt_y31xfMb{pptKPyRcog>uG-MMO(wany8z0Pr z_vX!K!U^x!s=rj#EktXb!UaBRL~0hp52i`lwnGVo!AK-z)3qTR-iV0f#9av}=iC@= zOc--N5)oT&h_uUErR7=`j#&pjAUP36UOka2k^4<+>5df%Vw_3^a> W@Ed@q0(h+cSMKG^`wTG8-}(TP4NI~B diff --git a/reactos/subsys/system/explorer/taskbar/desktopbar.cpp b/reactos/subsys/system/explorer/taskbar/desktopbar.cpp index 06d42d19831..6641d666694 100644 --- a/reactos/subsys/system/explorer/taskbar/desktopbar.cpp +++ b/reactos/subsys/system/explorer/taskbar/desktopbar.cpp @@ -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); diff --git a/reactos/subsys/system/explorer/taskbar/startmenu.cpp b/reactos/subsys/system/explorer/taskbar/startmenu.cpp index 1388e6c55f2..a7d1ca47389 100644 --- a/reactos/subsys/system/explorer/taskbar/startmenu.cpp +++ b/reactos/subsys/system/explorer/taskbar/startmenu.cpp @@ -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); } diff --git a/reactos/subsys/system/explorer/utility/window.cpp b/reactos/subsys/system/explorer/utility/window.cpp index 6c6fe4f8856..ad3b5709279 100644 --- a/reactos/subsys/system/explorer/utility/window.cpp +++ b/reactos/subsys/system/explorer/utility/window.cpp @@ -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*/); } diff --git a/reactos/subsys/system/explorer/utility/window.h b/reactos/subsys/system/explorer/utility/window.h index f5dc6d58909..fc06d957a0a 100644 --- a/reactos/subsys/system/explorer/utility/window.h +++ b/reactos/subsys/system/explorer/utility/window.h @@ -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; };