const { Gtk } = imports.gi; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import { setupCursorHover } from "../.widgetutils/cursorhover.js"; import PopupWindow from '../.widgethacks/popupwindow.js'; import Keybinds from "./keybinds.js"; const CheatsheetHeader = () => Widget.CenterBox({ vertical: false, startWidget: Widget.Box({}), centerWidget: Widget.Box({ vertical: true, className: "spacing-h-15", children: [ Widget.Box({ hpack: 'center', className: 'spacing-h-5 cheatsheet-title', children: [ Widget.Label({ hpack: 'center', css: 'margin-right: 0.682rem;', className: 'txt-title', label: 'Cheat sheet', }), Widget.Label({ vpack: 'center', className: "cheatsheet-key txt-small", label: "", }), Widget.Label({ vpack: 'center', className: "cheatsheet-key-notkey txt-small", label: "+", }), Widget.Label({ vpack: 'center', className: "cheatsheet-key txt-small", label: "/", }) ] }), Widget.Label({ useMarkup: true, selectable: true, justify: Gtk.Justification.CENTER, className: 'txt-small txt', label: 'Sheet data stored in ~/.config/ags/modules/cheatsheet/data_keybinds.js\nChange keybinds in ~/.config/hypr/hyprland/keybinds.conf' }), ] }), endWidget: Widget.Button({ vpack: 'start', hpack: 'end', className: "cheatsheet-closebtn icon-material txt txt-hugeass", onClicked: () => { App.toggleWindow('cheatsheet'); }, child: Widget.Label({ className: 'icon-material txt txt-hugeass', label: 'close' }), setup: setupCursorHover, }), }); export default (id) => PopupWindow({ name: `cheatsheet${id}`, layer: 'overlay', keymode: 'exclusive', visible: false, child: Widget.Box({ vertical: true, children: [ Widget.Box({ vertical: true, className: "cheatsheet-bg spacing-v-15", children: [ CheatsheetHeader(), Keybinds(), ] }), ], }) });