[lookingGlass] Add style information to the picker

Currently the picker displays information on the hovered actor's
position and the object itself. Adding style id and class of
StWidgets to the displayed information can be very helpful for
identifying a particular actor or code segment.

https://bugzilla.gnome.org/show_bug.cgi?id=611211
This commit is contained in:
Florian Müllner 2010-01-18 04:16:39 +01:00
parent 72cb4bf346
commit d7075d9913

View File

@ -295,7 +295,14 @@ Inspector.prototype = {
let target = global.stage.get_actor_at_pos(Clutter.PickMode.ALL,
stageX,
stageY);
displayText.text = '<inspect x: ' + stageX + ' y: ' + stageY + '> ' + target;
let id, style_class;
if (target instanceof St.Widget) {
id = target.get_theme_node().get_element_id();
style_class = target.get_theme_node().get_element_class();
}
let position = '<inspect x: ' + stageX + ' y: ' + stageY + '>';
let style = '<style id: ' + id + ' class: ' + style_class + '>';
displayText.text = position + ' ' + style + ' ' + target;
if (borderPaintTarget != null)
borderPaintTarget.disconnect(borderPaintId);
borderPaintTarget = target;