From 68beb6118f8ae192c34943c07d4636e300b5595c Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 31 Dec 2023 03:08:48 -0500 Subject: [PATCH] refactor(ags): change onOpen and onClose to snake_case --- devices/wim/config/ags/js/misc/popup.js | 12 ++++++------ .../wim/config/ags/js/quick-settings/button-grid.js | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/devices/wim/config/ags/js/misc/popup.js b/devices/wim/config/ags/js/misc/popup.js index 3df6762b..b1d0cf52 100644 --- a/devices/wim/config/ags/js/misc/popup.js +++ b/devices/wim/config/ags/js/misc/popup.js @@ -14,8 +14,8 @@ import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; * @param {WinProp & { * transition?: RevProp['transition'] * transition_duration?: RevProp['transition_duration'] - * onOpen?: function - * onClose?: function + * on_open?: function + * on_close?: function * blur?: boolean * close_on_unfocus?: 'none'|'stay'|'released'|'clicked' * }} o @@ -23,8 +23,8 @@ import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; export default ({ transition = 'slide_down', transition_duration = 800, - onOpen = () => {/**/}, - onClose = () => {/**/}, + on_open = () => {/**/}, + on_close = () => {/**/}, // Window props name, @@ -118,11 +118,11 @@ export default ({ self.reveal_child = isOpen; if (isOpen) { - onOpen(window); + on_open(window); } else { timeout(Number(transition_duration), () => { - onClose(window); + on_close(window); }); } } diff --git a/devices/wim/config/ags/js/quick-settings/button-grid.js b/devices/wim/config/ags/js/quick-settings/button-grid.js index d28373b2..3ed5cea0 100644 --- a/devices/wim/config/ags/js/quick-settings/button-grid.js +++ b/devices/wim/config/ags/js/quick-settings/button-grid.js @@ -30,7 +30,7 @@ const ButtonStates = []; * @param {{ * command?: function * secondary_command?: function - * onOpen?: function(Revealer):void + * on_open?: function(Revealer):void * icon: string|BindTuple * indicator?: BindTuple * menu?: any @@ -39,7 +39,7 @@ const ButtonStates = []; const GridButton = ({ command = () => {/**/}, secondary_command = () => {/**/}, - onOpen = () => {/**/}, + on_open = () => {/**/}, icon, indicator, menu, @@ -168,7 +168,7 @@ const GridButton = ({ if (Activated.value) { deg = menu ? 360 : 450; - onOpen(menu); + on_open(menu); } self.setCss(` -gtk-icon-transform: rotate(${deg}deg); @@ -240,7 +240,7 @@ const FirstRow = () => Row({ }], menu: NetworkMenu(), - onOpen: () => Network.wifi.scan(), + on_open: () => Network.wifi.scan(), }), // TODO: do vpn @@ -285,7 +285,7 @@ const FirstRow = () => Row({ }, 'notify::connected-devices'], menu: BluetoothMenu(), - onOpen: (menu) => { + on_open: (menu) => { execAsync(`bluetoothctl scan ${menu.reveal_child ? 'on' : 'off'}`).catch(print);