From 90d77372540d6747921f3d1b6c2e0eed465f4069 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 7 Nov 2023 14:09:36 +0100 Subject: Fix buttons overlapping icon in message box (#826) --- src/Fl_Message.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Fl_Message.cxx') 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; -- cgit v1.2.3