chore: update ags and remove deprecated stuff

This commit is contained in:
end-4
2024-03-10 17:44:44 +07:00
parent ec4e8a9acc
commit 8b026d1d7d
6 changed files with 32 additions and 30 deletions
+2 -2
View File
@@ -57,7 +57,7 @@ const Windows = () => [
forMonitors((id) => Corner(id, 'bottom right')), forMonitors((id) => Corner(id, 'bottom right')),
]; ];
const CLOSE_ANIM_TIME = 210; // Longer than actual anim time to make sure widgets animate fully const CLOSE_ANIM_TIME = 210; // Longer than actual anim time to make sure widgets animate fully
export default { App.config({
css: `${COMPILED_STYLE_DIR}/style.css`, css: `${COMPILED_STYLE_DIR}/style.css`,
stackTraceOnError: true, stackTraceOnError: true,
closeWindowDelay: { // For animations closeWindowDelay: { // For animations
@@ -66,7 +66,7 @@ export default {
'osk': CLOSE_ANIM_TIME, 'osk': CLOSE_ANIM_TIME,
}, },
windows: Windows().flat(1), windows: Windows().flat(1),
}; });
// Stuff that don't need to be toggled. And they're async so ugh... // Stuff that don't need to be toggled. And they're async so ugh...
// Bar().catch(print); // Use this to debug the bar. Single monitor only. // Bar().catch(print); // Use this to debug the bar. Single monitor only.
+22 -20
View File
@@ -6,25 +6,27 @@ const { Box, Window } = Widget;
export default ({ export default ({
name, name,
child, child,
showClassName, showClassName = "",
hideClassName, hideClassName = "",
...props ...props
}) => Window({ }) => {
name, return Window({
popup: true, name,
visible: false, visible: false,
layer: 'overlay', layer: 'overlay',
...props, ...props,
child: Box({ child: Box({
className: `${showClassName} ${hideClassName}`, setup: (self) => {
setup: (self) => self self.hook(App, (self, currentName, visible) => {
.hook(App, (self, currentName, visible) => { if (currentName === name) {
if (currentName === name) { self.toggleClassName(hideClassName, !visible);
self.toggleClassName(hideClassName, !visible); }
} }).keybind("Escape", () => App.closeWindow(name))
}) if (showClassName !== "" && hideClassName !== "")
, self.className = `${showClassName} ${hideClassName}`;
child: child, },
}), child: child,
}); }),
});
}
+2 -2
View File
@@ -3,6 +3,7 @@ import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import Service from 'resource:///com/github/Aylur/ags/service.js'; import Service from 'resource:///com/github/Aylur/ags/service.js';
import { Keybinds } from "./keybinds.js"; import { Keybinds } from "./keybinds.js";
import { setupCursorHover } from "../.widgetutils/cursorhover.js"; import { setupCursorHover } from "../.widgetutils/cursorhover.js";
import PopupWindow from '../.widgethacks/popupwindow.js';
const cheatsheetHeader = () => Widget.CenterBox({ const cheatsheetHeader = () => Widget.CenterBox({
vertical: false, vertical: false,
@@ -68,11 +69,10 @@ const clickOutsideToClose = Widget.EventBox({
onMiddleClick: () => App.closeWindow('cheatsheet'), onMiddleClick: () => App.closeWindow('cheatsheet'),
}); });
export default () => Widget.Window({ export default () => PopupWindow({
name: 'cheatsheet', name: 'cheatsheet',
exclusivity: 'ignore', exclusivity: 'ignore',
keymode: 'exclusive', keymode: 'exclusive',
popup: true,
visible: false, visible: false,
child: Widget.Box({ child: Widget.Box({
vertical: true, vertical: true,
+3 -3
View File
@@ -1,11 +1,11 @@
import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import { SearchAndWindows } from "./windowcontent.js"; import { SearchAndWindows } from "./windowcontent.js";
import PopupWindow from '../.widgethacks/popupwindow.js';
export default () => Widget.Window({ export default (id = '') => PopupWindow({
name: 'overview', name: `overview${id}`,
exclusivity: 'ignore', exclusivity: 'ignore',
keymode: 'exclusive', keymode: 'exclusive',
popup: true,
visible: false, visible: false,
anchor: ['top'], anchor: ['top'],
layer: 'overlay', layer: 'overlay',
+2 -2
View File
@@ -1,9 +1,9 @@
import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import SessionScreen from "./sessionscreen.js"; import SessionScreen from "./sessionscreen.js";
import PopupWindow from '../.widgethacks/popupwindow.js';
export default () => Widget.Window({ // On-screen keyboard export default () => PopupWindow({ // On-screen keyboard
name: 'session', name: 'session',
popup: true,
visible: false, visible: false,
keymode: 'exclusive', keymode: 'exclusive',
layer: 'overlay', layer: 'overlay',
+1 -1
View File
@@ -24,7 +24,7 @@ install-ags (){
try git init -b main try git init -b main
try git remote add origin https://github.com/Aylur/ags.git try git remote add origin https://github.com/Aylur/ags.git
x git pull origin main && git submodule update --init --recursive x git pull origin main && git submodule update --init --recursive
x git checkout e257efa0a13c50538bed77ca6e557dc4dd3a3482 # add Widget.keybind #248 x git checkout b40b8d81c5543ef02caee67560ab1c13ebcee49a # "update examples"
x npm install x npm install
x meson setup build x meson setup build
x meson install -C build x meson install -C build