✨ ags: make osd work, new window management system, lots of improvements
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
import { Astal, Gtk, Widget } from "astal/gtk3";
|
||||
import { GLib } from "astal";
|
||||
|
||||
import { getDateTime } from "../scripts/time";
|
||||
|
||||
|
||||
export const CenterWindow: Widget.Window = new Widget.Window({
|
||||
className: "center-window",
|
||||
namespace: "center-window",
|
||||
canFocus: true,
|
||||
monitor: 0,
|
||||
layer: Astal.Layer.OVERLAY,
|
||||
exclusivity: Astal.Exclusivity.NORMAL,
|
||||
visible: false,
|
||||
height_request: 600,
|
||||
anchor: Astal.WindowAnchor.TOP,
|
||||
child: new Widget.Box({
|
||||
className: "center-window-container",
|
||||
children: [
|
||||
new Widget.Box({
|
||||
className: "vertical left",
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
width_request: 300,
|
||||
children: [
|
||||
new Widget.Box({
|
||||
className: "top time date",
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
children: [
|
||||
new Widget.Label({
|
||||
className: "time",
|
||||
label: getDateTime().as((dateTime: GLib.DateTime) =>
|
||||
dateTime.format("%H:%M"))
|
||||
} as Widget.LabelProps),
|
||||
new Widget.Label({
|
||||
className: "date",
|
||||
label: getDateTime().as((dateTime: GLib.DateTime) =>
|
||||
dateTime.format("%A, %B %d %Y"))
|
||||
} as Widget.LabelProps)
|
||||
]
|
||||
} as Widget.BoxProps)
|
||||
]
|
||||
} as Widget.BoxProps),
|
||||
new Widget.Box({
|
||||
className: "vertical right",
|
||||
children: [
|
||||
new Widget.Box({
|
||||
className: "calendar-box",
|
||||
child: new Gtk.Calendar({
|
||||
show_heading: true,
|
||||
show_day_names: true,
|
||||
show_week_numbers: false
|
||||
} as Gtk.Calendar.ConstructorProps)
|
||||
} as Widget.BoxProps)
|
||||
]
|
||||
} as Widget.BoxProps)
|
||||
]
|
||||
} as Widget.BoxProps)
|
||||
} as Widget.WindowProps);
|
||||
Reference in New Issue
Block a user