fix(ags overlay): remove unintended margin changes on workspaces

This commit is contained in:
matt1432 2023-10-02 14:17:48 -04:00
parent 9972be9b19
commit 5f788c81fb
2 changed files with 33 additions and 21 deletions

View file

@ -72,7 +72,7 @@ export function updateClients(box) {
let clients = JSON.parse(result).filter(client => client.class) let clients = JSON.parse(result).filter(client => client.class)
box._workspaces.forEach(workspace => { 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(); let toRemove = fixed.get_children();
clients.filter(client => client.workspace.id == workspace._id).forEach(client => { clients.filter(client => client.workspace.id == workspace._id).forEach(client => {

View file

@ -60,18 +60,24 @@ export const WorkspaceRow = (className, i) => Revealer({
className: 'workspace', className: 'workspace',
style: DEFAULT_STYLE, style: DEFAULT_STYLE,
}), }),
overlays: [Box({ overlays: [
style: DEFAULT_STYLE, Box({
children: [ className: 'workspace active',
Widget({ style: `${DEFAULT_STYLE} opacity: 0;`,
type: Gtk.Fixed, }),
}), Box({
Label({ style: DEFAULT_STYLE,
label: ' +', children: [
style: 'font-size: 40px;', 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 activeId = Hyprland.active.workspace.id;
let active = activeId === box._id; let active = activeId === box._id;
let rev = box.child.child.child; let rev = box.child.child.overlays[0];
let n = activeId > box._id; let n = activeId > box._id;
if (Hyprland.getWorkspace(box._id)?.windows > 0 || active) { if (Hyprland.getWorkspace(box._id)?.windows > 0 || active) {
@ -144,15 +150,21 @@ const Workspace = (id, name) => Revealer({
child: Overlay({ child: Overlay({
child: Box({ child: Box({
className: 'workspace active', className: 'workspace active',
style: `${DEFAULT_STYLE} opacity: 0;`, style: `${DEFAULT_STYLE} opacity: 0;`,
}), }),
overlays: [Box({ overlays: [
className: 'workspace', Box({
style: DEFAULT_STYLE, className: 'workspace active',
child: Widget({ style: `${DEFAULT_STYLE} opacity: 0;`,
type: Gtk.Fixed,
}), }),
})], Box({
className: 'workspace',
style: DEFAULT_STYLE,
child: Widget({
type: Gtk.Fixed,
}),
})
],
}), }),
}), }),
}); });