refactor the class screen

This commit is contained in:
Jinhao
2015-03-22 11:19:27 +08:00
parent 2ca3573049
commit e4382239e5
6 changed files with 124 additions and 102 deletions

View File

@@ -8,6 +8,8 @@
* http://www.boost.org/LICENSE_1_0.txt)
*
* @file: source/gui/widgets/label.cpp
* @author: Jinhao
* @contributors: qPCR4vir
*/
#include <nana/gui/widgets/label.hpp>
@@ -771,21 +773,21 @@ namespace nana
label::label(window wd, const nana::string& text, bool visible)
{
create(wd, rectangle(), visible);
bgcolor(API::bgcolor(wd));
bgcolor(API::bgcolor(wd));
caption(text);
}
label::label(window wd, const nana::char_t* text, bool visible)
{
create(wd, rectangle(), visible);
bgcolor(API::bgcolor(wd));
bgcolor(API::bgcolor(wd));
caption(text);
}
label::label(window wd, const rectangle& r, bool visible)
{
create(wd, r, visible);
bgcolor(API::bgcolor(wd));
bgcolor(API::bgcolor(wd));
}
label& label::transparent(bool enabled)

View File

@@ -659,7 +659,7 @@ namespace nana
API::calc_screen_point(*widget_, pos);
//get the screen coordinates of the widget pos.
auto scr_area = screen::from_point(detail_.monitor_pos)->area();
auto scr_area = screen().from_point(detail_.monitor_pos).workarea();
if(pos.x + size.width > scr_area.x + scr_area.width)
pos.x = static_cast<int>(scr_area.x + scr_area.width - size.width);