ags(apps-window): fixed size for app widgets, auto-focus entry, better looking

This commit is contained in:
retrozinndev
2025-04-11 17:36:34 -03:00
parent 8f028b3cb9
commit 026ce6cec8
3 changed files with 135 additions and 43 deletions
+40
View File
@@ -0,0 +1,40 @@
import { GObject, property, register } from "astal";
import AstalHyprland from "gi://AstalHyprland?version=0.1";
export { NightLight };
@register({ GTypeName: "NightLight" })
class NightLight extends GObject.Object {
private static instance: NightLight;
#temperature: number = 4500;
#gamma: number = 100;
@property(Number)
public get temperature() { return this.#temperature; }
public set temperature(newValue: number) {
if(newValue < 0) return;
AstalHyprland.get_default().dispatch("hyprsunset", `temperature ${newValue}`);
this.#temperature = newValue;
this.notify("temperature");
}
@property(Number)
public get gamma() { return this.#gamma; }
public set gamma(newValue: number) {
if(newValue < 0) return;
AstalHyprland.get_default().dispatch("hyprsunset", `gamma ${newValue}`);
this.#gamma = newValue;
this.notify("gamma");
}
public static getDefault() {
if(!this.instance)
this.instance = new NightLight();
return this.instance;
}
}