浏览代码

Debugger: The element info's list of children now shows the title of any documents

Michael Ragazzon 3 年之前
父节点
当前提交
ac60bc1c64
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Source/Debugger/ElementInfo.cpp

+ 5 - 1
Source/Debugger/ElementInfo.cpp

@@ -599,7 +599,11 @@ void ElementInfo::UpdateSourceElement()
 				if (IsDebuggerElement(child))
 				if (IsDebuggerElement(child))
 					continue;
 					continue;
 
 
-				const String child_name = child->GetAddress(false, false);
+				String child_name = child->GetAddress(false, false);
+				auto document = rmlui_dynamic_cast<ElementDocument*>(child);
+				if (document && !document->GetTitle().empty())
+					child_name += " (" + document->GetTitle() + ')';
+
 				const char* non_dom_string = (i >= num_dom_children ? " class=\"non_dom\"" : "");
 				const char* non_dom_string = (i >= num_dom_children ? " class=\"non_dom\"" : "");
 
 
 				children += CreateString(child_name.size() + 40, "<p id=\"c %d\"%s>%s</p>", i, non_dom_string, child_name.c_str());
 				children += CreateString(child_name.size() + 40, "<p id=\"c %d\"%s>%s</p>", i, non_dom_string, child_name.c_str());