Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js

Issue 1938053002: DevTools: brush up command menu looks, render badges. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js
index 0c014fa2dee93f0576d0a2ac8445bf074cf4420a..e3f4bf7407d8960f5041779501623e64bd099891 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js
@@ -9,19 +9,20 @@
* @extends {WebInspector.VBox}
* @implements {WebInspector.ViewportControl.Provider}
* @param {!WebInspector.FilteredListWidget.Delegate} delegate
- * @param {boolean} renderAsTwoRows
*/
-WebInspector.FilteredListWidget = function(delegate, renderAsTwoRows)
+WebInspector.FilteredListWidget = function(delegate)
{
WebInspector.VBox.call(this, true);
- this._renderAsTwoRows = renderAsTwoRows;
+ this._renderAsTwoRows = delegate.renderAsTwoRows();
this.contentElement.classList.add("filtered-list-widget");
this.contentElement.addEventListener("keydown", this._onKeyDown.bind(this), false);
+ if (delegate.renderMonospace())
+ this.contentElement.classList.add("monospace");
this.registerRequiredCSS("ui_lazy/filteredListWidget.css");
- this._promptElement = this.contentElement.createChild("div", "monospace filtered-list-widget-input");
+ this._promptElement = this.contentElement.createChild("div", "filtered-list-widget-input");
this._promptElement.setAttribute("spellcheck", "false");
this._promptElement.setAttribute("contenteditable", "plaintext-only");
this._prompt = new WebInspector.TextPrompt(this._autocomplete.bind(this));
@@ -35,7 +36,6 @@ WebInspector.FilteredListWidget = function(delegate, renderAsTwoRows)
this._viewportControl = new WebInspector.ViewportControl(this);
this._itemElementsContainer = this._viewportControl.element;
this._itemElementsContainer.classList.add("container");
- this._itemElementsContainer.classList.add("monospace");
this._itemElementsContainer.addEventListener("click", this._onClick.bind(this), false);
this.contentElement.appendChild(this._itemElementsContainer);
@@ -72,7 +72,8 @@ WebInspector.FilteredListWidget.prototype = {
showAsDialog: function()
{
this._dialog = new WebInspector.Dialog();
- this._dialog.setMaxSize(new Size(504, 600));
+ this._dialog.setMaxSize(new Size(504, 340));
+ this._dialog.setPosition(undefined, 22);
this.show(this._dialog.element);
this._dialog.show();
},
@@ -520,6 +521,22 @@ WebInspector.FilteredListWidget.Delegate.prototype = {
},
/**
+ * @return {boolean}
+ */
+ renderMonospace: function()
+ {
+ return true;
+ },
+
+ /**
+ * @return {boolean}
+ */
+ renderAsTwoRows: function()
+ {
+ return false;
+ },
+
+ /**
* @param {number} itemIndex
* @param {string} promptValue
*/

Powered by Google App Engine
This is Rietveld 408576698