refactor(ags): move transition to css file for overview

This commit is contained in:
matt1432 2023-09-20 14:46:39 -04:00
parent bf5f236938
commit 5eb5f5478e
3 changed files with 10 additions and 7 deletions

View file

@ -79,7 +79,8 @@ export const Overview = Window({
} }
// Special workspaces that haven't been opened yet // 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) { if (app.size[0] === 0) {
app.size[0] = DEFAULT_SPECIAL.SIZE_X; app.size[0] = DEFAULT_SPECIAL.SIZE_X;
app.size[1] = DEFAULT_SPECIAL.SIZE_Y; app.size[1] = DEFAULT_SPECIAL.SIZE_Y;
@ -98,8 +99,7 @@ export const Overview = Window({
); );
existingApp.child.className = `window ${active}`; existingApp.child.className = `window ${active}`;
existingApp.child.style = `min-width: ${app.size[0] * SCALE - MARGIN}px; existingApp.child.style = `min-width: ${app.size[0] * SCALE - MARGIN}px;
min-height: ${app.size[1] * SCALE - MARGIN}px; min-height: ${app.size[1] * SCALE - MARGIN}px;`;
transition: min-width 0.2s ease, min-height 0.2s ease`;
} }
else { else {
fixed.put( fixed.put(
@ -115,8 +115,7 @@ export const Overview = Window({
child: Icon({ child: Icon({
className: `window ${active}`, className: `window ${active}`,
style: `min-width: ${app.size[0] * SCALE - MARGIN}px; style: `min-width: ${app.size[0] * SCALE - MARGIN}px;
min-height: ${app.size[1] * SCALE - MARGIN}px; min-height: ${app.size[1] * SCALE - MARGIN}px;`,
transition: min-width 0.2s ease, min-height 0.2s ease`,
icon: app.class, icon: app.class,
size: 40, size: 40,
}), }),
@ -169,7 +168,7 @@ export const Overview = Window({
); );
}); });
box.show_all(); box.show_all();
if (box.children[0].centerWidget.children.length > 0) { if (box._workspaces.length > 0) {
Hyprland.instance.disconnect(id); Hyprland.instance.disconnect(id);
box._canUpdate = true; box._canUpdate = true;
box._updateApps(box); box._updateApps(box);

View file

@ -5,6 +5,9 @@
.workspace .window { .workspace .window {
border-radius: 10px; 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;
} }
.normal { .normal {

View file

@ -670,7 +670,8 @@ calendar:indeterminate {
min-width: 1px; } min-width: 1px; }
.overview .workspace .window { .overview .workspace .window {
border-radius: 10px; 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 { .overview .normal {
margin-bottom: 5px; } margin-bottom: 5px; }
.overview .normal .workspace .window { .overview .normal .workspace .window {