Merge branch 'hotfix-1.1.3' into feature-docker-place

This commit is contained in:
Jinhao
2015-09-14 01:53:07 +08:00
8 changed files with 56 additions and 6 deletions

View File

@@ -302,6 +302,16 @@ namespace detail
#endif
}
unsigned drawable_impl_type::get_color() const
{
return color_;
}
unsigned drawable_impl_type::get_text_color() const
{
return text_color_;
}
void drawable_impl_type::set_color(const ::nana::color& clr)
{
color_ = (clr.px_color().value & 0xFFFFFF);

View File

@@ -63,6 +63,11 @@ namespace detail
return color_;
}
unsigned drawable_impl_type::get_text_color() const
{
return text_color_;
}
void drawable_impl_type::set_color(const ::nana::color& clr)
{
color_ = (clr.px_color().value & 0xFFFFFF);

View File

@@ -874,6 +874,27 @@ namespace paint
handle_->set_text_color(col);
}
::nana::color graphics::palette(bool for_text) const
{
if (handle_)
return static_cast<color_rgb>(for_text ? handle_->get_text_color() : handle_->get_color());
return{};
}
graphics& graphics::palette(bool for_text, const ::nana::color& clr)
{
if (handle_)
{
if (for_text)
handle_->set_text_color(clr);
else
handle_->set_color(clr);
}
return *this;
}
unsigned graphics::bidi_string(const nana::point& pos, const char_t * str, std::size_t len)
{
auto moved_pos = pos;

View File

@@ -118,11 +118,12 @@ namespace nana
{
graphics & graph;
int x, endpos;
::nana::color fgcolor;
//::nana::color fgcolor; //deprecated
unsigned omitted_pixels;
nana::unicode_bidi bidi;
std::vector<nana::unicode_bidi::entity> reordered;
/* //deprecated
draw_string_omitted(graphics& graph, int x, int endpos, const ::nana::color& fgcolor, bool omitted)
: graph(graph), x(x), endpos(endpos), fgcolor(fgcolor)
{
@@ -132,6 +133,7 @@ namespace nana
else
this->endpos = x;
}
*/
draw_string_omitted(graphics& graph, int x, int endpos, bool omitted)
: graph(graph), x(x), endpos(endpos)
@@ -169,7 +171,8 @@ namespace nana
nana::paint::graphics dum_graph({ r.width, r.height });
dum_graph.bitblt(r, graph, pos);
dum_graph.set_text_color(fgcolor);
//dum_graph.set_text_color(fgcolor); //deprecated
dum_graph.set_text_color(graph.palette(true));
dum_graph.string({}, i.begin, len);
r.x = pos.x;