Changeset 188572 in webkit
- Timestamp:
- Aug 17, 2015, 9:12:15 PM (10 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r188571 r188572 1 2015-08-17 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Style changes to Visual sidebar selector items 4 https://bugs.webkit.org/show_bug.cgi?id=148114 5 6 Reviewed by Timothy Hatcher. 7 8 * Localizations/en.lproj/localizedStrings.js: 9 * UserInterface/Views/GeneralTreeElement.js: 10 (WebInspector.GeneralTreeElement.prototype._updateTitleElements): 11 (WebInspector.GeneralTreeElement.prototype._updateTitleTooltip): 12 Moved the code to update the item tooltip to its own function. 13 14 * UserInterface/Views/VisualStyleDetailsPanel.js: 15 (WebInspector.VisualStyleDetailsPanel.prototype._addMetricsMouseListeners.editorMouseover): 16 (WebInspector.VisualStyleDetailsPanel.prototype._addMetricsMouseListeners.editorMouseout): 17 (WebInspector.VisualStyleDetailsPanel.prototype._addMetricsMouseListeners): 18 (WebInspector.VisualStyleDetailsPanel.prototype._generateMetricSectionRows): 19 (WebInspector.VisualStyleDetailsPanel.prototype._populateMarginSection): 20 (WebInspector.VisualStyleDetailsPanel.prototype._populatePaddingSection): 21 (WebInspector.VisualStyleDetailsPanel.prototype._addMetricsMouseListeners.onEditorMouseover): Deleted. 22 (WebInspector.VisualStyleDetailsPanel.prototype._addMetricsMouseListeners.onEditorMouseout): Deleted. 23 Added on-hover node/selector highlighting to margin and padding editor links. 24 25 * UserInterface/Views/VisualStyleNumberInputBox.js: 26 (WebInspector.VisualStyleNumberInputBox): 27 Replaced "No Units" with "Number" for better clarity. 28 29 * UserInterface/Views/VisualStyleSelectorTreeItem.css: 30 (body:not(.window-inactive, .window-docked-inactive) .item.visual-style-selector-item.selected > input[type="checkbox"]:checked::before): 31 (.item.visual-style-selector-item.selected > input[type="checkbox"]::before): Deleted. 32 Removes the white border when the window is inactive and when the checkbox is unchecked. 33 34 * UserInterface/Views/VisualStyleSelectorTreeItem.js: 35 (WebInspector.VisualStyleSelectorTreeItem.prototype._commitSelector): 36 Now updates the title of the item when the selector changes. 37 1 38 2015-08-17 Devin Rousso <drousso@apple.com> 2 39 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r188530 r188572 399 399 localizedStrings["No Results Found"] = "No Results Found"; 400 400 localizedStrings["No Search Results"] = "No Search Results"; 401 localizedStrings["No Units"] = "No Units";402 401 localizedStrings["No Watch Expressions"] = "No Watch Expressions"; 403 402 localizedStrings["No exact ARIA role match."] = "No exact ARIA role match."; … … 406 405 localizedStrings["Node"] = "Node"; 407 406 localizedStrings["Not found"] = "Not found"; 407 localizedStrings["Number"] = "Number"; 408 408 localizedStrings["Offset"] = "Offset"; 409 409 localizedStrings["Online"] = "Online"; -
trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js
r183821 r188572 343 343 344 344 // Set a default tooltip if there isn't a custom one already assigned. 345 if (!this.tooltip && !this._tooltipHandledSeparately) { 346 console.assert(this._listItemNode); 347 348 // Get the textContent for the elements since they can contain other nodes, 349 // and the tool tip only cares about the text. 350 var mainTitleText = this._mainTitleElement.textContent; 351 var subtitleText = this._subtitleElement ? this._subtitleElement.textContent : ""; 352 353 if (mainTitleText && subtitleText) 354 this._listItemNode.title = mainTitleText + (this._small && !this._twoLine ? " \u2014 " : "\n") + subtitleText; 355 else if (mainTitleText) 356 this._listItemNode.title = mainTitleText; 357 else 358 this._listItemNode.title = subtitleText; 359 } 345 if (!this.tooltip && !this._tooltipHandledSeparately) 346 this._updateTitleTooltip(); 347 } 348 349 _updateTitleTooltip() 350 { 351 console.assert(this._listItemNode); 352 if (!this._listItemNode) 353 return; 354 355 // Get the textContent for the elements since they can contain other nodes, 356 // and the tool tip only cares about the text. 357 let mainTitleText = this._mainTitleElement.textContent; 358 let subtitleText = this._subtitleElement ? this._subtitleElement.textContent : ""; 359 if (mainTitleText && subtitleText) 360 this._listItemNode.title = mainTitleText + (this._small && !this._twoLine ? " \u2014 " : "\n") + subtitleText; 361 else if (mainTitleText) 362 this._listItemNode.title = mainTitleText; 363 else 364 this._listItemNode.title = subtitleText; 360 365 } 361 366 -
trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js
r188503 r188572 329 329 } 330 330 331 _generateMetricSectionRows(group, prefix, allowNegatives) 331 _addMetricsMouseListeners(editor, mode) 332 { 333 function editorMouseover() { 334 if (!this._currentStyle) 335 return; 336 337 if (!this._currentStyle.ownerRule) { 338 WebInspector.domTreeManager.highlightDOMNode(this._currentStyle.node.id, mode); 339 return; 340 } 341 342 WebInspector.domTreeManager.highlightSelector(this._currentStyle.ownerRule.selectorText, this._currentStyle.node.ownerDocument.frameIdentifier, mode); 343 } 344 345 function editorMouseout() { 346 WebInspector.domTreeManager.hideDOMNodeHighlight(); 347 } 348 349 editor.element.addEventListener("mouseover", editorMouseover.bind(this)); 350 editor.element.addEventListener("mouseout", editorMouseout); 351 } 352 353 _generateMetricSectionRows(group, prefix, allowNegatives, highlightOnHover) 332 354 { 333 355 let properties = group.properties; … … 364 386 let allLink = new WebInspector.VisualStylePropertyEditorLink([properties[top], properties[bottom], properties[left], properties[right]], "link-all", [verticalLink, horizontalLink]); 365 387 allLinkRow.element.appendChild(allLink.element); 388 389 if (highlightOnHover) { 390 this._addMetricsMouseListeners(properties[top], prefix); 391 this._addMetricsMouseListeners(verticalLink, prefix); 392 this._addMetricsMouseListeners(properties[bottom], prefix); 393 this._addMetricsMouseListeners(allLink, prefix); 394 this._addMetricsMouseListeners(properties[left], prefix); 395 this._addMetricsMouseListeners(horizontalLink, prefix); 396 this._addMetricsMouseListeners(properties[right], prefix); 397 } 366 398 367 399 return [vertical, allLinkRow, horizontal]; … … 409 441 let floatGroup = new WebInspector.DetailsSectionGroup([floatRow, clearRow]); 410 442 this._populateSection(group, [floatGroup]); 411 }412 413 _addMetricsMouseListeners(editor, mode)414 {415 function onEditorMouseover() {416 if (!this._style)417 return;418 419 if (!this._style.ownerRule) {420 WebInspector.domTreeManager.highlightDOMNode(this._style.node.id, mode);421 return;422 }423 424 WebInspector.domTreeManager.highlightSelector(this._style.ownerRule.selectorText, this._style.node.ownerDocument.frameIdentifier, mode);425 }426 427 function onEditorMouseout() {428 WebInspector.domTreeManager.hideDOMNodeHighlight();429 }430 431 editor.element.addEventListener("mouseover", onEditorMouseover.bind(editor));432 editor.element.addEventListener("mouseout", onEditorMouseout.bind(editor));433 443 } 434 444 … … 505 515 { 506 516 let group = this._groups.margin; 507 let rows = this._generateMetricSectionRows(group, "margin", true); 508 509 let highlightMode = "margin"; 510 this._addMetricsMouseListeners(group.properties.marginTop, highlightMode); 511 this._addMetricsMouseListeners(group.properties.marginBottom, highlightMode); 512 this._addMetricsMouseListeners(group.properties.marginLeft, highlightMode); 513 this._addMetricsMouseListeners(group.properties.marginRight, highlightMode); 514 517 let rows = this._generateMetricSectionRows(group, "margin", true, true); 515 518 let marginGroup = new WebInspector.DetailsSectionGroup(rows); 516 519 this._populateSection(group, [marginGroup]); … … 520 523 { 521 524 let group = this._groups.padding; 522 let rows = this._generateMetricSectionRows(group, "padding"); 523 524 let highlightMode = "padding"; 525 this._addMetricsMouseListeners(group.properties.paddingTop, highlightMode); 526 this._addMetricsMouseListeners(group.properties.paddingBottom, highlightMode); 527 this._addMetricsMouseListeners(group.properties.paddingLeft, highlightMode); 528 this._addMetricsMouseListeners(group.properties.paddingRight, highlightMode); 529 525 let rows = this._generateMetricSectionRows(group, "padding", false, true); 530 526 let paddingGroup = new WebInspector.DetailsSectionGroup(rows); 531 527 this._populateSection(group, [paddingGroup]); -
trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleNumberInputBox.js
r188238 r188572 28 28 constructor(propertyNames, text, possibleValues, possibleUnits, allowNegativeValues, layoutReversed) 29 29 { 30 super(propertyNames, text, possibleValues, possibleUnits || [WebInspector.UIString("N o Units")], "number-input-box", layoutReversed);30 super(propertyNames, text, possibleValues, possibleUnits || [WebInspector.UIString("Number")], "number-input-box", layoutReversed); 31 31 32 32 this._hasUnits = !!possibleUnits; -
trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.css
r188490 r188572 47 47 } 48 48 49 .item.visual-style-selector-item.selected > input[type="checkbox"]::before {49 body:not(.window-inactive, .window-docked-inactive) .item.visual-style-selector-item.selected > input[type="checkbox"]:checked::before { 50 50 position: absolute; 51 51 top: 0; -
trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js
r188490 r188572 192 192 this._hideDOMNodeHighlight(); 193 193 this._listItemNode.classList.remove("editable"); 194 this._updateTitleTooltip(); 194 195 195 196 let value = this.selectorText;
Note:
See TracChangeset
for help on using the changeset viewer.