💥 ags: fix startup issues (and with that, errors with focusedClient bar widget)

This commit is contained in:
retrozinndev
2025-02-04 21:45:18 -03:00
parent 11f919ab1d
commit 80969071c4
21 changed files with 363 additions and 200 deletions
+20 -26
View File
@@ -1,31 +1,25 @@
import { Astal, Gdk, Gtk, Widget } from "astal/gtk3";
import { QuickActionsWidget } from "../widget/control-center/QuickActions";
import { QuickActions } from "../widget/control-center/QuickActions";
import { Bar } from "./Bar";
import { Tiles } from "../widget/control-center/Tiles";
export const ControlCenter: Widget.Window = CC();
export const widgetsBox: Widget.Box = new Widget.Box({
visible: true,
const monitorHeight: number = Gdk.Screen.get_default()?.get_monitor_geometry(0)?.height!;
const widgetsContainer: Widget.Box = new Widget.Box({
className: "control-center-container",
orientation: Gtk.Orientation.VERTICAL,
children: [
QuickActionsWidget()
]
} as Widget.BoxProps);
} as Widget.BoxProps,
QuickActions,
Tiles);
widgetsBox.connect("add", (_: Widget.Box, widget: Gtk.Widget) => {
widget.set_size_request(widgetsBox.get_allocated_width(), widget.get_allocated_height());
});
function CC(): Widget.Window {
return new Widget.Window({
className: "control-center",
namespace: "control-center",
canFocus: true,
exclusivity: Astal.Exclusivity.NORMAL,
anchor: Astal.WindowAnchor.RIGHT,
width_request: 450,
height_request: Gdk.Screen.get_default()?.get_monitor_geometry(0)?.height || 800,
monitor: 0,
visible: false,
child: widgetsBox
} as Widget.WindowProps);
}
export const ControlCenter: Widget.Window = new Widget.Window({
className: "control-center",
namespace: "control-center",
canFocus: true,
exclusivity: Astal.Exclusivity.NORMAL,
anchor: Astal.WindowAnchor.RIGHT,
width_request: 450,
height_request: Bar.is_visible() ? monitorHeight - Bar.get_size()[1] - 18 : 700,
monitor: 0,
visible: false
} as Widget.WindowProps, widgetsContainer);