fix place 2 issues
calc dockable field size with wrong size for the percentage weight crash when access a non-existing dockable field
This commit is contained in:
parent
1326bae10f
commit
65f5d5f494
@ -1939,7 +1939,7 @@ namespace nana
|
|||||||
double weight;
|
double weight;
|
||||||
if (child->weight.is_not_none())
|
if (child->weight.is_not_none())
|
||||||
{
|
{
|
||||||
weight = child->weight.get_value(is_vert ? area.height : area.width);
|
weight = child->weight.get_value(is_vert ? room.height : room.width);
|
||||||
if (weight > room_px)
|
if (weight > room_px)
|
||||||
weight = room_px;
|
weight = room_px;
|
||||||
}
|
}
|
||||||
@ -2800,7 +2800,7 @@ namespace nana
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Create the pane if it has not a name
|
//Create the pane if it has not a name
|
||||||
if (factory_name.empty())
|
if (factory_name.empty() && dock_ptr->attached)
|
||||||
{
|
{
|
||||||
dock_ptr->attached->set_display(true);
|
dock_ptr->attached->set_display(true);
|
||||||
impl_->collocate();
|
impl_->collocate();
|
||||||
@ -2825,18 +2825,21 @@ namespace nana
|
|||||||
throw std::invalid_argument("invalid factory name(" + factory + ") of dockpane");
|
throw std::invalid_argument("invalid factory name(" + factory + ") of dockpane");
|
||||||
|
|
||||||
auto dock_ptr = i->second;
|
auto dock_ptr = i->second;
|
||||||
dock_ptr->attached->set_display(true);
|
if (dock_ptr->attached)
|
||||||
impl_->collocate();
|
|
||||||
|
|
||||||
if (!dock_ptr->dockarea)
|
|
||||||
{
|
{
|
||||||
dock_ptr->dockarea.reset(new ::nana::place_parts::dockarea);
|
dock_ptr->attached->set_display(true);
|
||||||
dock_ptr->dockarea->create(impl_->window_handle);
|
impl_->collocate();
|
||||||
dock_ptr->dockarea->set_notifier(dock_ptr->attached);
|
|
||||||
dock_ptr->dockarea->move(dock_ptr->attached->field_area);
|
|
||||||
}
|
|
||||||
|
|
||||||
dock_ptr->dockarea->add_pane(i->second->factories[factory]);
|
if (!dock_ptr->dockarea)
|
||||||
|
{
|
||||||
|
dock_ptr->dockarea.reset(new ::nana::place_parts::dockarea);
|
||||||
|
dock_ptr->dockarea->create(impl_->window_handle);
|
||||||
|
dock_ptr->dockarea->set_notifier(dock_ptr->attached);
|
||||||
|
dock_ptr->dockarea->move(dock_ptr->attached->field_area);
|
||||||
|
}
|
||||||
|
|
||||||
|
dock_ptr->dockarea->add_pane(i->second->factories[factory]);
|
||||||
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user