summaryrefslogtreecommitdiff
path: root/src/fl_labeltype.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-08-14 01:45:20 +0200
committerMatthias Melcher <github@matthiasm.com>2024-08-14 01:52:37 +0200
commitcfc54a3b190dd7e85d6e2a313ab67d3ded4a4ab8 (patch)
treee3c619c02f391079bbf0fba72032e05ff1b25421 /src/fl_labeltype.cxx
parent325ac336c74e27037c3bfe0d8517be369f632aa9 (diff)
Adding Fl_Widget::label_image_spacing() (#1039)
- May need a better method name. - This makes the gap between the image in a label and the label text user settable. - Can be tested using test/label app
Diffstat (limited to 'src/fl_labeltype.cxx')
-rw-r--r--src/fl_labeltype.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fl_labeltype.cxx b/src/fl_labeltype.cxx
index 8698c277b..9f5c5f20e 100644
--- a/src/fl_labeltype.cxx
+++ b/src/fl_labeltype.cxx
@@ -32,7 +32,7 @@ fl_normal_label(const Fl_Label* o, int X, int Y, int W, int H, Fl_Align align)
{
fl_font(o->font, o->size);
fl_color((Fl_Color)o->color);
- fl_draw(o->value, X, Y, W, H, align, o->image);
+ fl_draw(o->value, X, Y, W, H, align, o->image, 1, o->spacing);
}
void
@@ -44,11 +44,11 @@ fl_normal_measure(const Fl_Label* o, int& W, int& H) {
if (o->align_ & FL_ALIGN_IMAGE_BACKDROP) { // backdrop: ignore
// ignore backdrop image for calculation
} else if (o->align_ & FL_ALIGN_IMAGE_NEXT_TO_TEXT) { // text and image side by side
- W += iw;
+ W += iw + o->spacing;
if (ih > H) H = ih;
} else {
if (iw > W) W = iw;
- H += ih;
+ H += ih + o->spacing;
}
}
}