refactor the class screen
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user