nixos-configs/devices/wim/config/ags/js/bar/hovers/hover-revealer.js
matt1432 3b4a541d2e
All checks were successful
Discord / discord commits (push) Has been skipped
refactor: (ags bar): make hover revs more consistent
2023-12-28 00:19:57 -05:00

42 lines
769 B
JavaScript

import { Box, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../../misc/separator.js';
import CursorBox from '../../misc/cursorbox.js';
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;
};