Cava Module (#662)

* First version of the cava module

* Update cava stuff

* Update themes for cava

* Update themes

* Handle cava visibility when null

* Add bar characters in options

---------

Co-authored-by: Ed Bennett <ed@dodimead.com>
Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
Ed Bennett
2025-01-03 06:45:37 +00:00
committed by GitHub
parent a071e4c17d
commit 6efcd60467
56 changed files with 3065 additions and 2605 deletions

View File

@@ -5,8 +5,6 @@ import options from 'src/options';
const { style } = options.theme.bar.buttons;
const undefinedVar = Variable(undefined);
export const Module = ({
icon,
textIcon,
@@ -16,7 +14,8 @@ export const Module = ({
boxClass,
isVis,
props = {},
showLabelBinding = bind(undefinedVar),
showLabelBinding = bind(Variable(true)),
showIconBinding = bind(Variable(true)),
showLabel,
labelHook,
hook,
@@ -48,12 +47,12 @@ export const Module = ({
);
const componentChildren = Variable.derive(
[showLabelBinding, useTextIcon],
(showLabel: boolean, forceTextIcon: boolean): JSX.Element[] => {
[showLabelBinding, showIconBinding, useTextIcon],
(showLabel: boolean, showIcon: boolean, forceTextIcon: boolean): JSX.Element[] => {
const childrenArray = [];
const iconWidget = getIconWidget(forceTextIcon);
if (iconWidget !== undefined) {
if (showIcon && iconWidget !== undefined) {
childrenArray.push(iconWidget);
}