fix resize and spliter issues of dockable window
This commit is contained in:
parent
41f7545822
commit
f715fb613e
@ -1920,7 +1920,13 @@ namespace nana
|
||||
for (auto & child : children)
|
||||
{
|
||||
if (!child->display)
|
||||
{
|
||||
auto child_dv = dynamic_cast<div_dockpane*>(child.get());
|
||||
if (child_dv)
|
||||
child_dv->splitter.reset();
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
auto child_dv = dynamic_cast<div_dockpane*>(child.get());
|
||||
const bool is_vert = _m_is_vert(child->dir);
|
||||
@ -1949,6 +1955,8 @@ namespace nana
|
||||
else
|
||||
split = dynamic_cast<splitter*>(child_dv->splitter.get());
|
||||
}
|
||||
else
|
||||
child_dv->splitter.reset();
|
||||
|
||||
::nana::rectangle child_r;
|
||||
double split_range_begin = -1, split_range_end;
|
||||
|
@ -171,20 +171,6 @@ namespace nana
|
||||
}
|
||||
};
|
||||
|
||||
class dock_page
|
||||
: public form
|
||||
{
|
||||
public:
|
||||
dock_page(window host, const rectangle& r, const rectangle & tab_r)
|
||||
: form(host, r, form::appear::bald<>())
|
||||
{
|
||||
tab_form_.reset(new form(handle(), tab_r, form::appear::bald<>()));
|
||||
|
||||
}
|
||||
private:
|
||||
std::unique_ptr<form> tab_form_;
|
||||
};
|
||||
|
||||
class dockarea
|
||||
: public widget_object <category::lite_widget_tag, drawer_trigger>
|
||||
{
|
||||
@ -362,16 +348,23 @@ namespace nana
|
||||
API::capture_window(caption_, false);
|
||||
|
||||
rectangle r{ pos() + move_pos, size() };
|
||||
container_.reset(new form(host_window_, r.pare_off(-1), form::appear::bald<>()));
|
||||
container_.reset(new form(host_window_, r.pare_off(-1), form::appear::bald<form::appear::sizable>()));
|
||||
drawing dw(container_->handle());
|
||||
dw.draw([](paint::graphics& graph)
|
||||
{
|
||||
graph.rectangle(false, colors::coral);
|
||||
});
|
||||
|
||||
|
||||
|
||||
API::set_parent_window(handle(), container_->handle());
|
||||
this->move({ 1, 1 });
|
||||
|
||||
container_->events().resized([this](const arg_resized& arg)
|
||||
{
|
||||
this->size({arg.width - 2, arg.height - 2});
|
||||
});
|
||||
|
||||
container_->show();
|
||||
API::capture_window(caption_, true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user