hyprpanel
This commit is contained in:
1 parent
10080a83ee
commit
5151ac24da
322 files changed
+38276
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { GBox, GButton, GLabel } from 'lib/types/widget';
|
||||
|
||||
export const Label = (name: string, sub = '', subtitleLink = ''): GBox => {
|
||||
const subTitle = (): GButton | GLabel => {
|
||||
if (subtitleLink.length) {
|
||||
return Widget.Button({
|
||||
hpack: 'start',
|
||||
vpack: 'center',
|
||||
class_name: 'options-sublabel-link',
|
||||
label: sub,
|
||||
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',
|
||||
children: [
|
||||
Widget.Label({
|
||||
hpack: 'start',
|
||||
vpack: 'center',
|
||||
class_name: 'options-label',
|
||||
label: name,
|
||||
}),
|
||||
subTitle(),
|
||||
],
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user