Skip to content

Commit

Permalink
directvt#86 WIP: Fix group unfocus
Browse files Browse the repository at this point in the history
  • Loading branch information
o-sdn-o committed Dec 20, 2024
1 parent 306d19d commit c2067d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/netxs/desktopio/controls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1662,15 +1662,16 @@ namespace netxs::ui
}
else //if (!first_step)
{
auto focusable = node_type == mode::focused || node_type == mode::focusable;
auto last_step = chain.next.size() > 1 || focusable;
chain.foreach([&](auto& nexthop, auto& status)
{
if (nexthop == seed.item)
{
status = state::idle;
status = last_step ? state::dead : state::idle;
}
});
auto focusable = node_type == mode::focused || node_type == mode::focusable;
if (chain.next.size() > 1 || focusable) // Stop unfocusing on hub or focusable.
if (last_step) // Stop unfocusing on hub or focusable.
{
boss.bell::expire(tier::preview); // Don't let the hall send the event to the gate.
return;
Expand Down Expand Up @@ -1711,6 +1712,7 @@ namespace netxs::ui
// pro::focus: Drop all downlinks (toward inside) from the boss and unfocus boss. Return dropped active gears.
boss.LISTEN(tier::request, hids::events::focus::cut, gear_id_list, memo)
{
//todo cut a single item
for (auto& [gear_id, chain] : gears)
{
auto live = faux;
Expand All @@ -1725,7 +1727,8 @@ namespace netxs::ui
});
if (gear_id)
{
boss.bell::signal(tier::preview, hids::events::focus::set::off, { .gear_id = gear_id }); // The cutting object is changing its host along with focus.
//todo revise
//boss.bell::signal(tier::preview, hids::events::focus::set::off, { .gear_id = gear_id }); // The cutting object is changing its host along with focus.
if (live) gear_id_list.push_back(gear_id); // Backup dropped active gears.
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/vtm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,7 @@ namespace netxs::app::vtm
gear.owner.bell::signal(tier::release, hids::events::keybd::key::post, gear);
}
};
//todo mimic pro::focus
//todo mimic pro::focus (hall has no parent)
LISTEN(tier::preview, hids::events::focus::set::any, seed) // Forward focus events to the gate for sending it to the outside.
{
if (seed.gear_id)
Expand Down
2 changes: 1 addition & 1 deletion src/vtm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ R"==(
<key="UpArrow" ><action=TileMoveGrip data=" 0,-1"/></key> <!-- Move the split grip up. -->
<key="DownArrow" ><action=TileMoveGrip data=" 0, 1"/></key> <!-- Move the split grip down. -->
<key="'-'" ><action=TileResizeGrip data="-1" /></key> <!-- Decrease the split grip width. -->
<key="Shift+'+' | NumpadPlus"><action=TileResizeGrip data="1"/></key> <!-- Increase the split grip width. -->
<key="Shift+'+' | '+' | '=' | NumpadPlus"><action=TileResizeGrip data="1"/></key> <!-- Increase the split grip width. -->
<key="Shift+Tab" action=TileFocusPrevGrip/> <!-- Focus the next split grip. -->
<key="Tab" action=TileFocusNextGrip/> <!-- Focus the previous split grip. -->
</grips>
Expand Down

0 comments on commit c2067d4

Please sign in to comment.