Merge branch 'hotfix-1.5.1' into develop
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Platform Specification Implementation
|
||||
* Nana C++ Library(http://www.nanapro.org)
|
||||
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
|
||||
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -144,7 +144,6 @@ namespace detail
|
||||
drawable_impl_type();
|
||||
~drawable_impl_type();
|
||||
|
||||
void fgcolor(const ::nana::color&); //deprecated
|
||||
unsigned get_color() const;
|
||||
unsigned get_text_color() const;
|
||||
void set_color(const ::nana::color&);
|
||||
|
||||
@@ -423,35 +423,6 @@ namespace detail
|
||||
}
|
||||
}
|
||||
|
||||
void drawable_impl_type::fgcolor(const ::nana::color& clr)
|
||||
{
|
||||
auto rgb = clr.px_color().value;
|
||||
|
||||
if (rgb != current_color_)
|
||||
{
|
||||
auto & spec = nana::detail::platform_spec::instance();
|
||||
platform_scope_guard psg;
|
||||
|
||||
current_color_ = rgb;
|
||||
switch(spec.screen_depth())
|
||||
{
|
||||
case 16:
|
||||
rgb = ((((rgb >> 16) & 0xFF) * 31 / 255) << 11) |
|
||||
((((rgb >> 8) & 0xFF) * 63 / 255) << 5) |
|
||||
(rgb & 0xFF) * 31 / 255;
|
||||
break;
|
||||
}
|
||||
::XSetForeground(spec.open_display(), context, rgb);
|
||||
::XSetBackground(spec.open_display(), context, rgb);
|
||||
#if defined(NANA_USE_XFT)
|
||||
xft_fgcolor.color.red = ((0xFF0000 & rgb) >> 16) * 0x101;
|
||||
xft_fgcolor.color.green = ((0xFF00 & rgb) >> 8) * 0x101;
|
||||
xft_fgcolor.color.blue = (0xFF & rgb) * 0x101;
|
||||
xft_fgcolor.color.alpha = 0xFFFF;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
platform_scope_guard::platform_scope_guard()
|
||||
{
|
||||
platform_spec::instance().lock_xlib();
|
||||
|
||||
@@ -221,11 +221,6 @@ namespace detail
|
||||
::DeleteObject(round_region.handle);
|
||||
}
|
||||
|
||||
void drawable_impl_type::fgcolor(const ::nana::color& clr)
|
||||
{
|
||||
set_text_color(clr);
|
||||
}
|
||||
|
||||
unsigned drawable_impl_type::get_color() const
|
||||
{
|
||||
return color_;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Platform Specification Implementation
|
||||
* Nana C++ Library(http://www.nanapro.org)
|
||||
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
|
||||
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -101,7 +101,6 @@ namespace detail
|
||||
drawable_impl_type();
|
||||
~drawable_impl_type();
|
||||
|
||||
void fgcolor(const ::nana::color&); //deprecated
|
||||
unsigned get_color() const;
|
||||
unsigned get_text_color() const;
|
||||
void set_color(const ::nana::color&);
|
||||
|
||||
@@ -441,7 +441,10 @@ namespace nana
|
||||
text = to_wstring(modifier_.prefix + range_->value() + modifier_.suffix);
|
||||
|
||||
if (editor_->text() != text)
|
||||
{
|
||||
editor_->text(text, false);
|
||||
editor_->try_refresh();
|
||||
}
|
||||
|
||||
_m_draw_spins(spin_stated_);
|
||||
}
|
||||
@@ -736,7 +739,8 @@ namespace nana
|
||||
if (editor)
|
||||
{
|
||||
editor->text(to_wstring(text), false);
|
||||
API::refresh_window(*this);
|
||||
if (editor->try_refresh())
|
||||
API::update_window(*this);
|
||||
}
|
||||
}
|
||||
}//end namespace nana
|
||||
|
||||
@@ -738,7 +738,9 @@ namespace drawerbase {
|
||||
if (editor)
|
||||
{
|
||||
editor->text(to_wstring(str), false);
|
||||
API::update_window(this->handle());
|
||||
|
||||
if (editor->try_refresh())
|
||||
API::update_window(this->handle());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1205,7 +1205,8 @@ namespace paint
|
||||
unsigned last_color = (int(r) << 16) | (int(g) << 8) | int(b);
|
||||
|
||||
Display * disp = nana::detail::platform_spec::instance().open_display();
|
||||
impl_->handle->fgcolor(static_cast<color_rgb>(last_color));
|
||||
impl_->handle->set_color(static_cast<color_rgb>(last_color));
|
||||
impl_->handle->update_color();
|
||||
const int endpos = deltapx + (vertical ? rct.y : rct.x);
|
||||
if (endpos > 0)
|
||||
{
|
||||
@@ -1220,7 +1221,8 @@ namespace paint
|
||||
if (new_color != last_color)
|
||||
{
|
||||
last_color = new_color;
|
||||
impl_->handle->fgcolor(static_cast<color_rgb>(last_color));
|
||||
impl_->handle->set_color(static_cast<color_rgb>(last_color));
|
||||
impl_->handle->update_color();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1235,7 +1237,8 @@ namespace paint
|
||||
if (new_color != last_color)
|
||||
{
|
||||
last_color = new_color;
|
||||
impl_->handle->fgcolor(static_cast<color_rgb>(last_color));
|
||||
impl_->handle->set_color(static_cast<color_rgb>(last_color));
|
||||
impl_->handle->update_color();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user