From 1349bf8ee572da5553ed4a755825449d81d79478 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 4 Oct 2010 17:22:23 -0400 Subject: [PATCH] Improve actor appearance. Initial work on row highlighting. --- web_frontend/actor.js | 2 ++ web_frontend/file.js | 14 ++++++++++++++ web_frontend/screen.css | 25 +++++++++++++++++++++---- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/web_frontend/actor.js b/web_frontend/actor.js index 3402f02..83bc8d5 100644 --- a/web_frontend/actor.js +++ b/web_frontend/actor.js @@ -140,6 +140,7 @@ armadillo.Actor.prototype.show = function(x, y) { this.popup_.setHideOnEscape(true); this.render(); this.popup_.setVisible(true); + this.file_.setHighlight(armadillo.File.Highlight.ACTIVE); }; /** @@ -301,6 +302,7 @@ armadillo.Actor.prototype.onPopupClosed_ = function(e) { // If an action is not being performed, then dispose the Actor. Otherwise, // this will get cleaned up after the actionObject_ closes. if (!this.actionObject_) { + this.file_.setHighlight(armadillo.File.Highlight.SELECTED); this.dispose(); } }; diff --git a/web_frontend/file.js b/web_frontend/file.js index 21c6966..60fa57b 100644 --- a/web_frontend/file.js +++ b/web_frontend/file.js @@ -23,10 +23,17 @@ armadillo.File = function(name, path) { goog.Disposable.call(this); this.name_ = name; this.path_ = path; + this.highlight_ = ''; this.isDirectory_ = app.isDirectory(name); }; goog.inherits(armadillo.File, goog.Disposable); +armadillo.File.Highlight = { + NONE : '', + SELECTED : 'file-selected', + ACTIVE : 'file-active' +}; + /** * Disposer * @protected @@ -73,6 +80,13 @@ armadillo.File.prototype.isDirectory = function() { return this.isDirectory_; }; +/** + * Sets the highlight state. + */ +armadillo.File.prototype.setHighlight = function(h) { + goog.dom.classes.addRemove(this.element_, this.highlight_, h); +}; + /** * Constructs the Elements that make up the UI. * @returns {Element} An element ready for insertion into DOM. diff --git a/web_frontend/screen.css b/web_frontend/screen.css index 12231b4..6f645c2 100644 --- a/web_frontend/screen.css +++ b/web_frontend/screen.css @@ -45,6 +45,14 @@ h1 { background-color: rgb(255, 255, 255); } +#ls li.file-selected { + background-color: green; +} + +#ls li.file-active { + background-color: rgb(255, 162, 74); +} + #ls li a { text-decoration: underline; } @@ -61,15 +69,17 @@ h1 { } .actor { - width: 8.3em; - height: 8.3em; + width: 8.5em; + height: 8.5em; position: absolute; visibility: hidden; background-color: rgb(77, 79, 83); - border-width: .3em; - border-color: rgb(77, 79, 83); + padding: .1em; + + border-width: .1em; + border-color: rgb(0, 0, 0); border-style: solid; } @@ -92,6 +102,13 @@ h1 { rgb(173,175,175) 0% ); + border-color-top: black; + border-color-left: black; + border-color-right: red; + border-color-bottom: rgb(200, 200, 200); + border-style: solid; + border-width: .1em; + text-align: center; } -- 2.43.5