add crosshair

This commit is contained in:
end-4
2024-05-16 13:21:46 +07:00
parent e1f6a01321
commit f98a1caae7
5 changed files with 95 additions and 1 deletions
@@ -49,6 +49,12 @@ let configOptions = {
'default': "auto",
},
},
'gaming': {
'crosshair': {
'size': 20,
'color': 'rgba(113,227,32,0.9)',
},
},
'music': {
'preferredPlayer': "plasma-browser-integration",
},
+21
View File
@@ -0,0 +1,21 @@
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import { enableClickthrough } from "../.widgetutils/clickthrough.js";
import { RoundedCorner } from "../.commonwidgets/cairo_roundedcorner.js";
export default (monitor = 0, ) => {
return Widget.Window({
monitor,
name: `crosshair${monitor}`,
layer: 'overlay',
exclusivity: 'ignore',
child: Widget.Icon({
icon: 'crosshair-symbolic',
css: `
font-size: ${userOptions.gaming.crosshair.size}px;
color: ${userOptions.gaming.crosshair.color};
`,
}),
setup: enableClickthrough,
});
}