From 5f788c81fb54e51256f2d2da0ea2dd4f6998ff90 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 2 Oct 2023 14:17:48 -0400 Subject: [PATCH] fix(ags overlay): remove unintended margin changes on workspaces --- config/ags/js/overview/clients.js | 2 +- config/ags/js/overview/workspaces.js | 52 +++++++++++++++++----------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/config/ags/js/overview/clients.js b/config/ags/js/overview/clients.js index a254314f..5f75c336 100644 --- a/config/ags/js/overview/clients.js +++ b/config/ags/js/overview/clients.js @@ -72,7 +72,7 @@ export function updateClients(box) { let clients = JSON.parse(result).filter(client => client.class) box._workspaces.forEach(workspace => { - let fixed = workspace.child.child.overlays[0].children[0]; + let fixed = workspace.child.child.overlays[1].children[0]; let toRemove = fixed.get_children(); clients.filter(client => client.workspace.id == workspace._id).forEach(client => { diff --git a/config/ags/js/overview/workspaces.js b/config/ags/js/overview/workspaces.js index c076fd3e..99ac67f8 100644 --- a/config/ags/js/overview/workspaces.js +++ b/config/ags/js/overview/workspaces.js @@ -60,18 +60,24 @@ export const WorkspaceRow = (className, i) => Revealer({ className: 'workspace', style: DEFAULT_STYLE, }), - overlays: [Box({ - style: DEFAULT_STYLE, - children: [ - Widget({ - type: Gtk.Fixed, - }), - Label({ - label: ' +', - style: 'font-size: 40px;', - }), - ], - })], + overlays: [ + Box({ + className: 'workspace active', + style: `${DEFAULT_STYLE} opacity: 0;`, + }), + Box({ + style: DEFAULT_STYLE, + children: [ + Widget({ + type: Gtk.Fixed, + }), + Label({ + label: ' +', + style: 'font-size: 40px;', + }), + ], + }) + ], }), }), }), @@ -96,7 +102,7 @@ const Workspace = (id, name) => Revealer({ let activeId = Hyprland.active.workspace.id; let active = activeId === box._id; - let rev = box.child.child.child; + let rev = box.child.child.overlays[0]; let n = activeId > box._id; if (Hyprland.getWorkspace(box._id)?.windows > 0 || active) { @@ -144,15 +150,21 @@ const Workspace = (id, name) => Revealer({ child: Overlay({ child: Box({ className: 'workspace active', - style: `${DEFAULT_STYLE} opacity: 0;`, + style: `${DEFAULT_STYLE} opacity: 0;`, }), - overlays: [Box({ - className: 'workspace', - style: DEFAULT_STYLE, - child: Widget({ - type: Gtk.Fixed, + overlays: [ + Box({ + className: 'workspace active', + style: `${DEFAULT_STYLE} opacity: 0;`, }), - })], + Box({ + className: 'workspace', + style: DEFAULT_STYLE, + child: Widget({ + type: Gtk.Fixed, + }), + }) + ], }), }), });