Skip to content

Commit

Permalink
directvt#400 WIP: Shaders (window body)
Browse files Browse the repository at this point in the history
  • Loading branch information
o-sdn-o committed Oct 24, 2023
1 parent c1fd841 commit 92954f2
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 14 deletions.
5 changes: 4 additions & 1 deletion src/netxs/apps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ namespace netxs::app::shared
auto window = ui::cake::ctor();
auto strob = window->plugin<pro::focus>(pro::focus::mode::focused)
->plugin<pro::notes>(" Left+Right click to close ")
->active()
->invoke([](auto& boss)
{
//boss.keybd.accept(true);
Expand Down Expand Up @@ -96,6 +97,7 @@ namespace netxs::app::shared
->plugin<pro::cache>()
->plugin<pro::notes>(" Left+Right click to close ")
->attach(ui::stem_rate<tier::preview, decltype(e2::config::fps)>::ctor("Set frame rate limit", 1, 200, "fps"))
->active()
->colors(0xFFFFFFFF, bluedk)
->invoke([&](auto& boss)
{
Expand Down Expand Up @@ -130,7 +132,7 @@ namespace netxs::app::shared
};
});
auto object = window->attach(ui::mock::ctor())
->colors(0,0); //todo mouse tracking
->active();
return window;
};
auto build_Region = [](text cwd, text v, xmls& config, text patch)
Expand Down Expand Up @@ -312,6 +314,7 @@ namespace netxs::app::shared
auto test_stat_area = object->attach(slot::_2, ui::fork::ctor(axis::Y));
auto layers = test_stat_area->attach(slot::_1, ui::cake::ctor());
auto scroll = layers->attach(ui::rail::ctor())
->active()
->colors(whitelt, reddk);
scroll->attach(ui::post::ctor())
->upload(truecolor);
Expand Down
5 changes: 5 additions & 0 deletions src/netxs/apps/calc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,12 @@ namespace netxs::app::calc
auto func_line = func_body->attach(slot::_1, ui::fork::ctor());
auto fx_sum = func_line->attach(slot::_1, ui::fork::ctor());
auto fx = fx_sum->attach(slot::_1, ui::post::ctor())
->active()
->plugin<pro::fader>(c7, c3, fader)
->limits({ 3,-1 }, { 4,-1 })
->upload(ansi::wrp(wrap::off).add(" Fx "));
auto ellipsis = func_line->attach(slot::_2, ui::post::ctor())
->active()
->plugin<pro::fader>(c7, c3, fader)
->limits({ -1,1 }, { 3,-1 })
->upload(ansi::wrp(wrap::off).add(""));
Expand All @@ -375,8 +377,10 @@ namespace netxs::app::calc
auto rows_body = body_area->attach(slot::_2, ui::fork::ctor());
auto layers = rows_body->attach(slot::_2, ui::cake::ctor());
auto scroll = layers->attach(ui::rail::ctor())
->active()
->limits({ -1,1 }, { -1,-1 });
auto grid = scroll->attach(ui::post::ctor())
->active()
->colors(0xFF000000, 0xFFffffff)
->plugin<pro::cell_highlight>()
->upload(cellatix_text);
Expand Down Expand Up @@ -411,6 +415,7 @@ namespace netxs::app::calc
.bgc(whitelt).fgc(blackdk).add(" Sheet1 "));
auto plus_pad = sheet_plus->attach(slot::_2, ui::fork::ctor());
auto plus = plus_pad->attach(slot::_1, ui::post::ctor())
->active()
->plugin<pro::fader>(c7, c3, fader)
->limits({ 3,-1 }, { 3,-1 })
->upload(ansi::wrp(wrap::off).add(" + "));
Expand Down
2 changes: 0 additions & 2 deletions src/netxs/apps/desk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ namespace netxs::app::desk
auto danger_color = skin::globals().danger;
auto highlight_color = skin::globals().highlight;
auto c1 = danger_color;
auto fastfader = skin::globals().fader_fast;
auto fader = skin::globals().fader_time;
auto item_area = ui::fork::ctor()
->active()
->shader(cell::shaders::xlight, e2::form::state::hover)
Expand Down
2 changes: 2 additions & 0 deletions src/netxs/apps/shop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,13 @@ namespace netxs::app::shop
->active();
auto layers = object->attach(slot::_2, ui::cake::ctor());
auto scroll = layers->attach(ui::rail::ctor())
->active()
->colors(whitedk, 0xFF0f0f0f)
->limits({ -1,-1 }, { -1,-1 });
auto items = scroll->attach(ui::list::ctor());
for (auto& body : appstore_body) items->attach(ui::post::ctor())
->upload(body)
->active()
->plugin<pro::grade>()
->plugin<pro::fader>(x3, c3, 250ms);
items->attach(ui::post::ctor())
Expand Down
1 change: 1 addition & 0 deletions src/netxs/apps/test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ namespace netxs::app::test
auto test_stat_area = object0->attach(slot::_2, ui::fork::ctor(axis::Y));
auto layers = test_stat_area->attach(slot::_1, ui::cake::ctor());
auto scroll = layers->attach(ui::rail::ctor())
->active()
->colors(cyanlt, bluedk);
auto object = scroll->attach(ui::post::ctor())
->upload(topic)
Expand Down
1 change: 1 addition & 0 deletions src/netxs/apps/text.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ displaying the requested definition in a popup window or temporary buffer. Some
auto fields = body_area->attach(slot::_1, ui::pads::ctor(dent{ 1,1 }));
auto layers = fields->attach(ui::cake::ctor());
auto scroll = layers->attach(ui::rail::ctor())
->active()
->limits({ 4,3 }, { -1,-1 });
auto edit_box = scroll->attach(ui::post::ctor(true))
->plugin<pro::caret>(true, faux, twod{ 25,1 })
Expand Down
12 changes: 7 additions & 5 deletions src/netxs/apps/tile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@ namespace netxs::app::tile
{
auto highlight_color = skin::color(tone::highlight);
auto c3 = highlight_color;
auto x3 = cell{ c3 }.alpha(0x00);
return ui::item::ctor(header.empty() ? "- no title -" : header)
->setpad({ 1, 1 })
->template plugin<pro::fader>(x3, c3, skin::globals().fader_time)
->active()
->shader(cell::shaders::xlight, e2::form::state::hover)
->invoke([&](auto& boss)
{
auto update_focus = [](auto& boss, auto state)
{
auto highlight_color = skin::color(tone::highlight);
auto c3 = highlight_color;
auto x3 = cell{ c3 }.alpha(0x00);
boss.color(state ? 0xFF00ff00 : x3.fgc(), x3.bgc());
boss.base::color(state ? 0xFF00ff00 : x3.fgc(), x3.bgc());
};
auto data_shadow = ptr::shadow(data_src_sptr);
boss.LISTEN(tier::release, e2::form::upon::vtree::attached, parent, boss.tracker, (data_shadow))
Expand Down Expand Up @@ -440,6 +440,7 @@ namespace netxs::app::tile

return ui::cake::ctor()
->isroot(true, base::placeholder)
->active()
->colors(cC.fgc(), cC.bgc())
->limits(dot_00, -dot_11)
->plugin<pro::focus>(pro::focus::mode::focusable)
Expand Down Expand Up @@ -469,6 +470,7 @@ namespace netxs::app::tile
{
return ui::veer::ctor()
->plugin<pro::focus>(pro::focus::mode::hub/*default*/, true/*default*/, true)
->active()
->invoke([&](auto& boss)
{
auto highlight = [](auto& boss, auto state)
Expand Down Expand Up @@ -887,7 +889,7 @@ namespace netxs::app::tile
gear.dismiss(true);
};
}},
{ menu::item{ menu::item::type::Command, true, 0, std::vector<menu::item::look>{{ .label = " ┌┘ ", .notes = " Change split orientation " }}},
{ menu::item{ menu::item::type::Command, true, 0, std::vector<menu::item::look>{{ .label = "┌┘", .notes = " Change split orientation " }}},
[](auto& boss, auto& item)
{
boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear)
Expand Down Expand Up @@ -922,7 +924,7 @@ namespace netxs::app::tile
app::shared::set_title(boss, gear);
};
}},
{ menu::item{ menu::item::type::Command, true, 0, std::vector<menu::item::look>{{ .label = " × ", .notes = " Close active app or remove pane if there is no running app ", .hover = c1 }}},
{ menu::item{ menu::item::type::Command, true, 0, std::vector<menu::item::look>{{ .label = "×", .notes = " Close active app ", .hover = c1 }}},
[](auto& boss, auto& item)
{
boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear)
Expand Down
8 changes: 3 additions & 5 deletions src/netxs/desktopio/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,9 @@ namespace netxs::app::shared
auto warning_color = skin::color(tone::warning);
auto c6 = action_color;
auto c3 = highlight_color;
auto x3 = cell{ c3 }.alpha(0x00);
auto c2 = warning_color;
auto c1 = danger_color;
auto macstyle = skin::globals().macstyle;

auto menuveer = ui::veer::ctor();
auto menufork = ui::fork::ctor()
//todo
Expand All @@ -234,7 +232,7 @@ namespace netxs::app::shared
else button->shader(cell::shaders::xlight, e2::form::state::hover);
}
button->template plugin<pro::notes>(notes)
->setpad({ 2,2,!slimsize,!slimsize })
->setpad({ 2, 2, !slimsize, !slimsize })
->invoke([&](auto& boss) // Store shared ptr to the menu item config.
{
auto props_shadow = ptr::shared(std::move(props));
Expand Down Expand Up @@ -262,7 +260,7 @@ namespace netxs::app::shared
{
auto control = std::vector<link>
{
{ menu::item{ menu::item::type::Command, true, 0, std::vector<menu::item::look>{{ .label = "", .notes = " Minimize ", .hover = c2 }}},
{ menu::item{ menu::item::type::Command, true, 0, std::vector<menu::item::look>{{ .label = "", .notes = " Minimize " }}},//, .hover = c2 }}}, //toto too funky
[](auto& boss, auto& item)
{
boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear)
Expand All @@ -271,7 +269,7 @@ namespace netxs::app::shared
gear.dismiss();
};
}},
{ menu::item{ menu::item::type::Command, true, 0, std::vector<menu::item::look>{{ .label = "", .notes = " Maximize ", .hover = c6 }}},
{ menu::item{ menu::item::type::Command, true, 0, std::vector<menu::item::look>{{ .label = "", .notes = " Maximize " }}},//, .hover = c6 }}},
[](auto& boss, auto& item)
{
boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear)
Expand Down
2 changes: 1 addition & 1 deletion src/netxs/desktopio/controls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2147,7 +2147,7 @@ namespace netxs::ui
boss.LISTEN(tier::release, e2::render::prerender, parent_canvas, memo)
{
if (!alive || boss.base::filler.bga() == 0xFF) return;
parent_canvas.blur(width);
parent_canvas.blur(width, [&](cell& c) { c.alpha(0xFF); });
};
}
};
Expand Down

0 comments on commit 92954f2

Please sign in to comment.