add on click thing
This commit is contained in:
parent
af34733ecb
commit
d9462251cc
1 changed files with 3 additions and 0 deletions
|
@ -83,10 +83,13 @@ function Workspaces() {
|
||||||
|
|
||||||
const workspaceButtons: number[] = (Array.from({ length: 10 }, (_, id) => id + 1))
|
const workspaceButtons: number[] = (Array.from({ length: 10 }, (_, id) => id + 1))
|
||||||
|
|
||||||
|
const focusWorkspace = (workspaceId: number) => hypr.dispatch("workspace", workspaceId.toString());
|
||||||
|
|
||||||
return <box className="Workspaces">
|
return <box className="Workspaces">
|
||||||
{workspaceButtons.map (workspace =>
|
{workspaceButtons.map (workspace =>
|
||||||
<button
|
<button
|
||||||
className={bind(hypr, "focused_workspace").as(fw => workspace === fw.id ? "focused" : hypr.get_workspace(workspace) ? "" : "inactive" )}
|
className={bind(hypr, "focused_workspace").as(fw => workspace === fw.id ? "focused" : hypr.get_workspace(workspace) ? "" : "inactive" )}
|
||||||
|
onClicked={() => focusWorkspace(workspace)}
|
||||||
>{workspace}</button>
|
>{workspace}</button>
|
||||||
)}
|
)}
|
||||||
</box>
|
</box>
|
||||||
|
|
Loading…
Reference in a new issue