Make the explorer taskbar look a bit nicer.
Added: trunk/reactos/subsys/system/explorer/explorer.exe.manifest
Modified: trunk/reactos/subsys/system/explorer/explorer.rc
Modified: trunk/reactos/subsys/system/explorer/taskbar/desktopbar.cpp
Modified: trunk/reactos/subsys/system/explorer/taskbar/desktopbar.h
Modified: trunk/reactos/subsys/system/explorer/taskbar/taskbar.cpp
_____
Added: trunk/reactos/subsys/system/explorer/explorer.exe.manifest
--- trunk/reactos/subsys/system/explorer/explorer.exe.manifest
2005-08-26 20:02:53 UTC (rev 17561)
+++ trunk/reactos/subsys/system/explorer/explorer.exe.manifest
2005-08-26 20:03:41 UTC (rev 17562)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
+<assemblyIdentity
+ version="1.0.0.0"
+ processorArchitecture="X86"
+ name="IrfanView"
+ type="win32"
+/>
+<description>Universal picture viewer</description>
+<dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="X86"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+</dependency>
+</assembly>
_____
Modified: trunk/reactos/subsys/system/explorer/explorer.rc
--- trunk/reactos/subsys/system/explorer/explorer.rc 2005-08-26
20:02:53 UTC (rev 17561)
+++ trunk/reactos/subsys/system/explorer/explorer.rc 2005-08-26
20:03:41 UTC (rev 17562)
@@ -19,3 +19,7 @@
IDS_VERSION_STR REACTOS_STR_PRODUCT_VERSION
IDS_EXPLORER_VERSION_STR "ReactOS %s Explorer"
END
+
+#define MANIFEST_RESOURCE_ID 1
+
+MANIFEST_RESOURCE_ID RT_MANIFEST "explorer.exe.manifest"
_____
Modified: trunk/reactos/subsys/system/explorer/taskbar/desktopbar.cpp
--- trunk/reactos/subsys/system/explorer/taskbar/desktopbar.cpp
2005-08-26 20:02:53 UTC (rev 17561)
+++ trunk/reactos/subsys/system/explorer/taskbar/desktopbar.cpp
2005-08-26 20:03:41 UTC (rev 17562)
@@ -99,7 +99,7 @@
_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),
+ new PictureButton(Button(_hwnd, start_str, 1, 1,
start_btn_width, REBARBAND_HEIGHT, IDC_START,
WS_VISIBLE|WS_CHILD|BS_OWNERDRAW),
SmallIcon(IDI_STARTMENU)/*, GetStockBrush(WHITE_BRUSH)*/);
// create task bar
@@ -124,36 +124,33 @@
_hwndrebar = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME,
NULL,
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
RBS_VARHEIGHT|RBS_AUTOSIZE|RBS_DBLCLKTOGGLE| //|RBS_REGISTERDROP
- CCS_NODIVIDER|CCS_NOPARENTALIGN,
+
CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_TOP,
0, 0, 0, 0, _hwnd, 0,
g_Globals._hInstance, 0);
REBARBANDINFO rbBand;
rbBand.cbSize = sizeof(REBARBANDINFO);
- rbBand.fMask =
RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE;
+ rbBand.fMask =
RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE|RBBIM_ID|R
BBIM_IDEALSIZE;
#ifndef RBBS_HIDETITLE // missing in MinGW headers as of 25.02.2004
#define RBBS_HIDETITLE 0x400
#endif
- rbBand.fStyle =
RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE;
+ rbBand.cyChild = REBARBAND_HEIGHT;
+ rbBand.cyMaxChild = (ULONG)-1;
+ rbBand.cyMinChild = REBARBAND_HEIGHT;
+ rbBand.cyIntegral = REBARBAND_HEIGHT + 3; //@@ OK?
+ rbBand.cxMinChild = rbBand.cyIntegral * 3;
+ rbBand.fStyle =
RBBS_VARIABLEHEIGHT|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE;
- rbBand.cxMinChild = 0;
- rbBand.cyMinChild = 0;
- rbBand.cyChild = 0;
- rbBand.cyMaxChild = 0;
- rbBand.cyIntegral = DESKTOPBARBAR_HEIGHT; //@@ OK?
-
rbBand.lpText = TEXT("Quicklaunch");
rbBand.hwndChild = _hwndQuickLaunch;
- rbBand.cxMinChild = 0;
- rbBand.cyMinChild = HIWORD(SendMessage(_hwndQuickLaunch,
TB_GETBUTTONSIZE, 0, 0)) + 2;
rbBand.cx = 250;
+ rbBand.wID = IDW_QUICKLAUNCHBAR;
SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1,
(LPARAM)&rbBand);
rbBand.lpText = TEXT("Taskbar");
rbBand.hwndChild = _hwndTaskBar;
- rbBand.cxMinChild = 0;
- rbBand.cyMinChild = ClientRect(_hwndTaskBar).bottom + 2;
rbBand.cx = 200;
//pcs->cx-_taskbar_pos-quicklaunch_width-(notifyarea_width+1);
+ rbBand.wID = IDW_TASKTOOLBAR;
SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1,
(LPARAM)&rbBand);
#endif
@@ -274,7 +271,21 @@
return 0;
}
+int DesktopBar::Notify(int id, NMHDR* pnmh)
+{
+ if (pnmh->code == RBN_CHILDSIZE) {
+ /* align the task bands to the top, so it's in row with
the Start button */
+ NMREBARCHILDSIZE *childSize = (NMREBARCHILDSIZE*)pnmh;
+ if (childSize->wID == IDW_TASKTOOLBAR) {
+ int cy = childSize->rcChild.top -
childSize->rcBand.top;
+ childSize->rcChild.bottom -= cy;
+ childSize->rcChild.top -= cy;
+ }
+ }
+ return 0;
+}
+
void DesktopBar::Resize(int cx, int cy)
{
///@todo general children resizing algorithm
@@ -284,7 +295,7 @@
HDWP hdwp = BeginDeferWindowPos(3);
if (_hwndrebar)
- DeferWindowPos(hdwp, _hwndrebar, 0, _taskbar_pos, 0,
cx-_taskbar_pos-(notifyarea_width+1), cy, SWP_NOZORDER|SWP_NOACTIVATE);
+ DeferWindowPos(hdwp, _hwndrebar, 0, _taskbar_pos, 1,
cx-_taskbar_pos-(notifyarea_width+1), cy-2,
SWP_NOZORDER|SWP_NOACTIVATE);
else {
if (_hwndQuickLaunch)
DeferWindowPos(hdwp, _hwndQuickLaunch, 0,
_taskbar_pos, 1, quicklaunch_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE);
_____
Modified: trunk/reactos/subsys/system/explorer/taskbar/desktopbar.h
--- trunk/reactos/subsys/system/explorer/taskbar/desktopbar.h
2005-08-26 20:02:53 UTC (rev 17561)
+++ trunk/reactos/subsys/system/explorer/taskbar/desktopbar.h
2005-08-26 20:03:41 UTC (rev 17562)
@@ -30,7 +30,8 @@
#define TITLE_EXPLORERBAR TEXT("") // use
an empty window title, so windows taskmanager does not show the window
in its application list
-#define DESKTOPBARBAR_HEIGHT 29
+#define DESKTOPBARBAR_HEIGHT (GetSystemMetrics(SM_CYSIZE) + 5
* GetSystemMetrics(SM_CYEDGE))
+#define REBARBAND_HEIGHT (GetSystemMetrics(SM_CYSIZE) + 2
* GetSystemMetrics(SM_CYEDGE))
#define IDC_START 0x1000
@@ -89,6 +90,7 @@
LRESULT Init(LPCREATESTRUCT pcs);
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
+ int Notify(int id, NMHDR* pnmh);
int Command(int id, int code);
void Resize(int cx, int cy);
_____
Modified: trunk/reactos/subsys/system/explorer/taskbar/taskbar.cpp
--- trunk/reactos/subsys/system/explorer/taskbar/taskbar.cpp
2005-08-26 20:02:53 UTC (rev 17561)
+++ trunk/reactos/subsys/system/explorer/taskbar/taskbar.cpp
2005-08-26 20:03:41 UTC (rev 17562)
@@ -118,12 +118,15 @@
LRESULT TaskBar::Init(LPCREATESTRUCT pcs)
{
+ TBMETRICS metrics;
+
if (super::Init(pcs))
return 1;
+ /* FIXME: There's an internal padding for non-flat toolbar. Get
rid of it somehow. */
_htoolbar = CreateToolbarEx(_hwnd,
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
-
CCS_TOP|CCS_NODIVIDER |
TBSTYLE_LIST|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,//|TBSTYLE_AUTOSIZE
+
CCS_TOP|CCS_NODIVIDER|TBSTYLE_LIST|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,//|
TBSTYLE_AUTOSIZE
IDW_TASKTOOLBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0,
MAKELONG(TASKBUTTONWIDTH_MAX,TASKBUTTONWIDTH_MAX));
@@ -132,6 +135,14 @@
//SetWindowFont(_htoolbar, GetStockFont(ANSI_VAR_FONT), FALSE);
//SendMessage(_htoolbar, TB_SETPADDING, 0, MAKELPARAM(8,8));
+ metrics.cbSize = sizeof(TBMETRICS);
+ metrics.dwMask = TBMF_BARPAD | TBMF_BUTTONSPACING;
+ metrics.cxBarPad = 0;
+ metrics.cyBarPad = 0;
+ metrics.cxButtonSpacing = 3;
+ metrics.cyButtonSpacing = 3;
+ SendMessage(_htoolbar, TB_SETMETRICS, 0, (LPARAM)&metrics);
+
_next_id = IDC_FIRST_APP;
// register the taskbar window as task manager window to make
the following call to RegisterShellHookWindow working