Merge branch 'hotfix-1.6.1' into develop

This commit is contained in:
qPCR4vir 2018-07-13 21:45:27 +02:00
commit 78fca545ae
7 changed files with 41 additions and 13 deletions

View File

@ -1,7 +1,7 @@
/*
* A Message Box Class
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@ -255,7 +255,11 @@ namespace nana
bool show_modal(Args&& ... args)
{
std::vector<abstract_content*> contents;
#ifdef __cpp_fold_expressions
(contents.emplace_back(&args), ...);
#else
_m_fetch_args(contents, std::forward<Args>(args)...);
#endif
if (contents.empty())
return false;

View File

@ -1,7 +1,7 @@
/*
* An Implementation of i18n
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -950,6 +950,19 @@ namespace detail
if (wd->dimension == sz)
return false;
std::vector<core_window_t*> presence;
if (wd->dimension.width < sz.width || wd->dimension.height < sz.height)
{
auto wd_r = rectangle{ wd->dimension };
for (auto child : wd->children)
{
auto child_r = rectangle{ child->pos_owner, child->dimension };
if (!overlapped(wd_r, child_r))
presence.push_back(child);
}
}
//Before resiz the window, creates the new graphics
paint::graphics graph;
paint::graphics root_graph;
@ -1010,6 +1023,11 @@ namespace detail
}
}
for (auto child : presence)
{
refresh_tree(child);
}
arg_resized arg;
arg.window_handle = reinterpret_cast<window>(wd);
arg.width = sz.width;

View File

@ -1,7 +1,7 @@
/*
* A Message Box Class
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@ -1294,7 +1294,7 @@ namespace nana
min_width_entry_field_pixels_ = pixels;
}
#ifndef _nana_cxx_folding_expression
#ifndef __cpp_fold_expressions
void inputbox::_m_fetch_args(std::vector<abstract_content*>&)
{}
#endif

View File

@ -264,15 +264,22 @@ namespace nana{
drawing dw(*this);
//When the group is resized, the drawing is called before moving the caption, but
//the drawing of group requires the lastest position of caption for gradual rectangle.
//For the requirement, a move event handler is required for listning the change of caption's position.
impl_->caption.events().move([this](const arg_move& arg){
if (align::left != impl_->caption_align)
API::refresh_window(*this);
});
// This drawing function is owner by the onwer of dw (the outer panel of the group widget), not by dw !!
dw.draw([this](paint::graphics& graph)
{
auto gap_px = impl_->gap - 1;
graph.rectangle(true, API::bgcolor(this->parent()));
auto const top_round_line = static_cast<int>(impl_->caption_dimension.height) / 2;
graph.rectangle(true, API::bgcolor(this->parent()));
graph.round_rectangle(rectangle(point(gap_px, top_round_line),
nana::size(graph.width() - 2 * gap_px, graph.height() - top_round_line - gap_px)
),
@ -281,11 +288,10 @@ namespace nana{
auto opt_r = API::window_rectangle(impl_->caption);
if (opt_r)
{
rectangle grad_r{ opt_r->position(), nana::size{ opt_r->width, static_cast<unsigned>(top_round_line - opt_r->y) } };
rectangle grad_r{ opt_r->position(), nana::size{ opt_r->width + 4, static_cast<unsigned>(top_round_line - opt_r->y) } };
grad_r.y += top_round_line*2 / 3;
grad_r.x -= 2;
grad_r.width += 4;
graph.gradual_rectangle(grad_r,
API::bgcolor(this->parent()), this->bgcolor(), true

View File

@ -2996,11 +2996,11 @@ namespace nana
}
else
{
auto last_off = this->distance(this->first(), this->last()) * ess_->item_height();
if (last_off - off >= screen_px)
auto const content_px = ess_->content_view->content_size().height;
if (content_px - off >= screen_px)
origin.y = static_cast<int>(off);
else if (last_off >= screen_px)
origin.y = static_cast<int>(last_off - screen_px);
else if (content_px >= screen_px)
origin.y = static_cast<int>(content_px - screen_px);
}
if (ess_->content_view->move_origin(origin - ess_->content_view->origin()))

View File

@ -417,7 +417,7 @@ namespace nana
}
}
#ifndef _nana_cxx_folding_expression
#ifndef __cpp_fold_expressions
void internationalization::_m_fetch_args(std::vector<std::string>&)
{}
#endif