Merge remote-tracking branch 'cnjinhao/develop' into develop
This commit is contained in:
commit
360c72eaf0
@ -22,7 +22,7 @@
|
||||
# cmake 3.12 have more better modern c++ support
|
||||
|
||||
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
|
||||
project(nana VERSION 1.7.2
|
||||
project(nana VERSION 1.7.3
|
||||
DESCRIPTION "C++ GUI library"
|
||||
HOMEPAGE_URL http://nanapro.org
|
||||
LANGUAGES CXX )
|
||||
|
||||
@ -492,6 +492,14 @@ namespace nana
|
||||
|
||||
/// Gets the current hovered node.
|
||||
item_proxy hovered(bool exclude_expander) const;
|
||||
|
||||
|
||||
/// Enable/disable the interactions (selection, click, ...) on the entire line of the treebox.
|
||||
/**
|
||||
* @param enable bool whether to enable.
|
||||
*/
|
||||
void use_entire_line(bool enable);
|
||||
|
||||
private:
|
||||
std::shared_ptr<scroll_operation_interface> _m_scroll_operation() override;
|
||||
|
||||
|
||||
@ -1386,7 +1386,7 @@ namespace std
|
||||
{
|
||||
namespace filesystem
|
||||
{
|
||||
#if defined(_MSC_VER) && ((!defined(_MSVC_LANG)) || (_MSVC_LANG < 201703))
|
||||
#if defined(_MSC_VER) && ((_MSC_VER < 1900) || ((!defined(_MSVC_LANG)) || (_MSVC_LANG < 201703)))
|
||||
|
||||
path absolute(const path& p)
|
||||
{
|
||||
|
||||
@ -922,7 +922,25 @@ namespace nana
|
||||
}
|
||||
else if (checks::option == item.style)
|
||||
{
|
||||
get_drawer_trigger().mbuilder().checked(active, true);
|
||||
if(active > 0)
|
||||
{
|
||||
do {
|
||||
if(menu->items[--active]->flags.splitter)
|
||||
{
|
||||
++active;
|
||||
break;
|
||||
}
|
||||
} while(active > 0);
|
||||
}
|
||||
while(active < menu->items.size())
|
||||
{
|
||||
menu_item_type &el = *(menu->items[active++]);
|
||||
if(el.flags.splitter)
|
||||
break;
|
||||
if(checks::option == el.style)
|
||||
el.flags.checked = false;
|
||||
}
|
||||
item.flags.checked = true;
|
||||
}
|
||||
|
||||
this->_m_close_all(); //means deleting this;
|
||||
|
||||
@ -295,7 +295,12 @@ namespace nana
|
||||
if (impl_->data.comp_placer->locate(comp, node_attr_, &attr.area))
|
||||
{
|
||||
attr.mouse_pointed = node_attr_.mouse_pointed;
|
||||
attr.area.x += pos_.x;
|
||||
|
||||
if(comp == component_t::bground && impl_->use_entire_line)
|
||||
attr.area.width = impl_->visible_w_pixels();
|
||||
else
|
||||
attr.area.x += pos_.x;
|
||||
|
||||
attr.area.y += pos_.y;
|
||||
return true;
|
||||
}
|
||||
@ -362,6 +367,9 @@ namespace nana
|
||||
std::size_t scroll_timestamp;
|
||||
nana::timer timer;
|
||||
}adjust;
|
||||
|
||||
bool use_entire_line;
|
||||
|
||||
public:
|
||||
implementation()
|
||||
{
|
||||
@ -386,6 +394,8 @@ namespace nana
|
||||
adjust.offset_x_adjust = 0;
|
||||
adjust.node = nullptr;
|
||||
adjust.scroll_timestamp = 0;
|
||||
|
||||
use_entire_line = false;
|
||||
}
|
||||
|
||||
void assign_node_attr(node_attribute& ndattr, const node_type* node) const
|
||||
@ -1675,8 +1685,8 @@ namespace nana
|
||||
nana::rectangle r = node_r;
|
||||
if (!comp_placer->locate(static_cast<component>(comp), node_attr_, &r))
|
||||
continue;
|
||||
|
||||
if (r.is_hit(logic_pos))
|
||||
|
||||
if((comp == static_cast<int>(component::bground) && impl_->use_entire_line) || r.is_hit(logic_pos))
|
||||
{
|
||||
node_ = &node;
|
||||
what_ = static_cast<component>(comp);
|
||||
@ -2023,6 +2033,7 @@ namespace nana
|
||||
{
|
||||
case component::icon:
|
||||
case component::text:
|
||||
case component::bground:
|
||||
impl_->set_expanded(node, !node->value.second.expanded);
|
||||
impl_->draw(true, true, false);
|
||||
API::dev::lazy_refresh();
|
||||
@ -2448,6 +2459,12 @@ namespace nana
|
||||
return item_proxy(const_cast<drawer_trigger_t*>(dw), dw->impl()->node_state.pointed);
|
||||
}
|
||||
|
||||
void treebox::use_entire_line(bool enable)
|
||||
{
|
||||
auto dw = &get_drawer_trigger();
|
||||
dw->impl()->use_entire_line = enable;
|
||||
}
|
||||
|
||||
std::shared_ptr<scroll_operation_interface> treebox::_m_scroll_operation()
|
||||
{
|
||||
internal_scope_guard lock;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user