Index: gui/AG_Window.3 =================================================================== --- gui/AG_Window.3 (revision 8000) +++ gui/AG_Window.3 (revision 8004) @@ -102,6 +102,12 @@ .Fn AG_WindowSetSpacing "AG_Window *win" "int spacing" .Pp .Ft "void" +.Fn AG_WindowSetSideBorders "AG_Window *win" "int pixels" +.Pp +.Ft "void" +.Fn AG_WindowSetBottomBorder "AG_Window *win" "int pixels" +.Pp +.Ft "void" .Fn AG_WindowSetPosition "AG_Window *win, enum ag_window_alignment alignment" "int cascade" .Pp .Ft "void" @@ -239,6 +245,16 @@ .Fn AG_BoxSetSpacing function . .Pp +.Fn AG_WindowSetSideBorders +sets the thickness of the left and right window borders in pixels. +.Fn AG_WindowSetBottomBorder +sets the thickness of the bottom border. +The exact interpretation of this setting is theme-specific. +The default for side borders is 0 (no side borders). +If the +.Fa win +argument is NULL, the defaults are set. +.Pp The .Fn AG_WindowSetPosition specifies the method used to compute the initial window position. Index: gui/window.c =================================================================== --- gui/window.c (revision 8000) +++ gui/window.c (revision 8004) @@ -52,6 +52,8 @@ int agWindowBotOutLimit = 32; int agWindowIconWidth = 32; int agWindowIconHeight = 32; +int agWindowSideBorderDefault = 0; +int agWindowBotBorderDefault = 6; extern SDL_Cursor *agCursorToSet; /* widget.c */ @@ -170,8 +172,8 @@ win->wMin = win->lPad + win->rPad + 16; win->hMin = win->tPad + win->bPad + 16; win->minPct = 50; - win->wBorderBot = 6; - win->wBorderSide = 0; + win->wBorderBot = agWindowBotBorderDefault; + win->wBorderSide = agWindowSideBorderDefault; win->wResizeCtrl = 16; win->rSaved = AG_RECT(-1,-1,-1,-1); win->r = AG_RECT(0,0,0,0); @@ -1494,8 +1496,10 @@ AG_Widget *chld; AG_SizeReq rChld, rTbar; int nWidgets; + int wTot; - r->w = win->lPad+win->rPad + win->wBorderSide*2; + wTot = win->lPad + win->rPad + win->wBorderSide*2; + r->w = wTot; r->h = win->bPad+win->tPad + win->wBorderBot; if (win->tbar != NULL) { @@ -1509,8 +1513,7 @@ continue; } AG_WidgetSizeReq(chld, &rChld); - r->w = MAX(r->w, rChld.w + (win->lPad+win->rPad) + - win->wBorderSide*2); + r->w = MAX(r->w, rChld.w + wTot); r->h += rChld.h + win->spacing; nWidgets++; } @@ -1602,12 +1605,38 @@ win->r.x = 0; win->r.y = 0; - win->r.w = a->w - win->wBorderSide*2; - win->r.h = a->h - win->wBorderBot; + win->r.w = a->w; + win->r.h = a->h; return (0); } +/* Set the width of the window side borders. */ +void +AG_WindowSetSideBorders(AG_Window *win, int pixels) +{ + if (win != NULL) { + AG_ObjectLock(win); + win->wBorderSide = pixels; + AG_ObjectUnlock(win); + } else { + agWindowSideBorderDefault = pixels; + } +} + +/* Set the width of the window bottom border. */ +void +AG_WindowSetBottomBorder(AG_Window *win, int pixels) +{ + if (win != NULL) { + AG_ObjectLock(win); + win->wBorderBot = pixels; + AG_ObjectUnlock(win); + } else { + agWindowBotBorderDefault = pixels; + } +} + /* Change the spacing between child widgets. */ void AG_WindowSetSpacing(AG_Window *win, int spacing) Index: gui/window.h =================================================================== --- gui/window.h (revision 8000) +++ gui/window.h (revision 8004) @@ -124,6 +124,8 @@ #define AG_WindowSetPaddingRight(w,p) AG_WindowSetPadding((w),-1,(p),-1,-1) #define AG_WindowSetPaddingTop(w,p) AG_WindowSetPadding((w),-1,-1,(p),-1) #define AG_WindowSetPaddingBottom(w,p) AG_WindowSetPadding((w),-1,-1,-1,(p)) +void AG_WindowSetSideBorders(AG_Window *, int); +void AG_WindowSetBottomBorder(AG_Window *, int); void AG_WindowSetPosition(AG_Window *, enum ag_window_alignment, int); void AG_WindowSetCloseAction(AG_Window *, enum ag_window_close_action);