From fc3478b22048b1f548f410b9b6ef78c6bff33986 Mon Sep 17 00:00:00 2001 From: besh81 Date: Thu, 6 Dec 2018 09:03:51 +0100 Subject: [PATCH] updated button.icon Now passing an empty image to button.icon() the previous image is erased from button --- source/gui/widgets/button.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/gui/widgets/button.cpp b/source/gui/widgets/button.cpp index d407f0eb..eae1923e 100644 --- a/source/gui/widgets/button.cpp +++ b/source/gui/widgets/button.cpp @@ -379,7 +379,15 @@ namespace nana{ namespace drawerbase void trigger::icon(const nana::paint::image& img) { - if(img.empty()) return; + if(img.empty()) + { + if(attr_.icon) + { + delete attr_.icon; + attr_.icon = 0; + } + return; + } if(nullptr == attr_.icon) attr_.icon = new paint::image;