remove conversion constructors of point,size and rectangle

This commit is contained in:
Jinhao
2016-05-22 02:48:00 +08:00
parent ceff7c0c27
commit 9947d0c511
10 changed files with 147 additions and 176 deletions

View File

@@ -89,7 +89,7 @@ namespace nana
if(ui_el_.what == ui_el_.item_root)
{
_m_item_bground(graph, r.x + 1, r.y, r.width - 2, r.height, (state == mouse_action::pressed ? mouse_action::pressed : mouse_action::over));
_m_item_bground(graph, r.x + 1, r.y, r.width - 2, r.height, (state == mouse_action::pressed ? mouse_action::pressed : mouse_action::hovered));
graph.rectangle(r, false, static_cast<color_rgb>(0x3C7FB1));
if(state == mouse_action::pressed)
{
@@ -114,8 +114,8 @@ namespace nana
mouse_action state_arrow, state_name;
if(mouse_action::pressed != state)
{
state_arrow = (ui_el_.what == ui_el_.item_arrow ? mouse_action::over : mouse_action::normal);
state_name = (ui_el_.what == ui_el_.item_name ? mouse_action::over : mouse_action::normal);
state_arrow = (ui_el_.what == ui_el_.item_arrow ? mouse_action::hovered : mouse_action::normal);
state_name = (ui_el_.what == ui_el_.item_name ? mouse_action::hovered : mouse_action::normal);
}
else
{
@@ -170,7 +170,7 @@ namespace nana
nana::color clr_top(static_cast<color_rgb>(0xEAEAEA)), clr_bottom(static_cast<color_rgb>(0xDCDCDC));
switch(state)
{
case mouse_action::over:
case mouse_action::hovered:
clr_top.from_rgb(0xdf, 0xf2, 0xfc);
clr_bottom.from_rgb(0xa9, 0xda, 0xf5);
break;

View File

@@ -1270,7 +1270,7 @@ namespace nana
if(size.width > attr.area.width || size.height > attr.area.height)
{
nana::size fit_size;
nana::fit_zoom(size, attr.area, fit_size);
nana::fit_zoom(size, attr.area.dimension(), fit_size);
attr.area.x += (attr.area.width - fit_size.width) / 2;
attr.area.y += (attr.area.height - fit_size.height) / 2;
@@ -1442,8 +1442,9 @@ namespace nana
virtual bool comp_attribute(component_t comp, comp_attribute_t& attr) const override
{
attr.area = node_r_;
if(impl_->data.comp_placer->locate(comp, node_attr_, &attr.area))
if (impl_->data.comp_placer->locate(comp, node_attr_, &attr.area))
{
attr.mouse_pointed = node_attr_.mouse_pointed;
attr.area.x += pos_.x;
attr.area.y += pos_.y;
return true;