✨ ags: new window management system, adjustments, use adwaita sans
This commit is contained in:
@@ -4,7 +4,7 @@ import { Windows } from "../../windows";
|
||||
|
||||
export function Apps(): Gtk.Widget {
|
||||
return new Widget.EventBox({
|
||||
onClickRelease: () => Windows.getWindow("apps-window")?.show(),
|
||||
onClickRelease: () => Windows.open("apps-window"),
|
||||
className: "apps",
|
||||
child: new Widget.Box({
|
||||
child: new Widget.Icon({
|
||||
|
||||
@@ -2,14 +2,13 @@ import { Gtk, Widget } from "astal/gtk3";
|
||||
import { getDateTime } from "../../scripts/time";
|
||||
import { bind, GLib } from "astal";
|
||||
import { Windows } from "../../windows";
|
||||
import { CenterWindow } from "../../window/CenterWindow";
|
||||
|
||||
export function Clock(): Gtk.Widget {
|
||||
return new Widget.Box({
|
||||
className: bind(CenterWindow, "visible").as((visible: boolean) =>
|
||||
visible ? "clock open" : "clock"),
|
||||
className: bind(Windows, "openWindows").as((openWins) =>
|
||||
Object.hasOwn(openWins, "center-window") ? "open clock" : "clock"),
|
||||
child: new Widget.Button({
|
||||
onClick: () => Windows.toggle(CenterWindow),
|
||||
onClick: () => Windows.toggle("center-window"),
|
||||
label: getDateTime().as((dateTime: GLib.DateTime) => {
|
||||
return dateTime.format("%A %d, %H:%M")
|
||||
})
|
||||
|
||||
@@ -71,9 +71,8 @@ export function Media(): Gtk.Widget {
|
||||
|
||||
const mediaWidget = new Widget.EventBox({
|
||||
className: "media-eventbox",
|
||||
visible: bind(mpris, "players").as((players: Array<AstalMpris.Player>) => {
|
||||
return players[0] && players[0].get_available() || CenterWindow.is_visible();
|
||||
}),
|
||||
visible: bind(mpris, "players").as((players: Array<AstalMpris.Player>) =>
|
||||
players[0] && players[0].get_available()),
|
||||
onDestroy: (_) => {
|
||||
hoverConnectionId !== undefined &&
|
||||
_.disconnect(hoverConnectionId);
|
||||
@@ -81,7 +80,7 @@ export function Media(): Gtk.Widget {
|
||||
hoverLostConnectionId !== undefined &&
|
||||
_.disconnect(hoverLostConnectionId);
|
||||
},
|
||||
onClick: () => Windows.toggle(CenterWindow),
|
||||
onClick: () => Windows.toggle("center-window"),
|
||||
child: new Widget.Box({
|
||||
className: "media",
|
||||
children: [
|
||||
|
||||
@@ -5,16 +5,15 @@ import AstalWp from "gi://AstalWp";
|
||||
import { bind, Variable } from "astal";
|
||||
import { Gtk, Widget } from "astal/gtk3";
|
||||
import { Wireplumber } from "../../scripts/volume";
|
||||
import { ControlCenter } from "../../window/ControlCenter";
|
||||
import { Notifications } from "../../scripts/notifications";
|
||||
import { Windows } from "../../windows";
|
||||
|
||||
|
||||
export function Status(): Gtk.Widget {
|
||||
return new Widget.EventBox({
|
||||
className: bind(ControlCenter, "visible").as((visible: boolean) =>
|
||||
visible ? "status open" : "status"),
|
||||
onClick: () => Windows.toggle(ControlCenter!),
|
||||
className: bind(Windows, "openWindows").as((openWins) =>
|
||||
Object.hasOwn(openWins, "control-center") ? "open status" : "status"),
|
||||
onClick: () => Windows.toggle("control-center"),
|
||||
child: new Widget.Box({
|
||||
children: [
|
||||
volumeStatusSlider({
|
||||
@@ -63,6 +62,7 @@ function volumeStatusSlider(props: { className?: string, endpoint: AstalWp.Endpo
|
||||
|
||||
revealer.add(new Widget.Slider({
|
||||
className: "slider",
|
||||
setup: (slider) => slider.set_value(Math.floor(props.endpoint.get_volume() * 100)),
|
||||
onDragged: (slider) => props.endpoint.set_volume(slider.value / 100),
|
||||
value: bind(props.endpoint, "volume").as((volume) =>
|
||||
Math.floor(volume * 100)),
|
||||
|
||||
Reference in New Issue
Block a user