added stuff
This commit is contained in:
parent
e8d9044d2b
commit
9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions
36
nyx/homes/notashelf/services/wayland/ags/js/utils/desktop.js
Normal file
36
nyx/homes/notashelf/services/wayland/ags/js/utils/desktop.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { Widget } from "../imports.js";
|
||||
import { queryExact } from "./global.js";
|
||||
const { Box, Icon, Label, Button } = Widget;
|
||||
|
||||
/**
|
||||
* Builds a desktop item with a specific name and label.
|
||||
* It uses the `queryExact` function to find the exact application based on its name.
|
||||
* Then, it creates a button widget with the application's icon and label.
|
||||
* When the button is clicked, it launches the application.
|
||||
*
|
||||
* @function buildDesktopItem
|
||||
* @param {string} name - The name of the application.
|
||||
* @param {string} label - The label of the desktop item.
|
||||
* @returns {Object} The desktop item widget.
|
||||
*/
|
||||
export const buildDesktopItem = (name, label) => {
|
||||
const app = queryExact(name);
|
||||
return Button({
|
||||
className: "desktopIcon",
|
||||
cursor: "pointer",
|
||||
onClicked: () => app.launch(),
|
||||
child: Box({
|
||||
vertical: true,
|
||||
children: [
|
||||
Icon({
|
||||
icon: app.iconName,
|
||||
size: 48,
|
||||
}),
|
||||
Label({
|
||||
className: "desktopIconLabel",
|
||||
label,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue