summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-08-27 15:13:32 +0200
committerMatthias Melcher <github@matthiasm.com>2024-08-27 15:13:32 +0200
commitec05f78d98d8e38ea34eb1bd73647fa5b8b35f81 (patch)
tree64768c2ff44f44200e3d9d8463924fc9450be973 /FL
parent5879e7fae7d34c037f2ac02c6c7fca86c42a186d (diff)
Adding horiizonatl and vertical label margin
- sizeof(Fl_Widget) not increased - label positions can be adjusted - try it out in test/label app - full support in FLUD
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Widget.H24
1 files changed, 24 insertions, 0 deletions
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index 7dc90069c..c9fe89bba 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -63,6 +63,10 @@ struct FL_EXPORT Fl_Label {
Fl_Align align_;
/** type of label. \see Fl_Labeltype */
uchar type;
+ /** Spacing between label and the horizontally aligned side of the widget. */
+ signed char h_margin_;
+ /** Spacing between label and the vertically aligned side of the widget. */
+ signed char v_margin_;
/** Spacing between an image and the label text */
uchar spacing;
@@ -698,6 +702,26 @@ public:
*/
int label_image_spacing() { return label_.spacing; }
+ /** Set the spacing between the label and the horizontal edge of the widget.
+ \param[in] px gap in pixels
+ */
+ void horizontal_label_margin(int px) { label_.h_margin_ = (signed char)px; }
+
+ /** Get the spacing between the label and the horizontal edge of the widget.
+ \return px gap in pixels
+ */
+ int horizontal_label_margin() { return label_.h_margin_; }
+
+ /** Set the spacing between the label and the vertical edge of the widget.
+ \param[in] px gap in pixels
+ */
+ void vertical_label_margin(int px) { label_.v_margin_ = (signed char)px; }
+
+ /** Get the spacing between the label and the vertical edge of the widget.
+ \return px gap in pixels
+ */
+ int vertical_label_margin() { return label_.v_margin_; }
+
/** Gets the current tooltip text.
\return a pointer to the tooltip text or NULL
\see tooltip(const char*), copy_tooltip(const char*)