summaryrefslogtreecommitdiff
path: root/src/Fl_Message.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-11-07 14:09:36 +0100
committerMatthias Melcher <github@matthiasm.com>2023-11-07 14:28:22 +0100
commit90d77372540d6747921f3d1b6c2e0eed465f4069 (patch)
tree12568e9748bd3815b6a74644b392fc91dfb8a190 /src/Fl_Message.cxx
parentd7768b76d042eaa6cdce97976e96315d0bceccb2 (diff)
Fix buttons overlapping icon in message box (#826)
Diffstat (limited to 'src/Fl_Message.cxx')
-rw-r--r--src/Fl_Message.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Fl_Message.cxx b/src/Fl_Message.cxx
index ee3f61cd3..a2d59fc9d 100644
--- a/src/Fl_Message.cxx
+++ b/src/Fl_Message.cxx
@@ -259,6 +259,14 @@ void Fl_Message::resizeform() {
if (w > max_w)
max_w = w;
+ // if the button horizontally overlap the icon, make sure that they are drawn
+ // below to icon by making the text part at least as tall as the icon.
+ if (w > message_w && text_height < icon_size) {
+ int pad_h = icon_size-text_height;
+ message_h += pad_h;
+ text_height += pad_h;
+ }
+
message_w = max_w - 10 - icon_size;
w = max_w + 20;