Fix the taskbar button resizing to account for button spacing.

svn path=/trunk/; revision=17933
This commit is contained in:
Filip Navara 2005-09-19 15:15:22 +00:00
parent e402efe2c3
commit fe51307bd2

View file

@ -136,6 +136,17 @@ LRESULT TaskBar::Init(LPCREATESTRUCT pcs)
//SendMessage(_htoolbar, TB_SETPADDING, 0, MAKELPARAM(8,8)); //SendMessage(_htoolbar, TB_SETPADDING, 0, MAKELPARAM(8,8));
metrics.cbSize = sizeof(TBMETRICS); metrics.cbSize = sizeof(TBMETRICS);
metrics.dwMask = TBMF_PAD | TBMF_BARPAD | TBMF_BUTTONSPACING;
SendMessage(_htoolbar, TB_GETMETRICS, 0, (LPARAM)&metrics);
{
FILE *f = fopen("test.txt", "w");
fprintf(f, "Pad: %d, %d\nBarPad: %d, %d\nBS: %d, %d\n",
metrics.cxPad, metrics.cyPad,
metrics.cxBarPad, metrics.cyBarPad,
metrics.cxButtonSpacing, metrics.cyButtonSpacing);
fclose(f);
}
metrics.dwMask = TBMF_BARPAD | TBMF_BUTTONSPACING; metrics.dwMask = TBMF_BARPAD | TBMF_BUTTONSPACING;
metrics.cxBarPad = 0; metrics.cxBarPad = 0;
metrics.cyBarPad = 0; metrics.cyBarPad = 0;
@ -562,7 +573,7 @@ void TaskBar::ResizeButtons()
if (btns > 0) { if (btns > 0) {
int bar_width = ClientRect(_hwnd).right; int bar_width = ClientRect(_hwnd).right;
int btn_width = bar_width / btns; int btn_width = (bar_width / btns) - 3;
if (btn_width < TASKBUTTONWIDTH_MIN) if (btn_width < TASKBUTTONWIDTH_MIN)
btn_width = TASKBUTTONWIDTH_MIN; btn_width = TASKBUTTONWIDTH_MIN;