Added an option to define custom window title mappings. (#149)

This commit is contained in:
Jas Singh
2024-08-18 02:07:30 -07:00
committed by GitHub
parent b200b6fadb
commit 6c8615c278
7 changed files with 140 additions and 10 deletions

View File

@@ -1,4 +1,22 @@
export const Label = (name: string, sub = "") => {
export const Label = (name: string, sub = "", subtitleLink = '') => {
const subTitle = () => {
if (subtitleLink.length) {
return Widget.Button({
hpack: "start",
vpack: "center",
class_name: "options-sublabel-link",
label: sub,
// run a bash command to open the link in the default browswer
on_primary_click: () => Utils.execAsync(`bash -c 'xdg-open ${subtitleLink}'`),
})
}
return Widget.Label({
hpack: "start",
vpack: "center",
class_name: "options-sublabel",
label: sub
})
}
return Widget.Box({
vertical: true,
hpack: "start",
@@ -9,12 +27,7 @@ export const Label = (name: string, sub = "") => {
class_name: "options-label",
label: name
}),
Widget.Label({
hpack: "start",
vpack: "center",
class_name: "options-sublabel",
label: sub
}),
subTitle()
]
})
}