[gnome-shell/wip/paging-release2: 13/20] boxPointer, appDisplay: Add functions to query popup and boxpointer offsets



commit 2c6ea8412e4b67548ed4ea4a8ab5f027d36e3688
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Fri Aug 23 11:22:58 2013 +0200

    boxPointer, appDisplay: Add functions to query popup and boxpointer offsets
    
    It will be necesary in the upcomming patch with the new implementation
    of the folder view, to maintain the view contained without cut off
    the popup or the close button.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706081

 js/ui/appDisplay.js |   13 +++++++++++++
 js/ui/boxpointer.js |    8 ++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index ff7a353..d97c658 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1044,6 +1044,19 @@ const AppFolderPopup = new Lang.Class({
                               BoxPointer.PopupAnimation.SLIDE);
         this._isOpen = false;
         this.emit('open-state-changed', false);
+    },
+
+    getOffset: function (element, side) {
+        let offset;
+        if (element == 'closeButtonOverlap')
+            offset = this.closeButton.get_theme_node().get_length('-shell-close-overlap-y');
+        else
+        if (element == 'arrowHeight')
+            offset = this._boxPointer.getArrowHeight();
+        else
+        if (element == 'padding')
+            offset = this._boxPointer.getPadding(side);
+        return offset;
     }
 });
 Signals.addSignalMethods(AppFolderPopup.prototype);
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index 2fd1a67..833d299 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -639,5 +639,13 @@ const BoxPointer = new Lang.Class({
 
     get opacity() {
         return this.actor.opacity;
+    },
+
+    getPadding: function(side) {
+        return this.bin.get_theme_node().get_padding(side);
+    },
+    
+    getArrowHeight: function() {
+        return this.actor.get_theme_node().get_length('-arrow-rise');
     }
 });


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