diff --git a/source/gui/place_parts.hpp b/source/gui/place_parts.hpp index 85ef8dfe..8570c6b0 100644 --- a/source/gui/place_parts.hpp +++ b/source/gui/place_parts.hpp @@ -146,7 +146,8 @@ namespace nana //draw caption auto text = to_wstring(API::window_caption(window_handle_)); - text_rd_->render({ 3, 1 }, text.data(), text.size(), graph.size().width - 20, paint::text_renderer::mode::truncate_with_ellipsis); + if((graph.size().width > 20) && (graph.size().width - 20 > 10)) + text_rd_->render({ 3, 1 }, text.data(), text.size(), graph.size().width - 20, paint::text_renderer::mode::truncate_with_ellipsis); //draw x button auto r = _m_button_area(); diff --git a/source/gui/widgets/toolbar.cpp b/source/gui/widgets/toolbar.cpp index f8db43c4..7d1d18f4 100644 --- a/source/gui/widgets/toolbar.cpp +++ b/source/gui/widgets/toolbar.cpp @@ -104,6 +104,7 @@ namespace nana delete ptr; cont_.clear(); + right_ = npos; } @@ -683,6 +684,7 @@ namespace nana if(m && (m->textout != show)) { m->textout = show; + m->pixels = 0; //force width calculation API::refresh_window(this->handle()); } }