Files
custum-hyprpanel/modules/shared/barItemBox.ts
Jas Singh bb6597fe01 Implemented the ability to change workspaces by scrolling or clicking on the workspace module. (#12)
* Updated README to add instructions on Notifications.

* Resolves #8 - Implemented scrolling and clicking to change workspaces.

* Remove the hover effect on workspaces as its no longer applicable.
2024-07-27 20:07:00 -07:00

28 lines
927 B
TypeScript

export const BarItemBox = (child) => {
const computeVisible = () => {
if (Object.hasOwnProperty.call(child, "isVis")) {
return child.isVis.bind("value");
}
return child.isVisible;
};
if (Object.hasOwnProperty.call(child, "useBox") && child.useBox === true) {
return Widget.Box({
class_name: `bar_item_box_visible ${Object.hasOwnProperty.call(child, "boxClass") ? child.boxClass : ""}`,
child: Widget.EventBox({
class_name: `bar-event-box`,
child: child.component,
...child.props,
}),
visible: computeVisible(),
});
}
return Widget.Button({
class_name: `bar_item_box_visible ${Object.hasOwnProperty.call(child, "boxClass") ? child.boxClass : ""}`,
child: child.component,
visible: computeVisible(),
...child.props,
});
};