From b6dd03e2d5c1944ab4f90d6c4ffe611570145684 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Wed, 23 Sep 2015 23:59:31 +0800 Subject: [PATCH] some small place fixes --- source/gui/place.cpp | 3 +++ source/gui/place_parts.hpp | 41 +++++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/source/gui/place.cpp b/source/gui/place.cpp index 39a72f60..8654f3aa 100644 --- a/source/gui/place.cpp +++ b/source/gui/place.cpp @@ -1737,6 +1737,9 @@ namespace nana decltype(dockable_field->dockarea) del(ptr); }); + this->set_display(false); + impl_ptr_->collocate(); + API::close_window(window_handle); } private: diff --git a/source/gui/place_parts.hpp b/source/gui/place_parts.hpp index 686fc4c3..946d03ac 100644 --- a/source/gui/place_parts.hpp +++ b/source/gui/place_parts.hpp @@ -301,30 +301,35 @@ namespace nana else r.height = 0; - if (!tabbar_ && panels_.size() > 0) + if (!tabbar_) { - tabbar_.reset(new tabbar_lite(*this)); - - tabbar_->events().selected.clear(); - tabbar_->events().selected([this] + if (panels_.size() > 0) { - auto handle = tabbar_->attach(tabbar_->selected()); - if (handle) - caption_.caption(API::window_caption(handle)); - else - caption_.caption(::nana::string()); - }); + tabbar_.reset(new tabbar_lite(*this)); - tabbar_->move({ 0, r.bottom() - 20, r.width, 20 }); - r.height -= 20; + tabbar_->events().selected.clear(); + tabbar_->events().selected([this] + { + auto handle = tabbar_->attach(tabbar_->selected()); + if (handle) + caption_.caption(API::window_caption(handle)); + else + caption_.caption(::nana::string()); + }); - std::size_t pos = 0; - for (auto & pn : panels_) - { - tabbar_->push_back(::nana::charset(pn.widget_ptr->caption())); - tabbar_->attach(pos++, *pn.widget_ptr); + tabbar_->move({ 0, r.bottom() - 20, r.width, 20 }); + r.height -= 20; + + std::size_t pos = 0; + for (auto & pn : panels_) + { + tabbar_->push_back(::nana::charset(pn.widget_ptr->caption())); + tabbar_->attach(pos++, *pn.widget_ptr); + } } } + else + r.height -= 20; auto wdg = fn(*this);