Merge branch 'hotfix-1.5.6' into feature-listbox
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Window Layout Implementation
|
||||
* 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
|
||||
@@ -386,6 +386,13 @@ namespace nana
|
||||
nana::rectangle r_of_sigwd(sigwd->pos_root, sigwd->dimension);
|
||||
for (auto wd : data_sect.effects_bground_windows)
|
||||
{
|
||||
//Don't notify the window if both native root windows are not same(e.g. wd and sigwd have
|
||||
//a some parent). Otherwise, _m_paint_glass_window() recursively paints sigwd to make stack overflow.
|
||||
//On the other hand, a nested root window is always floating on its parent's child widgets, it's unnecessary to
|
||||
//notify the wd if they haven't a same native root window.
|
||||
if (sigwd->root != wd->root)
|
||||
continue;
|
||||
|
||||
if (wd == sigwd || !wd->displayed() ||
|
||||
(false == overlapped(nana::rectangle{ wd->pos_root, wd->dimension }, r_of_sigwd)))
|
||||
continue;
|
||||
|
||||
@@ -505,21 +505,18 @@ namespace nana
|
||||
|
||||
auto fpath = i->path().native();
|
||||
auto fattr = fs::status(fpath);
|
||||
auto ftype = static_cast<fs::file_type>(fattr.type());
|
||||
|
||||
item_fs m;
|
||||
m.name = name;
|
||||
m.directory = fs::is_directory(fattr);
|
||||
|
||||
switch(fattr.type())
|
||||
{
|
||||
case fs::file_type::not_found:
|
||||
case fs::file_type::unknown:
|
||||
case fs::file_type::directory:
|
||||
if (ftype == fs::file_type::not_found ||
|
||||
ftype == fs::file_type::unknown ||
|
||||
ftype == fs::file_type::directory)
|
||||
m.bytes = 0;
|
||||
break;
|
||||
default:
|
||||
else
|
||||
m.bytes = fs::file_size(fpath);
|
||||
}
|
||||
|
||||
fs_ext::modified_file_time(fpath, m.modified_time);
|
||||
|
||||
@@ -692,13 +689,12 @@ namespace nana
|
||||
return;
|
||||
}
|
||||
|
||||
using file_type = fs::file_type;
|
||||
|
||||
fs::path fspath(fb_.addr_.filesystem + path);
|
||||
|
||||
auto fst = fs::status(fspath);
|
||||
auto fattr = fs::status(fspath);
|
||||
auto ftype = static_cast<fs::file_type>(fattr.type());
|
||||
|
||||
if(fst.type() != file_type::not_found && fst.type() != file_type::none)
|
||||
if(ftype != fs::file_type::not_found && ftype != fs::file_type::none)
|
||||
{
|
||||
mb<<i18n("NANA_FILEBOX_ERROR_RENAME_FOLDER_BECAUSE_OF_EXISTING");
|
||||
mb();
|
||||
@@ -800,6 +796,7 @@ namespace nana
|
||||
tar = addr_.filesystem + file;
|
||||
|
||||
auto fattr = fs::status(tar);
|
||||
auto ftype = static_cast<fs::file_type>(fattr.type());
|
||||
|
||||
//Check if the selected name is a directory
|
||||
auto is_dir = fs::is_directory(fattr);
|
||||
@@ -808,6 +805,7 @@ namespace nana
|
||||
{
|
||||
//Add the extension, then check if it is a directory again.
|
||||
fattr = fs::status(tar);
|
||||
ftype = static_cast<fs::file_type>(fattr.type());
|
||||
is_dir = fs::is_directory(fattr);
|
||||
}
|
||||
|
||||
@@ -820,7 +818,7 @@ namespace nana
|
||||
|
||||
if(io_read_)
|
||||
{
|
||||
if(fs::file_type::not_found == fattr.type())
|
||||
if(fs::file_type::not_found == ftype)
|
||||
{
|
||||
msgbox mb(*this, caption());
|
||||
mb.icon(msgbox::icon_information);
|
||||
@@ -832,7 +830,7 @@ namespace nana
|
||||
}
|
||||
else
|
||||
{
|
||||
if(fs::file_type::not_found != fattr.type())
|
||||
if(fs::file_type::not_found != ftype)
|
||||
{
|
||||
msgbox mb(*this, caption(), msgbox::yes_no);
|
||||
mb.icon(msgbox::icon_question);
|
||||
|
||||
@@ -4735,12 +4735,12 @@ namespace nana
|
||||
|
||||
bool item_proxy::operator==(const std::string& s) const
|
||||
{
|
||||
return (text(pos_.item) == s);
|
||||
return (text(0) == s);
|
||||
}
|
||||
|
||||
bool item_proxy::operator==(const std::wstring& s) const
|
||||
{
|
||||
return (text(pos_.item) == to_utf8(s));
|
||||
return (text(0) == to_utf8(s));
|
||||
}
|
||||
|
||||
item_proxy & item_proxy::operator=(const item_proxy& rhs)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* A Progress Indicator Implementation
|
||||
* 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
|
||||
@@ -96,7 +96,11 @@ namespace nana
|
||||
{
|
||||
if (widget_)
|
||||
{
|
||||
auto value_px = (widget_->size().width - border_px * 2) * value_ / max_;
|
||||
auto value_px = (widget_->size().width - border_px * 2);
|
||||
|
||||
//avoid overflow
|
||||
if (value_ < max_)
|
||||
value_px = static_cast<unsigned>(value_px * (double(value_) / double(max_)));
|
||||
|
||||
if (value_px != value_px_)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,12 @@
|
||||
#include <nana/gui/detail/bedrock.hpp>
|
||||
#include <nana/std_thread.hpp>
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
|
||||
#ifdef STD_THREAD_NOT_SUPPORTED
|
||||
# include <boost/chrono.hpp>
|
||||
#else
|
||||
# include <chrono>
|
||||
#endif
|
||||
|
||||
//#define NANA_AUTOMATIC_GUI_TESTING
|
||||
namespace nana
|
||||
|
||||
Reference in New Issue
Block a user