fix(ags corners): fix standalone corners not showing

This commit is contained in:
matt1432 2023-10-22 01:37:07 -04:00
parent d8cdcda982
commit cfeba78d79

View file

@ -2,11 +2,17 @@ import { Widget } from '../imports.js';
const { Gtk } = imports.gi;
const Lang = imports.lang;
export const RoundedCorner = (place, props) => Widget({
...props,
type: Gtk.DrawingArea,
export const RoundedCorner = (place, props) => Widget.Box({
halign: place.includes('left') ? 'start' : 'end',
valign: place.includes('top') ? 'start' : 'end',
style: `padding: 1px; margin:
${place.includes('top') ? '-1px' : '0'}
${place.includes('right') ? '-1px' : '0'}
${place.includes('bottom') ? '-1px' : '0'}
${place.includes('left') ? '-1px' : '0'};`,
child: Widget({
...props,
type: Gtk.DrawingArea,
setup: widget => {
const r = widget.get_style_context()
.get_property('border-radius', Gtk.StateFlags.NORMAL);
@ -60,6 +66,7 @@ export const RoundedCorner = (place, props) => Widget({
cr.stroke();
}));
},
}),
});
export const Topleft = () => Widget.Window({