From 35dadaeab63d634e9aa70aa9fa625277016eb93c Mon Sep 17 00:00:00 2001 From: Zaha Mihai <1395028+mihaizh@users.noreply.github.com> Date: Sun, 15 Sep 2019 23:32:58 +0300 Subject: [PATCH] Fix tabbar drawing not updated when tab is erased When a tab is deleted using `tabbar::erase`, `trigger::erase` is called. This function does not call `API::refresh_window` if the tab was erased successfully (unlike `trigger::tab_color`, `trigger::tab_image`, etc.), thus the tab is still visible until an interaction is made (like mouse click on `tabbar`). --- source/gui/widgets/tabbar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/gui/widgets/tabbar.cpp b/source/gui/widgets/tabbar.cpp index 6a79c648..94ed54eb 100644 --- a/source/gui/widgets/tabbar.cpp +++ b/source/gui/widgets/tabbar.cpp @@ -1229,7 +1229,8 @@ namespace nana void trigger::erase(std::size_t pos) { - layouter_->erase(pos); + if (layouter_->erase(pos)) + API::refresh_window(layouter_->widget_handle()); } void trigger::tab_color(std::size_t i, bool is_bgcolor, const ::nana::color& clr)