On Sun, Jun 21, 2009 at 08:36:48PM +0200, Johannes Hofmann wrote:
On Sun, Jun 21, 2009 at 05:47:34PM +0000, corvid wrote:
Jorge wrote:
On Thu, Jun 04, 2009 at 06:11:43PM +0000, corvid wrote:
I was playing around in dw, and noticed that, whereas form widgets normally like to put much of their height into descent, when style sets the height, Textblock::calcWidgetSize() puts it all into ascent.
I checked firefox and saw that their form widgets ascend.
If we made everything ascend and just put font->descent into the descent, it would make life simpler. Or, nearly. I guess there is RELIEF_Y_THICKNESS, but I could almost ignore that...
Not knowing exactly about the details, I'd be very careful in changing ascents, descents and friends because the may interfere with correct handling of CSS.
If you're sure it's OK to do it, even considering the "details" (e.g. reliefs, spacings, paddings), then why not.
Our details when it comes to form controls don't seem to be exactly right to begin with, so I'm not making anything worse. Little patch:
diff -r 9a913c474271 dw/fltkui.cc --- a/dw/fltkui.cc Sun Jun 21 12:19:13 2009 -0400 +++ b/dw/fltkui.cc Sun Jun 21 17:22:14 2009 +0000 @@ -697,10 +697,10 @@ void FltkMultiLineTextResource::sizeRequ (int)::fltk::getwidth ("n", 1) * numCols + 2 * RELIEF_X_THICKNESS; requisition->ascent = - font->ascent + RELIEF_Y_THICKNESS; + RELIEF_Y_THICKNESS + font->ascent + + (font->ascent + font->descent) * (numRows - 1); requisition->descent = font->descent + - (font->ascent + font->descent) * (numRows - 1) + RELIEF_Y_THICKNESS; } else { requisition->width = 1; @@ -1310,9 +1310,9 @@ void FltkListResource::sizeRequest (core * options, at the cost of showing too much whitespace at times. */ requisition->width = getMaxStringWidth() + 24; - requisition->ascent = font->ascent + 2; - requisition->descent = font->descent + 3 + - (rows - 1) * (font->ascent + font->descent + 1); + requisition->ascent = font->ascent + 2 + + (rows - 1) * (font->ascent + font->descent + 1); + requisition->descent = font->descent + 3; } else { requisition->width = 1; requisition->ascent = 1;
+1 from me. I can't see why this was handled different before.
OK, please commit. -- Cheers Jorge.-