nixos-configs/modules/ags/config/ts/bar/hovers/hover-revealer.ts
matt1432 a0014161ce
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(ags): move wim and binto configs together under modules
2024-01-17 19:18:41 -05:00

42 lines
769 B
TypeScript

import { Box, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../../misc/separator.ts';
import CursorBox from '../../misc/cursorbox.ts';
export default ({
class_name,
icon,
label,
spacing = 5,
}) => {
const hoverRevLabel = Revealer({
transition: 'slide_right',
child: Box({
children: [
Separator(spacing),
label,
],
}),
});
const widget = CursorBox({
on_hover: () => {
hoverRevLabel.reveal_child = true;
},
child: Box({
class_name,
children: [
icon,
hoverRevLabel,
],
}),
});
return widget;
};