💥 fix: correctly use centerbox with gtkbuilder types, fix styles
also re-added some windows to the windows list(they were causing issues before)
This commit is contained in:
@@ -40,7 +40,7 @@ export function NotificationWidget({ notification, actionClicked, holdOnHover, s
|
||||
|
||||
const conns: Map<GObject.Object, Array<number>> = new Map();
|
||||
|
||||
return <Gtk.Box hexpand={true} vexpand={true} class={`notification ${
|
||||
return <Gtk.Box hexpand={false} vexpand={false} class={`notification ${
|
||||
Notifications.getDefault().getUrgencyString(notification.urgency)
|
||||
}`} orientation={Gtk.Orientation.VERTICAL} spacing={5}
|
||||
$={(self) => {
|
||||
@@ -102,11 +102,14 @@ export function NotificationWidget({ notification, actionClicked, holdOnHover, s
|
||||
<Gtk.Label class={"summary"} useMarkup={true} xalign={0}
|
||||
ellipsize={Pango.EllipsizeMode.END} label={
|
||||
notification.summary.replace(/[&]/g, "&")
|
||||
} />
|
||||
}
|
||||
/>
|
||||
|
||||
<Gtk.Label class={"body"} useMarkup={true} xalign={0} wrap={true}
|
||||
wrapMode={Pango.WrapMode.WORD_CHAR} singleLineMode={false}
|
||||
label={notification.body.replace(/[&]/g, "&")} />
|
||||
wrapMode={Pango.WrapMode.WORD_CHAR} label={
|
||||
notification.body.replace(/[&]/g, "&")
|
||||
}
|
||||
/>
|
||||
</Gtk.Box>
|
||||
</Gtk.Box>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { omitObjectKeys, WidgetNodeType } from "../scripts/utils";
|
||||
|
||||
|
||||
type PopupWindowSpecificProps = {
|
||||
$?: (self: Astal.Window) => void;
|
||||
children?: WidgetNodeType;
|
||||
onDestroy?: (self: Astal.Window) => void;
|
||||
/** Stylesheet for the background of the popup-window */
|
||||
@@ -57,7 +58,7 @@ export function PopupWindow(props: PopupWindowProps): GObject.Object {
|
||||
"marginBottom"
|
||||
]);
|
||||
|
||||
return <Astal.Window {...omittedProps}
|
||||
return <Astal.Window {...omittedProps} visible
|
||||
namespace={props.namespace ?? "popup-window"} class={
|
||||
(props.class instanceof Accessor) ?
|
||||
((props.namespace instanceof Accessor) ?
|
||||
@@ -110,6 +111,8 @@ export function PopupWindow(props: PopupWindowProps): GObject.Object {
|
||||
|
||||
conns.set(self, self.connect("destroy", () => conns.forEach((id, obj) =>
|
||||
obj.disconnect(id))));
|
||||
|
||||
props.$?.(self);
|
||||
}}>
|
||||
<Gtk.Box
|
||||
halign={props.halign}
|
||||
|
||||
@@ -28,8 +28,8 @@ export function Separator(props: SeparatorProps = {
|
||||
hexpand={props.orientation === Gtk.Orientation.VERTICAL}
|
||||
class={`separator ${ props.orientation === Gtk.Orientation.VERTICAL ?
|
||||
"vertical" : "horizontal" }`} visible={props.visible}
|
||||
css={`.vertical { padding: {${props.spacing ?? 0}px ${props.margin ?? 7}px; }
|
||||
.horizontal { padding: {${props.margin ?? 4}px ${props.spacing ?? 0}px; }`}>
|
||||
css={`.vertical { padding: ${props.spacing ?? 0}px ${props.margin ?? 7}px; }
|
||||
.horizontal { padding: ${props.margin ?? 4}px ${props.spacing ?? 0}px; }`}>
|
||||
|
||||
<Gtk.Box class={`${props.orientation === Gtk.Orientation.VERTICAL ?
|
||||
"vertical"
|
||||
|
||||
@@ -19,7 +19,7 @@ export const FocusedClient = () => {
|
||||
getSymbolicIcon(clss) ?? getAppIcon(clss) ??
|
||||
getAppIcon(focusedClient.initialClass) ??
|
||||
"application-x-executable-symbolic")
|
||||
} css={"font-size: 18px;"} vexpand={true} />
|
||||
} vexpand={true} />
|
||||
|
||||
<Gtk.Box valign={Gtk.Align.CENTER} class={"text-content"}
|
||||
orientation={Gtk.Orientation.VERTICAL}>
|
||||
@@ -30,8 +30,8 @@ export const FocusedClient = () => {
|
||||
tooltipText={createBinding(focusedClient, "class")}/>
|
||||
<Gtk.Label class={"title"} xalign={0} maxWidthChars={50}
|
||||
ellipsize={Pango.EllipsizeMode.END}
|
||||
label={createBinding(focusedClient, "class")}
|
||||
tooltipText={createBinding(focusedClient, "class")}/>
|
||||
label={createBinding(focusedClient, "title")}
|
||||
tooltipText={createBinding(focusedClient, "title")}/>
|
||||
</Gtk.Box>
|
||||
</Gtk.Box>}
|
||||
</With>
|
||||
|
||||
@@ -18,7 +18,7 @@ export let [player, setPlayer] = createState(dummyPlayer);
|
||||
export const Media = () => {
|
||||
const connections: Map<GObject.Object, Array<number>|number> = new Map();
|
||||
|
||||
if(AstalMpris.get_default().players[0] && player.get() !== dummyPlayer)
|
||||
if(AstalMpris.get_default().players[0])
|
||||
setPlayer(AstalMpris.get_default().players[0]);
|
||||
|
||||
connections.set(AstalMpris.get_default(), [
|
||||
@@ -26,9 +26,6 @@ export const Media = () => {
|
||||
player.available && setPlayer(player)),
|
||||
|
||||
AstalMpris.get_default().connect("player-closed", (_, closedPlayer) => {
|
||||
if(player.get()?.busName !== closedPlayer.busName)
|
||||
return;
|
||||
|
||||
const players = AstalMpris.get_default().players.filter(pl => pl?.available);
|
||||
|
||||
if(players.length > 0) {
|
||||
@@ -113,7 +110,7 @@ export const Media = () => {
|
||||
title ?? "No Title")} maxWidthChars={20} ellipsize={Pango.EllipsizeMode.END}
|
||||
/>
|
||||
<Separator orientation={Gtk.Orientation.HORIZONTAL} size={1} margin={5}
|
||||
alpha={.3} />
|
||||
alpha={.3} spacing={6} />
|
||||
<Gtk.Label class={"artist"} label={createBinding(player.get(), "artist").as(artist =>
|
||||
artist ?? "No Artist")} maxWidthChars={18} ellipsize={Pango.EllipsizeMode.END}
|
||||
/>
|
||||
|
||||
@@ -19,7 +19,7 @@ function popoverFromModel(model: Gio.MenuModel, actionGroup: Gio.ActionGroup | n
|
||||
export const Tray = () => {
|
||||
const items = createBinding(astalTray, "items").as(items => items.filter(item => item?.gicon));
|
||||
|
||||
return <Gtk.Box class={"tray"} visible={variableToBoolean(items)}>
|
||||
return <Gtk.Box class={"tray"} visible={variableToBoolean(items)} spacing={10}>
|
||||
<For each={items}>
|
||||
{(item: AstalTray.TrayItem) => <Gtk.Box class={"item"}>
|
||||
|
||||
|
||||
@@ -114,18 +114,18 @@ export const Workspaces = () => {
|
||||
`${lastClient.get_class()}: `
|
||||
: ""
|
||||
} ${lastClient.title}` : "" }`
|
||||
)} onClicked={ws.focus}>
|
||||
)} onClicked={() => ws.focus()}>
|
||||
|
||||
|
||||
<With value={createBinding(ws, "lastClient")}>
|
||||
{(lastClient: AstalHyprland.Client) =>
|
||||
<Gtk.Box class={"last-client"}>
|
||||
<Gtk.Box class={"last-client"} hexpand>
|
||||
<Gtk.Revealer transitionDuration={200} revealChild={showId}
|
||||
transitionType={Gtk.RevealerTransitionType.SLIDE_LEFT}
|
||||
hexpand={true}>
|
||||
hexpand>
|
||||
|
||||
<Gtk.Label label={createBinding(ws, "id").as(String)}
|
||||
class={"id"} />
|
||||
class={"id"} hexpand />
|
||||
</Gtk.Revealer>
|
||||
{lastClient && <Gtk.Image class={"last-client-icon"} iconName={
|
||||
createBinding(lastClient, "initialClass").as(initialClass =>
|
||||
|
||||
@@ -91,10 +91,10 @@ export const BigMedia = () => {
|
||||
return pos > 0 && player.length > 0 ?
|
||||
`${Math.floor(pos / 60)}:${sec < 10 ? "0" : ""}${sec}`
|
||||
: "0:00";
|
||||
})}
|
||||
})} $type="start"
|
||||
/>
|
||||
|
||||
<Gtk.Box class={"controls button-row"}>
|
||||
<Gtk.Box class={"controls button-row"} $type="center">
|
||||
<Gtk.Button class={"link"} iconName={"edit-paste-symbolic"}
|
||||
tooltipText={"Copy link to clipboard"}
|
||||
onClicked={() => {
|
||||
@@ -157,7 +157,7 @@ export const BigMedia = () => {
|
||||
return (len > 0 && Number.isFinite(len)) ?
|
||||
`${Math.floor(len / 60)}:${sec < 10 ? "0" : ""}${sec}`
|
||||
: "0:00";
|
||||
})}
|
||||
})} $type="end"
|
||||
/>
|
||||
</Gtk.CenterBox>
|
||||
</Gtk.Box>
|
||||
|
||||
Reference in New Issue
Block a user