[sushi/wip/cosimoc/no-clutter: 45/67] mainWindow: remove old hardcoded padding



commit 03d2fa3cf7dedddd8c4e0e563c602ce4bf3d58bf
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Apr 2 17:20:59 2017 -0700

    mainWindow: remove old hardcoded padding

 src/js/ui/mainWindow.js  |   11 +++++------
 src/js/util/constants.js |    2 --
 2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 3a22790..7dde23f 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -154,8 +154,8 @@ const MainWindow = new Lang.Class({
         let screenSize = [ this._gtkWindow.get_window().get_width(),
                            this._gtkWindow.get_window().get_height() ];
 
-        let availableWidth = this._isFullScreen ? screenSize[0] : Constants.VIEW_MAX_W - 2 * 
Constants.VIEW_PADDING_X;
-        let availableHeight = this._isFullScreen ? screenSize[1] : Constants.VIEW_MAX_H - 
Constants.VIEW_PADDING_Y;
+        let availableWidth = this._isFullScreen ? screenSize[0] : Constants.VIEW_MAX_W;
+        let availableHeight = this._isFullScreen ? screenSize[1] : Constants.VIEW_MAX_H;
 
         let textureSize = this._renderer.getSizeForAllocation([availableWidth, availableHeight], 
this._isFullScreen);
 
@@ -166,12 +166,11 @@ const MainWindow = new Lang.Class({
         let textureSize = this._getTextureSize();
         let windowSize = textureSize;
 
-        if (textureSize[0] < (Constants.VIEW_MIN - 2 * Constants.VIEW_PADDING_X) &&
-            textureSize[1] < (Constants.VIEW_MIN - Constants.VIEW_PADDING_Y)) {
+        if (textureSize[0] < Constants.VIEW_MIN &&
+            textureSize[1] < Constants.VIEW_MIN) {
             windowSize = [ Constants.VIEW_MIN, Constants.VIEW_MIN ];
         } else if (!this._isFullScreen) {
-            windowSize = [ windowSize[0] + 2 * Constants.VIEW_PADDING_X,
-                           windowSize[1] + Constants.VIEW_PADDING_Y ];
+            windowSize = [ windowSize[0], windowSize[1] ];
         }
 
         return windowSize;
diff --git a/src/js/util/constants.js b/src/js/util/constants.js
index d6dcf14..0bd7401 100644
--- a/src/js/util/constants.js
+++ b/src/js/util/constants.js
@@ -25,8 +25,6 @@
 
 let VIEW_MIN = 400;
 let VIEW_BACKGROUND_OPACITY = 220;
-let VIEW_PADDING_Y = 28;
-let VIEW_PADDING_X = 2;
 let VIEW_MAX_W = 800;
 let VIEW_MAX_H = 600;
 let TOOLBAR_SPACING = 32;


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