# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1322729465 0 # Node ID 96460bd4c6791af5409662ddf35801854d35719f # Parent 2f10480d2c8ae3c2b80420ada42ab16cf2163070 Fixes for groupboxes with no text (or very small text) on Windows not displaying properly. diff -r 2f10480d2c8a -r 96460bd4c679 win/dw.c --- a/win/dw.c Wed Nov 30 06:00:29 2011 +0000 +++ b/win/dw.c Thu Dec 01 08:51:05 2011 +0000 @@ -1125,19 +1125,26 @@ { char *text = dw_window_get_text(thisbox->grouphwnd); - thisbox->grouppady = 0; + thisbox->grouppady = 9; if(text) { - dw_font_text_extents_get(thisbox->grouphwnd, 0, text, NULL, &thisbox->grouppady); + if(*text) + dw_font_text_extents_get(thisbox->grouphwnd, 0, text, NULL, &thisbox->grouppady); dw_free(text); } - + /* If the string height is less than 9... + * set it to 9 anyway since that is the minimum. + */ + if(thisbox->grouppady < 9) + thisbox->grouppady = 9; + if(thisbox->grouppady) thisbox->grouppady += 3; else thisbox->grouppady = 6; + dw_debug("grouppady %d\n", thisbox->grouppady); thisbox->grouppadx = 6; (*usedx) += thisbox->grouppadx;