diff --git a/config/ags/apps/settings/weather.ts b/config/ags/apps/settings/weather.ts index a7acafd2..bd9aefd6 100644 --- a/config/ags/apps/settings/weather.ts +++ b/config/ags/apps/settings/weather.ts @@ -37,7 +37,7 @@ const WeatherKey = () => on_accept: (self) => { if (self.text!.length == 32) { self.css = "border: 2px solid; border-color: #66BB6A"; - Utils.timeout(1000, () => { + Utils.timeout(100, () => { self.css = "border: 2px solid; border-color: transparent"; }); conf.set_value("weather", self.text!); diff --git a/config/ags/modules/misc/cickinsidepopupwindow (copy 1).ts b/config/ags/modules/misc/cickinsidepopupwindow (copy 1).ts new file mode 100644 index 00000000..15baa4fa --- /dev/null +++ b/config/ags/modules/misc/cickinsidepopupwindow (copy 1).ts @@ -0,0 +1,45 @@ +import App from "resource:///com/github/Aylur/ags/app.js"; +import Widget from "resource:///com/github/Aylur/ags/widget.js"; +import { WindowProps, Window } from "types/widgets/window"; +import Gtk from "gi://Gtk?version=3.0"; + +type _WindowProps = WindowProps> | undefined[]; + +type Type = { + name: string; + child: any; + showClassName?: string; + hideClassName?: string; +}; + +export default ({ + name, + child, + showClassName = "", + hideClassName = "", + ...props +}: T & Omit<_WindowProps, keyof Type>) => { + return Widget.Window({ + name, + visible: false, + type: Gtk.WindowType.POPUP, + layer: "overlay", + resizable: true, + ...props, + setup: (self) => { + self.keybind("Escape", () => App.closeWindow(name)); + self.on("button-press-event", () => App.closeWindow(name)); // Close on mouse click + + if (showClassName !== "" && hideClassName !== "") { + self.hook(App, (self, currentName, visible) => { + if (currentName === name) { + self.toggleClassName(hideClassName, !visible); + } + }); + + self.class_name = `${showClassName} ${hideClassName}`; + } + }, + child: child + }); +}; diff --git a/config/ags/variables.ts b/config/ags/variables.ts index 03afe5b1..17590b4b 100644 --- a/config/ags/variables.ts +++ b/config/ags/variables.ts @@ -73,7 +73,7 @@ const reload = () => { }) .catch(print); } -Utils.interval(15000, reload); +Utils.interval(100, reload); configuration.connect("changed", reload) export const idle_inhibitor = Variable(false);