summaryrefslogtreecommitdiff
path: root/dw/fltkui.cc
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-07-21 01:29:53 +0000
committercorvid <corvid@lavabit.com>2011-07-21 01:29:53 +0000
commit5dc9e10627a82d0b72ed1735f802364d9d2d9315 (patch)
treef7d7361842e8cdf994d7eacfc25dab24f9646569 /dw/fltkui.cc
parentbef04134059ea4dea274294eb2484ddd24dc4872 (diff)
work around a fl_width() bug
Pretty easy workaround, yes? :)
Diffstat (limited to 'dw/fltkui.cc')
-rw-r--r--dw/fltkui.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/dw/fltkui.cc b/dw/fltkui.cc
index 5405d92e..788df084 100644
--- a/dw/fltkui.cc
+++ b/dw/fltkui.cc
@@ -539,8 +539,10 @@ void FltkEntryResource::sizeRequest (core::Requisition *requisition)
if (displayed() && style) {
FltkFont *font = (FltkFont*)style->font;
fl_font(font->font,font->size);
+ /* WORKAROUND: fl_width(uint_t) is not working on non-xft X.
+ * Reported to FLTK as STR #2688 */
requisition->width =
- (int)fl_width ('n')
+ (int)fl_width ("n")
* (maxLength == UNLIMITED_MAX_LENGTH ? 10 : maxLength)
+ label_w + (2 * RELIEF_X_THICKNESS);
requisition->ascent = font->ascent + RELIEF_Y_THICKNESS;
@@ -657,8 +659,10 @@ void FltkMultiLineTextResource::sizeRequest (core::Requisition *requisition)
if (style) {
FltkFont *font = (FltkFont*)style->font;
fl_font(font->font,font->size);
+ /* WORKAROUND: fl_width(uint_t) is not working on non-xft X.
+ * Reported to FLTK as STR #2688 */
requisition->width =
- (int)fl_width ('n') * numCols + 2 * RELIEF_X_THICKNESS;
+ (int)fl_width ("n") * numCols + 2 * RELIEF_X_THICKNESS;
requisition->ascent =
RELIEF_Y_THICKNESS + font->ascent +
(font->ascent + font->descent) * (numRows - 1);