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

Unified Diff: Source/devtools/front_end/ui/UIUtils.js

Issue 1171893005: DevTools: unify theming for checkbox components. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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: Source/devtools/front_end/ui/UIUtils.js
diff --git a/Source/devtools/front_end/ui/UIUtils.js b/Source/devtools/front_end/ui/UIUtils.js
index 22baf783e68e340fb0954e44a65888d02de54f23..dd9fec754fcf3190633175a220792a9d92e3595c 100644
--- a/Source/devtools/front_end/ui/UIUtils.js
+++ b/Source/devtools/front_end/ui/UIUtils.js
@@ -1332,11 +1332,11 @@ function createCheckboxLabel(title, checked)
*/
createdCallback: function()
{
- var root = WebInspector.createShadowRootWithCoreStyles(this);
- root.appendChild(WebInspector.Widget.createStyleElement("ui/checkboxTextLabel.css"));
+ this._root = WebInspector.createShadowRootWithCoreStyles(this);
+ this._root.appendChild(WebInspector.Widget.createStyleElement("ui/checkboxTextLabel.css"));
var checkboxElement = createElementWithClass("input", "dt-checkbox-button");
checkboxElement.type = "checkbox";
- root.appendChild(checkboxElement);
+ this._root.appendChild(checkboxElement);
this.checkboxElement = checkboxElement;
this.addEventListener("click", toggleCheckbox.bind(this));
@@ -1351,7 +1351,7 @@ function createCheckboxLabel(title, checked)
checkboxElement.click();
}
- root.createChild("content");
+ this._root.createChild("content");
},
/**
@@ -1360,7 +1360,7 @@ function createCheckboxLabel(title, checked)
*/
set backgroundColor(color)
{
- this.checkboxElement.classList.add("dt-checkbox-colored");
+ this.checkboxElement.classList.add("dt-checkbox-themed");
this.checkboxElement.style.backgroundColor = color;
},
@@ -1368,9 +1368,21 @@ function createCheckboxLabel(title, checked)
* @param {string} color
* @this {Element}
*/
+ set checkColor(color)
+ {
+ this.checkboxElement.classList.add("dt-checkbox-themed");
+ var stylesheet = createElement("style");
+ stylesheet.textContent = "input.dt-checkbox-themed:checked:after { background-color: " + color + "}";
+ this._root.appendChild(stylesheet);
dgozman 2015/06/09 15:42:59 Should we remove previous one, if any?
+ },
+
+ /**
+ * @param {string} color
+ * @this {Element}
+ */
set borderColor(color)
{
- this.checkboxElement.classList.add("dt-checkbox-colored");
+ this.checkboxElement.classList.add("dt-checkbox-themed");
this.checkboxElement.style.borderColor = color;
},
« no previous file with comments | « Source/devtools/front_end/emulation/responsiveDesignView.css ('k') | Source/devtools/front_end/ui/checkboxTextLabel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698