refactor(ags): change onOpen and onClose to snake_case
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
602ee222ec
commit
68beb6118f
2 changed files with 11 additions and 11 deletions
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue