Clean up media module logic and code. (#380)

* Organized media menu code

* More consolidation
This commit is contained in:
Jas Singh
2024-10-27 00:17:51 -07:00
committed by GitHub
parent 86ff27fd3e
commit 14654998ea
23 changed files with 511 additions and 427 deletions

View File

@@ -55,25 +55,28 @@ export const module = ({
},
),
tooltip_text: tooltipText,
children: Utils.merge([showLabelBinding, useTextIcon], (showLabel, forceTextIcon): Gtk.Widget[] => {
const childrenArray: Gtk.Widget[] = [];
const iconWidget = getIconWidget(forceTextIcon);
children: Utils.merge(
[showLabelBinding, useTextIcon],
(showLabel: boolean, forceTextIcon: boolean): Gtk.Widget[] => {
const childrenArray: Gtk.Widget[] = [];
const iconWidget = getIconWidget(forceTextIcon);
if (iconWidget !== undefined) {
childrenArray.push(iconWidget);
}
if (iconWidget !== undefined) {
childrenArray.push(iconWidget);
}
if (showLabel) {
childrenArray.push(
Widget.Label({
class_name: `bar-button-label module-label ${boxClass}`,
label: label,
setup: labelHook,
}),
);
}
return childrenArray;
}),
if (showLabel) {
childrenArray.push(
Widget.Label({
class_name: `bar-button-label module-label ${boxClass}`,
label: label,
setup: labelHook,
}),
);
}
return childrenArray;
},
),
setup: hook,
}),
tooltip_text: tooltipText,