✨ ags(bar): peek workspace numbers on workspaces widget hover
This commit is contained in:
@@ -11,6 +11,8 @@ export function Workspaces(): Gtk.Widget {
|
|||||||
return new Widget.EventBox({
|
return new Widget.EventBox({
|
||||||
onScroll: (_, event) =>
|
onScroll: (_, event) =>
|
||||||
event.delta_y > 0 ? hyprland.dispatch("workspace", "e-1") : hyprland.dispatch("workspace", "e+1"),
|
event.delta_y > 0 ? hyprland.dispatch("workspace", "e-1") : hyprland.dispatch("workspace", "e+1"),
|
||||||
|
onHover: () => showWorkspaceNumbers.set(true),
|
||||||
|
onHoverLost: () => showWorkspaceNumbers.set(false),
|
||||||
child: new Widget.Box({
|
child: new Widget.Box({
|
||||||
className: "workspaces",
|
className: "workspaces",
|
||||||
children: bind(hyprland, "workspaces").as((workspaces) => {
|
children: bind(hyprland, "workspaces").as((workspaces) => {
|
||||||
@@ -26,15 +28,19 @@ export function Workspaces(): Gtk.Widget {
|
|||||||
`${focusedWs.id === workspace.id ? "focus" : ""} ${showWsNumbers ? "show" : ""}`
|
`${focusedWs.id === workspace.id ? "focus" : ""} ${showWsNumbers ? "show" : ""}`
|
||||||
)(),
|
)(),
|
||||||
visible: true,
|
visible: true,
|
||||||
tooltipText: bind(workspace, "lastClient").as((lastClient) => `Workspace ${workspace.id}${ lastClient ? ` - ${
|
tooltipText: Variable.derive([
|
||||||
!lastClient.title.toLowerCase().includes(lastClient.class) ?
|
bind(workspace, "lastClient"),
|
||||||
`${lastClient.get_class()}: `
|
bind(hyprland, "focusedWorkspace")
|
||||||
: ""
|
],(lastClient, focusWs) => focusWs.id === workspace.id ? "" :
|
||||||
} ${lastClient.title}` : "" }`),
|
`Workspace ${workspace.id}${ lastClient ? ` - ${
|
||||||
|
!lastClient.title.toLowerCase().includes(lastClient.class) ?
|
||||||
|
`${lastClient.get_class()}: `
|
||||||
|
: ""
|
||||||
|
} ${lastClient.title}` : "" }`)(),
|
||||||
child: new Widget.Box({
|
child: new Widget.Box({
|
||||||
children: [
|
children: [
|
||||||
new Widget.Revealer({
|
new Widget.Revealer({
|
||||||
transitionDuration: 120,
|
transitionDuration: 200,
|
||||||
transitionType: Gtk.RevealerTransitionType.SLIDE_LEFT,
|
transitionType: Gtk.RevealerTransitionType.SLIDE_LEFT,
|
||||||
revealChild: showWorkspaceNumbers(),
|
revealChild: showWorkspaceNumbers(),
|
||||||
child: new Widget.Label({
|
child: new Widget.Label({
|
||||||
|
|||||||
Reference in New Issue
Block a user