Merge branch 'develop' of https://github.com/beru/nana into beru-develop
Conflicts: source/gui/widgets/skeletons/text_editor.cpp source/gui/widgets/textbox.cpp source/paint/detail/image_bmp.hpp source/paint/detail/image_ico.hpp
This commit is contained in:
@@ -537,6 +537,30 @@ namespace nana{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool native_interface::window_icon(native_window_type wd, const paint::image& big_icon, const paint::image& small_icon)
|
||||
{
|
||||
#if defined(NANA_WINDOWS)
|
||||
HICON h_big_icon = paint::image_accessor::icon(big_icon);
|
||||
HICON h_small_icon = paint::image_accessor::icon(small_icon);
|
||||
if (h_big_icon || h_small_icon)
|
||||
{
|
||||
nana::detail::platform_spec::instance().keep_window_icon(wd, (!big_icon.empty() ? big_icon : small_icon));
|
||||
if (h_big_icon) {
|
||||
::SendMessage(reinterpret_cast<HWND>(wd), WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(h_big_icon));
|
||||
}
|
||||
if (h_small_icon) {
|
||||
::SendMessage(reinterpret_cast<HWND>(wd), WM_SETICON, ICON_SMALL, reinterpret_cast<WPARAM>(h_small_icon));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#elif defined(NANA_X11)
|
||||
return window_icon(wd, big_icon);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void native_interface::activate_owner(native_window_type wd)
|
||||
{
|
||||
#if defined(NANA_WINDOWS)
|
||||
|
||||
@@ -1413,6 +1413,7 @@ 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);
|
||||
|
||||
@@ -42,7 +42,8 @@ namespace detail
|
||||
{
|
||||
root_register misc_register;
|
||||
handle_manager<core_window_t*, window_manager, window_handle_deleter> wd_register;
|
||||
paint::image default_icon;
|
||||
paint::image default_icon_big;
|
||||
paint::image default_icon_small;
|
||||
};
|
||||
//end struct wdm_private_impl
|
||||
|
||||
@@ -182,11 +183,6 @@ namespace detail
|
||||
}
|
||||
}
|
||||
|
||||
void window_manager::default_icon(const paint::image& img)
|
||||
{
|
||||
impl_->default_icon = img;
|
||||
}
|
||||
|
||||
bool window_manager::available(core_window_t* wd)
|
||||
{
|
||||
return impl_->wd_register.available(wd);
|
||||
@@ -218,7 +214,7 @@ namespace detail
|
||||
if (impl_->wd_register.available(owner))
|
||||
{
|
||||
native = (owner->other.category == category::frame_tag::value ?
|
||||
owner->other.attribute.frame->container : owner->root_widget->root);
|
||||
owner->other.attribute.frame->container : owner->root_widget->root);
|
||||
r.x += owner->pos_root.x;
|
||||
r.y += owner->pos_root.y;
|
||||
}
|
||||
@@ -247,7 +243,7 @@ namespace detail
|
||||
insert_frame(owner, wd);
|
||||
|
||||
bedrock::inc_window(wd->thread_id);
|
||||
this->icon(wd, impl_->default_icon);
|
||||
this->icon(wd, impl_->default_icon_big, impl_->default_icon_small);
|
||||
return wd;
|
||||
}
|
||||
return nullptr;
|
||||
@@ -394,6 +390,18 @@ 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)
|
||||
{
|
||||
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())
|
||||
@@ -407,6 +415,19 @@ namespace detail
|
||||
}
|
||||
}
|
||||
|
||||
void window_manager::icon(core_window_t* wd, const paint::image& big_icon, const paint::image& small_icon)
|
||||
{
|
||||
if(!big_icon.empty() || !small_icon.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, big_icon, small_icon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//show
|
||||
//@brief: show or hide a window
|
||||
bool window_manager::show(core_window_t* wd, bool visible)
|
||||
|
||||
Reference in New Issue
Block a user