mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
sculpt_manager: support opaque menu_view instances
Related to issue #4592.
This commit is contained in:
parent
2772abc8d7
commit
461a27a674
@ -59,14 +59,16 @@ Menu_view::Menu_view(Env &env, Registry<Child_state> ®istry,
|
||||
Ram_quota ram_quota, Cap_quota cap_quota,
|
||||
Session_label const &dialog_report_name,
|
||||
Session_label const &hover_rom_name,
|
||||
Hover_update_handler &hover_update_handler)
|
||||
Hover_update_handler &hover_update_handler,
|
||||
Alpha alpha, Color background_color)
|
||||
:
|
||||
_dialog(dialog),
|
||||
_hover_update_handler(hover_update_handler),
|
||||
_child_state(registry, name, Priority::LEITZENTRALE, ram_quota, cap_quota),
|
||||
_dialog_reporter(env, "dialog", dialog_report_name.string()),
|
||||
_hover_rom(env, hover_rom_name.string()),
|
||||
_hover_handler(env.ep(), *this, &Menu_view::_handle_hover)
|
||||
_hover_handler(env.ep(), *this, &Menu_view::_handle_hover),
|
||||
_opaque(alpha == Alpha::OPAQUE), _background_color(background_color)
|
||||
{
|
||||
_hover_rom.sigh(_hover_handler);
|
||||
|
||||
@ -108,6 +110,9 @@ void Menu_view::_gen_start_node_content(Xml_generator &xml) const
|
||||
xml.node("config", [&] () {
|
||||
if (min_width) xml.attribute("width", min_width);
|
||||
if (min_height) xml.attribute("height", min_height);
|
||||
if (_opaque) xml.attribute("opaque", "yes");
|
||||
|
||||
xml.attribute("background", String<20>(_background_color));
|
||||
|
||||
xml.node("libc", [&] () { xml.attribute("stderr", "/dev/log"); });
|
||||
xml.node("report", [&] () { xml.attribute("hover", "yes"); });
|
||||
|
@ -46,6 +46,10 @@ struct Sculpt::Menu_view : Noncopyable
|
||||
|
||||
Signal_handler<Menu_view> _hover_handler;
|
||||
|
||||
bool const _opaque;
|
||||
|
||||
Color const _background_color;
|
||||
|
||||
bool _hovered = false;
|
||||
|
||||
Constructible<Input::Seq_number> _seq_number { };
|
||||
@ -57,11 +61,15 @@ struct Sculpt::Menu_view : Noncopyable
|
||||
|
||||
void _gen_start_node_content(Xml_generator &) const;
|
||||
|
||||
enum class Alpha { OPAQUE, ALPHA };
|
||||
|
||||
Menu_view(Env &, Registry<Child_state> ®istry,
|
||||
Dialog &, Start_name const &, Ram_quota, Cap_quota,
|
||||
Session_label const &dialog_report_name,
|
||||
Session_label const &hover_rom_name,
|
||||
Hover_update_handler &);
|
||||
Hover_update_handler &,
|
||||
Alpha alpha = Alpha::ALPHA,
|
||||
Color background = Color { 127, 127, 127, 255 });
|
||||
|
||||
void generate();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user