Mercurial > dwindows
comparison win/dw.c @ 1408:96460bd4c679
Fixes for groupboxes with no text (or very small text) on Windows not displaying properly.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 01 Dec 2011 08:51:05 +0000 |
parents | 56f311dc23f6 |
children | 93eb987c05cf |
comparison
equal
deleted
inserted
replaced
1407:2f10480d2c8a | 1408:96460bd4c679 |
---|---|
1123 | 1123 |
1124 if(thisbox->grouphwnd) | 1124 if(thisbox->grouphwnd) |
1125 { | 1125 { |
1126 char *text = dw_window_get_text(thisbox->grouphwnd); | 1126 char *text = dw_window_get_text(thisbox->grouphwnd); |
1127 | 1127 |
1128 thisbox->grouppady = 0; | 1128 thisbox->grouppady = 9; |
1129 | 1129 |
1130 if(text) | 1130 if(text) |
1131 { | 1131 { |
1132 dw_font_text_extents_get(thisbox->grouphwnd, 0, text, NULL, &thisbox->grouppady); | 1132 if(*text) |
1133 dw_font_text_extents_get(thisbox->grouphwnd, 0, text, NULL, &thisbox->grouppady); | |
1133 dw_free(text); | 1134 dw_free(text); |
1134 } | 1135 } |
1135 | 1136 /* If the string height is less than 9... |
1137 * set it to 9 anyway since that is the minimum. | |
1138 */ | |
1139 if(thisbox->grouppady < 9) | |
1140 thisbox->grouppady = 9; | |
1141 | |
1136 if(thisbox->grouppady) | 1142 if(thisbox->grouppady) |
1137 thisbox->grouppady += 3; | 1143 thisbox->grouppady += 3; |
1138 else | 1144 else |
1139 thisbox->grouppady = 6; | 1145 thisbox->grouppady = 6; |
1140 | 1146 |
1147 dw_debug("grouppady %d\n", thisbox->grouppady); | |
1141 thisbox->grouppadx = 6; | 1148 thisbox->grouppadx = 6; |
1142 | 1149 |
1143 (*usedx) += thisbox->grouppadx; | 1150 (*usedx) += thisbox->grouppadx; |
1144 (*usedpadx) += thisbox->grouppadx; | 1151 (*usedpadx) += thisbox->grouppadx; |
1145 (*usedy) += thisbox->grouppady; | 1152 (*usedy) += thisbox->grouppady; |