merge beru's changes

This commit is contained in:
Jinhao
2015-08-02 03:33:43 +08:00
parent 66c1e1ad98
commit e0ee42d184
18 changed files with 59 additions and 86 deletions

View File

@@ -509,20 +509,25 @@ namespace nana{
#endif
}
bool native_interface::window_icon(native_window_type wd, const nana::paint::image& img)
bool native_interface::window_icon(native_window_type wd, const nana::paint::image& sml_icon, const ::nana::paint::image& big_icon)
{
#if defined(NANA_WINDOWS)
HICON ico = paint::image_accessor::icon(img);
if(ico)
HICON sml_handle = paint::image_accessor::icon(sml_icon);
HICON big_handle = paint::image_accessor::icon(big_icon);
if(sml_handle || big_handle)
{
nana::detail::platform_spec::instance().keep_window_icon(wd, img);
::SendMessage(reinterpret_cast<HWND>(wd), WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(ico));
::SendMessage(reinterpret_cast<HWND>(wd), WM_SETICON, ICON_SMALL, reinterpret_cast<WPARAM>(ico));
nana::detail::platform_spec::instance().keep_window_icon(wd, sml_icon, big_icon);
if (sml_handle)
::SendMessage(reinterpret_cast<HWND>(wd), WM_SETICON, ICON_SMALL, reinterpret_cast<WPARAM>(sml_handle));
if (big_handle)
::SendMessage(reinterpret_cast<HWND>(wd), WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(big_handle));
return true;
}
#elif defined(NANA_X11)
if(wd && (false == img.empty()))
if(wd && (!sml_icon.empty() || !big_icon.empty()))
{
auto & img = (sml_icon.empty() ? big_icon : sml_icon);
const nana::paint::graphics & graph = restrict::spec.keep_window_icon(wd, img);
XWMHints hints;
@@ -537,7 +542,8 @@ namespace nana{
return false;
}
bool native_interface::window_icon(native_window_type wd, const paint::image& big_icon, const paint::image& small_icon)
/*
bool native_interface::window_icon(native_window_type wd, const paint::image& big_icon, const paint::image& small_icon) //deprecated
{
#if defined(NANA_WINDOWS)
HICON h_big_icon = paint::image_accessor::icon(big_icon);
@@ -558,6 +564,7 @@ namespace nana{
#endif
return false;
}
*/

View File

@@ -1413,7 +1413,6 @@ namespace detail
auto tstop_wd = brock.wd_manager.tabstop(msgwnd, is_forward);
if (tstop_wd)
{
root_runtime->condition.tabstop_focus_changed = true;
brock.wd_manager.set_focus(tstop_wd, false);
brock.wd_manager.do_lazy_refresh(msgwnd, false);
brock.wd_manager.do_lazy_refresh(tstop_wd, true);

View File

@@ -243,7 +243,7 @@ namespace detail
insert_frame(owner, wd);
bedrock::inc_window(wd->thread_id);
this->icon(wd, impl_->default_icon_big, impl_->default_icon_small);
this->icon(wd, impl_->default_icon_small, impl_->default_icon_big);
return wd;
}
return nullptr;
@@ -390,32 +390,13 @@ namespace detail
}
}
void window_manager::default_icon(const paint::image& img)
{
impl_->default_icon_big = img;
impl_->default_icon_small = img;
}
void window_manager::default_icon(const nana::paint::image& big, const nana::paint::image& small)
void window_manager::default_icon(const nana::paint::image& small, const nana::paint::image& big)
{
impl_->default_icon_big = big;
impl_->default_icon_small = small;
}
void window_manager::icon(core_window_t* wd, const paint::image& img)
{
if(false == img.empty())
{
std::lock_guard<decltype(mutex_)> lock(mutex_);
if (impl_->wd_register.available(wd))
{
if(wd->other.category == category::root_tag::value)
native_interface::window_icon(wd->root, img);
}
}
}
void window_manager::icon(core_window_t* wd, const paint::image& big_icon, const paint::image& small_icon)
void window_manager::icon(core_window_t* wd, const paint::image& small_icon, const paint::image& big_icon)
{
if(!big_icon.empty() || !small_icon.empty())
{
@@ -423,7 +404,7 @@ namespace detail
if (impl_->wd_register.available(wd))
{
if(wd->other.category == category::root_tag::value)
native_interface::window_icon(wd->root, big_icon, small_icon);
native_interface::window_icon(wd->root, small_icon, big_icon);
}
}
}