[the-board] [things] Keep video controls visible while Video thing is active



commit ae0c2c4f569e4fd818191f8fb6b33fb3cb6e5b50
Author: Lucas Rocha <lucasr gnome org>
Date:   Thu Jan 6 12:11:40 2011 +0000

    [things] Keep video controls visible while Video thing is active

 src/js/ui/things/video.js |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/src/js/ui/things/video.js b/src/js/ui/things/video.js
index d31b0f9..d06c3f2 100644
--- a/src/js/ui/things/video.js
+++ b/src/js/ui/things/video.js
@@ -344,6 +344,8 @@ VideoThing.prototype = {
             }
         }
 
+        this._updateControlsVisibility();
+
         if (!fromState) {
             this.emit('save');
         }
@@ -484,6 +486,17 @@ VideoThing.prototype = {
                                this._formatTimeComponent(seconds);
     },
 
+    _updateControlsVisibility : function() {
+        let visible = this._videoFilename &&
+                      (this.hover || this.active);
+
+        if (visible) {
+            this._showVideoControlsBox();
+        } else {
+            this._hideVideoControlsBox();
+        }
+    },
+
     _onCaptionTextKeyPressEvent : function(o, event) {
         let key = event.get_key_symbol();
 
@@ -540,22 +553,22 @@ VideoThing.prototype = {
     },
 
     enter : function() {
-        if (this._videoFilename) {
-            this._showVideoControlsBox();
-        }
+        this._updateControlsVisibility();
     },
 
     leave : function() {
-        this._hideVideoControlsBox();
+        this._updateControlsVisibility();
     },
 
     activate : function() {
         this._captionLabel.clutterText.editable = true;
         this._captionLabel.clutterText.grab_key_focus();
+        this._updateControlsVisibility();
     },
 
     deactivate : function() {
         this._captionLabel.clutterText.editable = false;
+        this._updateControlsVisibility();
     },
 
     loadState : function(state) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]