Skip to content

Commit

Permalink
directvt#464 WIP: XLinkVT mode (focus)
Browse files Browse the repository at this point in the history
  • Loading branch information
o-sdn-o committed Dec 1, 2023
1 parent f2c603c commit 7cc4792
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 20 deletions.
12 changes: 8 additions & 4 deletions src/netxs/apps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ namespace netxs::app::dtvt
namespace netxs::app::xlinkvt
{
static constexpr auto id = "xlinkvt";
static constexpr auto desc = "XLinkVT Console (Cross-linked VT)";
static constexpr auto desc = "XLinkVT";
}
namespace netxs::app::xlvt
{
static constexpr auto id = "xlvt";
static constexpr auto desc = "XLinkVT Console (Cross-linked VT)";
static constexpr auto desc = "XLinkVT";
}
namespace netxs::app::shell
{
Expand Down Expand Up @@ -479,7 +479,8 @@ namespace netxs::app::shared
auto cB = menu_white;

auto window = ui::veer::ctor()
->limits(dot_11, { 400,200 });
->limits(dot_11, { 400,200 })
->plugin<pro::focus>(pro::focus::mode::active);
auto term = ui::cake::ctor()
->plugin<pro::acryl>()
->plugin<pro::cache>()
Expand Down Expand Up @@ -507,7 +508,7 @@ namespace netxs::app::shared
auto& term_inst = *inst;

auto dtvt = ui::dtvt::ctor()
->plugin<pro::focus>(pro::focus::mode::active)
->plugin<pro::focus>(pro::focus::mode::focusable)
->limits(dot_11)
->invoke([&](auto& boss)
{
Expand All @@ -524,6 +525,9 @@ namespace netxs::app::shared
{
if (window_inst.back() != boss.This())
{
auto gear_id_list = pro::focus::get(window_inst.back(), true); // Expropriate all foci.
pro::focus::off(window_inst.back());
pro::focus::set(window_inst.front(), gear_id_list, pro::focus::solo::off, pro::focus::flip::off, true); // Refocus.
window_inst.roll();
boss.reflow();
}
Expand Down
2 changes: 1 addition & 1 deletion src/netxs/apps/term.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ namespace netxs::app::term
->plugin<pro::acryl>()
->plugin<pro::cache>();
}
else window->plugin<pro::focus>(pro::focus::mode::focusable, faux);
else window->plugin<pro::focus>(pro::focus::mode::focusable);

auto object = window->attach(ui::fork::ctor(axis::Y))
->colors(cB);
Expand Down
2 changes: 1 addition & 1 deletion src/netxs/apps/tile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ namespace netxs::app::tile
auto empty_slot = [](auto&& empty_slot, auto min_state) -> netxs::sptr<ui::veer>
{
return ui::veer::ctor()
->plugin<pro::focus>(pro::focus::mode::hub/*default*/, true/*default*/, true)
->plugin<pro::focus>(pro::focus::mode::hub/*default*/, true/*cut_scope*/)
->active()
->invoke([&](auto& boss)
{
Expand Down
29 changes: 16 additions & 13 deletions src/netxs/desktopio/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,23 +434,26 @@ namespace netxs::app::shared
});
auto msg = ui::post::ctor()
->colors(whitelt, rgba{ 0x7F404040 })
->upload(ansi::fgc(yellowlt).mgl(4).mgr(4).wrp(wrap::off)
+ "\n\nUnsupported application type\n\n"
+ ansi::nil().wrp(wrap::on)
+ "Only the following application types are supported\n\n"
+ ansi::nil().wrp(wrap::off).fgc(whitedk)
+ " type = DirectVT(dtvt) \n"
" type = ANSIVT \n"
" type = SHELL \n"
" type = Group \n"
" type = Region \n\n"
+ ansi::nil().wrp(wrap::on).fgc(whitelt)
.add(prompt::apps, "See logs for details."));
->upload(ansi::fgc(yellowlt).mgl(4).mgr(4).wrp(wrap::off) +
"\n"
"\nUnsupported application type"
"\n" + ansi::nil().wrp(wrap::on) +
"\nOnly the following application types are supported"
"\n" + ansi::nil().wrp(wrap::off).fgc(whitedk) +
"\n type = DirectVT(dtvt)"
"\n type = XLinkVT(xlvt)"
"\n type = ANSIVT"
"\n type = SHELL"
"\n type = Group"
"\n type = Region"
"\n"
"\n" + ansi::nil().wrp(wrap::on).fgc(whitelt)
.add(prompt::apps, "See logs for details."));
auto placeholder = ui::cake::ctor()
->colors(whitelt, rgba{ 0x7F404040 })
->attach(msg->alignment({ snap::head, snap::head }));
window->attach(ui::rail::ctor())
->attach(placeholder);
->attach(placeholder);
return window;
};
auto& map = creator();
Expand Down
3 changes: 2 additions & 1 deletion src/netxs/desktopio/controls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,8 @@ namespace netxs::ui
}

focus(base&&) = delete;
focus(base& boss, mode m = mode::hub, bool visible = true, bool cut_scope = faux)
//todo drop visible
focus(base& boss, mode m = mode::hub, bool cut_scope = faux)
: skill{ boss },
focusable{ m != mode::hub && m != mode::active },
scope{ cut_scope }
Expand Down

0 comments on commit 7cc4792

Please sign in to comment.