[gnome-shell] boxpointer: Use the -arrow-rise as padding instead of a magic number



commit 43caace1b6918890fd9b5893ffd2cf34406089a5
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Sep 1 00:49:14 2012 +0200

    boxpointer: Use the -arrow-rise as padding instead of a magic number
    
    This makes sense if we want to follow what the following comment says:
    // We also want to keep it onscreen, and separated from the
    // edge by the same distance as the main part of the box is
    // separated from its sourceActor
    
    Using a magic number violates the "separated from the edge ...
    separated from its sourceActor" part.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682343

 js/ui/boxpointer.js |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index 03d114b..17c1801 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -410,6 +410,7 @@ const BoxPointer = new Lang.Class({
 
         let themeNode = this.actor.get_theme_node();
         let gap = themeNode.get_length('-boxpointer-gap');
+        let padding = themeNode.get_length('-arrow-rise');
 
         let resX, resY;
 
@@ -435,8 +436,8 @@ const BoxPointer = new Lang.Class({
         case St.Side.BOTTOM:
             resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment);
 
-            resX = Math.max(resX, monitor.x + 10);
-            resX = Math.min(resX, monitor.x + monitor.width - (10 + natWidth));
+            resX = Math.max(resX, monitor.x + padding);
+            resX = Math.min(resX, monitor.x + monitor.width - (padding + natWidth));
             this.setArrowOrigin(sourceCenterX - resX);
             break;
 
@@ -444,8 +445,8 @@ const BoxPointer = new Lang.Class({
         case St.Side.RIGHT:
             resY = sourceCenterY - (halfMargin + (natHeight - margin) * alignment);
 
-            resY = Math.max(resY, monitor.y + 10);
-            resY = Math.min(resY, monitor.y + monitor.height - (10 + natHeight));
+            resY = Math.max(resY, monitor.y + padding);
+            resY = Math.min(resY, monitor.y + monitor.height - (padding + natHeight));
 
             this.setArrowOrigin(sourceCenterY - resY);
             break;



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