Updated popup menu layouts and fixed workspace behavior. (#687)
This commit is contained in:
@@ -94,13 +94,15 @@ function isWorkspaceValidForMonitor(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const currentMonitorName = monitorNameMap[monitorId];
|
const currentMonitorName = monitorNameMap[monitorId];
|
||||||
const currentMonitorWorkspaceRules = workspaceMonitorRules[currentMonitorName];
|
const currentMonitorWorkspaceRules = workspaceMonitorRules[currentMonitorName] ?? [];
|
||||||
|
const activeWorkspaceIds = new Set(allWorkspaceInstances.map((ws) => ws.id));
|
||||||
|
const filteredWorkspaceRules = currentMonitorWorkspaceRules.filter((ws) => !activeWorkspaceIds.has(ws));
|
||||||
|
|
||||||
if (currentMonitorWorkspaceRules === undefined) {
|
if (filteredWorkspaceRules === undefined) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return currentMonitorWorkspaceRules.includes(workspaceId);
|
return filteredWorkspaceRules.includes(workspaceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -319,6 +321,12 @@ export function getWorkspacesToRender(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const activeWorkspacesForCurrentMonitor = activeWorkspaceIds.filter((workspaceId) => {
|
const activeWorkspacesForCurrentMonitor = activeWorkspaceIds.filter((workspaceId) => {
|
||||||
|
const metadataForWorkspace = allWorkspaceInstances.find((workspaceObj) => workspaceObj.id === workspaceId);
|
||||||
|
|
||||||
|
if (metadataForWorkspace) {
|
||||||
|
return metadataForWorkspace?.monitor?.id === monitorId;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
currentMonitorInstance &&
|
currentMonitorInstance &&
|
||||||
Object.hasOwnProperty.call(workspaceMonitorRules, currentMonitorInstance.name) &&
|
Object.hasOwnProperty.call(workspaceMonitorRules, currentMonitorInstance.name) &&
|
||||||
@@ -326,8 +334,6 @@ export function getWorkspacesToRender(
|
|||||||
) {
|
) {
|
||||||
return workspaceMonitorRules[currentMonitorInstance.name].includes(workspaceId);
|
return workspaceMonitorRules[currentMonitorInstance.name].includes(workspaceId);
|
||||||
}
|
}
|
||||||
const metadataForWorkspace = allWorkspaceInstances.find((workspaceObj) => workspaceObj.id === workspaceId);
|
|
||||||
return metadataForWorkspace?.monitor?.id === monitorId;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isMonitorSpecific) {
|
if (isMonitorSpecific) {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { App, Gtk } from 'astal/gtk3';
|
|||||||
import { bind } from 'astal';
|
import { bind } from 'astal';
|
||||||
|
|
||||||
export default (): JSX.Element => (
|
export default (): JSX.Element => (
|
||||||
<PopupWindow name="verification" transition="crossfade">
|
<PopupWindow name="verification" transition="crossfade" layout={'center'}>
|
||||||
<box className="verification">
|
<box className="verification" expand={false}>
|
||||||
<box className="verification-content" expand vertical>
|
<box className="verification-content" expand vertical>
|
||||||
<box className="text-box" vertical>
|
<box className="text-box" vertical>
|
||||||
<label className="title" label={bind(powermenu, 'title').as((t) => t.toUpperCase())} />
|
<label className="title" label={bind(powermenu, 'title').as((t) => t.toUpperCase())} />
|
||||||
|
|||||||
@@ -57,8 +57,7 @@ const Layout: LayoutFunction = (name: string, child: GtkWidget, transition: Gtk.
|
|||||||
'top-right': () => (
|
'top-right': () => (
|
||||||
<box>
|
<box>
|
||||||
<Padding name={name} />
|
<Padding name={name} />
|
||||||
<box hexpand vertical>
|
<box hexpand={false} vertical>
|
||||||
<Padding name={name} opts={{ vexpand: false, className: 'event-top-padding' }} />
|
|
||||||
<PopupRevealer name={name} child={child} transition={transition} />
|
<PopupRevealer name={name} child={child} transition={transition} />
|
||||||
<Padding name={name} />
|
<Padding name={name} />
|
||||||
</box>
|
</box>
|
||||||
@@ -77,9 +76,7 @@ const Layout: LayoutFunction = (name: string, child: GtkWidget, transition: Gtk.
|
|||||||
),
|
),
|
||||||
'top-left': () => (
|
'top-left': () => (
|
||||||
<box>
|
<box>
|
||||||
<Padding name={name} />
|
|
||||||
<box hexpand={false} vertical>
|
<box hexpand={false} vertical>
|
||||||
<Padding name={name} opts={{ vexpand: false, className: 'event-top-padding' }} />
|
|
||||||
<PopupRevealer name={name} child={child} transition={transition} />
|
<PopupRevealer name={name} child={child} transition={transition} />
|
||||||
<Padding name={name} />
|
<Padding name={name} />
|
||||||
</box>
|
</box>
|
||||||
|
|||||||
Reference in New Issue
Block a user