mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00:00
menu_view: update dialog when min w/h changes
The minimum width/height of a dialog is not specified in the dialog ROM but in the menu_view configuration. So the regular dialog-ROM update handling fails to captures dynamic changes of the minimum w/h. In Sculpt, the panel would not always adjust immediately to a new screen size. This patch triggers a dialog update when detecting such configuration changes (min w/h, opaqueness, background color). Issue #5370
This commit is contained in:
parent
9ad7111634
commit
732f310b26
@ -228,10 +228,22 @@ struct Menu_view::Dialog : List_model<Dialog>::Element
|
|||||||
|
|
||||||
void update(Xml_node const &node)
|
void update(Xml_node const &node)
|
||||||
{
|
{
|
||||||
|
Point const orig_position = _position;
|
||||||
|
Area const orig_configured_size = _configured_size;
|
||||||
|
bool const orig_opaque = _opaque;
|
||||||
|
Color const orig_background_color = _background_color;
|
||||||
|
|
||||||
_position = Point::from_xml(node);
|
_position = Point::from_xml(node);
|
||||||
_configured_size = Area ::from_xml(node);
|
_configured_size = Area ::from_xml(node);
|
||||||
_opaque = node.attribute_value("opaque", false);
|
_opaque = node.attribute_value("opaque", false);
|
||||||
_background_color = node.attribute_value("background", Color(127, 127, 127, 255));
|
_background_color = node.attribute_value("background", Color(127, 127, 127, 255));
|
||||||
|
|
||||||
|
bool const any_change = (orig_position != _position
|
||||||
|
|| orig_configured_size != _configured_size
|
||||||
|
|| orig_opaque != _opaque
|
||||||
|
|| orig_background_color != _background_color);
|
||||||
|
if (any_change)
|
||||||
|
_dialog_handler.local_submit();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user