From 5eb5f5478ef13201cd61289cec6defe39ebf19ce Mon Sep 17 00:00:00 2001
From: matt1432 <matt@nelim.org>
Date: Wed, 20 Sep 2023 14:46:39 -0400
Subject: [PATCH] refactor(ags): move transition to css file for overview

---
 config/ags/js/overview/main.js        | 11 +++++------
 config/ags/scss/widgets/overview.scss |  3 +++
 config/ags/style.css                  |  3 ++-
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/config/ags/js/overview/main.js b/config/ags/js/overview/main.js
index 61a8147d..48980560 100644
--- a/config/ags/js/overview/main.js
+++ b/config/ags/js/overview/main.js
@@ -79,7 +79,8 @@ export const Overview = Window({
               }
 
               // Special workspaces that haven't been opened yet
-              // return a size of 0.
+              // return a size of 0. We need to set them to default
+              // values to show the workspace properly
               if (app.size[0] === 0) {
                 app.size[0] = DEFAULT_SPECIAL.SIZE_X;
                 app.size[1] = DEFAULT_SPECIAL.SIZE_Y;
@@ -98,8 +99,7 @@ export const Overview = Window({
                 );
                 existingApp.child.className = `window ${active}`;
                 existingApp.child.style = `min-width: ${app.size[0] * SCALE - MARGIN}px;
-                                           min-height: ${app.size[1] * SCALE - MARGIN}px;
-                                           transition: min-width 0.2s ease, min-height 0.2s ease`;
+                                           min-height: ${app.size[1] * SCALE - MARGIN}px;`;
               }
               else {
                 fixed.put(
@@ -115,8 +115,7 @@ export const Overview = Window({
                     child: Icon({
                       className: `window ${active}`,
                       style: `min-width: ${app.size[0] * SCALE - MARGIN}px;
-                              min-height: ${app.size[1] * SCALE - MARGIN}px;
-                              transition: min-width 0.2s ease, min-height 0.2s ease`,
+                              min-height: ${app.size[1] * SCALE - MARGIN}px;`,
                       icon: app.class,
                       size: 40,
                     }),
@@ -169,7 +168,7 @@ export const Overview = Window({
             );
           });
           box.show_all();
-          if (box.children[0].centerWidget.children.length > 0) {
+          if (box._workspaces.length > 0) {
             Hyprland.instance.disconnect(id);
             box._canUpdate = true;
             box._updateApps(box);
diff --git a/config/ags/scss/widgets/overview.scss b/config/ags/scss/widgets/overview.scss
index 2b02adb8..f82b1f9c 100644
--- a/config/ags/scss/widgets/overview.scss
+++ b/config/ags/scss/widgets/overview.scss
@@ -5,6 +5,9 @@
   .workspace .window {
     border-radius: 10px;
     margin: 0 10px;
+    transition: min-width 0.2s ease-in-out,
+                min-height 0.2s ease-in-out,
+                border-color 0.2s ease-in-out;
   }
 
   .normal {
diff --git a/config/ags/style.css b/config/ags/style.css
index a09936a1..e33808f3 100644
--- a/config/ags/style.css
+++ b/config/ags/style.css
@@ -670,7 +670,8 @@ calendar:indeterminate {
   min-width: 1px; }
   .overview .workspace .window {
     border-radius: 10px;
-    margin: 0 10px; }
+    margin: 0 10px;
+    transition: min-width 0.2s ease-in-out, min-height 0.2s ease-in-out, border-color 0.2s ease-in-out; }
   .overview .normal {
     margin-bottom: 5px; }
     .overview .normal .workspace .window {