ags: optimizations, add media and separator widgets

This commit is contained in:
retrozinndev
2025-01-23 14:06:33 -03:00
parent b533e830a0
commit 017619f62b
9 changed files with 151 additions and 31 deletions
+27
View File
@@ -0,0 +1,27 @@
import { Gtk, Widget } from "astal/gtk3";
export interface SeparatorProps {
class?: string;
alpha?: number;
cssColor?: string;
orientation?: Gtk.Orientation;
size?: number;
}
export function Separator(props: SeparatorProps) {
return new Widget.Box({
className: `separator separator-${ props.orientation == Gtk.Orientation.VERTICAL ? "vertical" : "horizontal" } ${ props.class && props.class }`,
css: `.separator {
background: ${ props.cssColor ? props.cssColor : "lightgray" };
opacity: ${ props.alpha ? props.alpha : 1 };
}
.separator-horizontal {
padding-right: ${props.size ? props.size : 1 }px;
margin: 7px 4px;
}
.separator-vertical {
padding-bottom: ${props.size ? props.size : 1 }px;
margin: 4px 7px;
}`,
} as Widget.BoxProps);
}