From 2906835b9226891e9f364fd27e9bf18b2664dd68 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Fri, 12 Mar 2004 21:12:28 +0000 Subject: [PATCH] adjust start button to text size svn path=/branches/lean-explorer/; revision=8669 --- .../subsys/system/explorer/taskbar/desktopbar.cpp | 14 +++++++++++--- .../subsys/system/explorer/taskbar/desktopbar.h | 1 + reactos/subsys/system/explorer/taskbar/startmenu.h | 2 ++ reactos/subsys/system/explorer/taskbar/taskbar.h | 2 -- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/reactos/subsys/system/explorer/taskbar/desktopbar.cpp b/reactos/subsys/system/explorer/taskbar/desktopbar.cpp index 0dd359e3df7..f0a8b5931c6 100644 --- a/reactos/subsys/system/explorer/taskbar/desktopbar.cpp +++ b/reactos/subsys/system/explorer/taskbar/desktopbar.cpp @@ -89,7 +89,15 @@ LRESULT DesktopBar::Init(LPCREATESTRUCT pcs) return 1; // 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), + ResString start_str(IDS_START); + WindowCanvas canvas(_hwnd); + RECT rect = {0, 0}; + DrawText(canvas, start_str, -1, &rect, DT_SINGLELINE|DT_CALCRECT); + int start_btn_width = rect.right+16+8; + + _taskbar_pos = start_btn_width + 6; + + new PictureButton(Button(_hwnd, start_str, 2, 2, start_btn_width, DESKTOPBARBAR_HEIGHT-8, IDC_START, WS_VISIBLE|WS_CHILD|BS_OWNERDRAW), SmallIcon(IDI_STARTMENU)/*, GetStockBrush(WHITE_BRUSH)*/); // create task bar @@ -210,13 +218,13 @@ void DesktopBar::Resize(int cx, int cy) HDWP hdwp = BeginDeferWindowPos(3); if (_hwndTaskBar) - DeferWindowPos(hdwp, _hwndTaskBar, 0, TASKBAR_LEFT+quicklaunch_width, 0, cx-TASKBAR_LEFT-quicklaunch_width-(notifyarea_width+1), cy, SWP_NOZORDER|SWP_NOACTIVATE); + DeferWindowPos(hdwp, _hwndTaskBar, 0, _taskbar_pos+quicklaunch_width, 0, cx-_taskbar_pos-quicklaunch_width-(notifyarea_width+1), cy, SWP_NOZORDER|SWP_NOACTIVATE); if (_hwndNotify) DeferWindowPos(hdwp, _hwndNotify, 0, cx-(notifyarea_width+1), 1, notifyarea_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE); if (_hwndQuickLaunch) - DeferWindowPos(hdwp, _hwndQuickLaunch, 0, TASKBAR_LEFT, 1, quicklaunch_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE); + DeferWindowPos(hdwp, _hwndQuickLaunch, 0, _taskbar_pos, 1, quicklaunch_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE); EndDeferWindowPos(hdwp); diff --git a/reactos/subsys/system/explorer/taskbar/desktopbar.h b/reactos/subsys/system/explorer/taskbar/desktopbar.h index 6bc22e1653c..a1edfc3e954 100644 --- a/reactos/subsys/system/explorer/taskbar/desktopbar.h +++ b/reactos/subsys/system/explorer/taskbar/desktopbar.h @@ -73,6 +73,7 @@ protected: int WM_TASKBARCREATED; RECT _work_area_org; + int _taskbar_pos; LRESULT Init(LPCREATESTRUCT pcs); LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); diff --git a/reactos/subsys/system/explorer/taskbar/startmenu.h b/reactos/subsys/system/explorer/taskbar/startmenu.h index 676dc80000d..248ca196570 100644 --- a/reactos/subsys/system/explorer/taskbar/startmenu.h +++ b/reactos/subsys/system/explorer/taskbar/startmenu.h @@ -394,6 +394,8 @@ protected: }; +#define RECENT_DOCS_COUNT 20 ///@todo read max. count of entries from registry + /// "Recent Files" sub-start menu struct RecentStartMenu : public StartMenu { diff --git a/reactos/subsys/system/explorer/taskbar/taskbar.h b/reactos/subsys/system/explorer/taskbar/taskbar.h index 7828ada0888..d814019d113 100644 --- a/reactos/subsys/system/explorer/taskbar/taskbar.h +++ b/reactos/subsys/system/explorer/taskbar/taskbar.h @@ -31,8 +31,6 @@ #define IDC_FIRST_APP 0x2000 -#define STARTBUTTON_WIDTH 60 -#define TASKBAR_LEFT 70 //#define TASKBAR_AT_TOP #define TASKBUTTONWIDTH_MIN 38