Added the ability to assign shortcuts to all bar modules. (#278)
This commit is contained in:
6
lib/types/bar.d.ts
vendored
6
lib/types/bar.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import { Binding, Connectable } from 'types/service';
|
||||
import { Variable } from 'types/variable';
|
||||
import Box from 'types/widgets/box';
|
||||
import Button from 'types/widgets/button';
|
||||
import Button, { ButtonProps } from 'types/widgets/button';
|
||||
import Label from 'types/widgets/label';
|
||||
import { Attribute, Child } from './widget';
|
||||
|
||||
@@ -10,7 +10,9 @@ export type BarBoxChild = {
|
||||
isVisible?: boolean;
|
||||
isVis?: Variable<boolean>;
|
||||
boxClass: string;
|
||||
} & ButtonProps;
|
||||
tooltip_text?: string | Binding<string>;
|
||||
props: ButtonProps;
|
||||
};
|
||||
|
||||
export type SelfButton = Button<Child, Attribute>;
|
||||
|
||||
|
||||
2
lib/types/customModules/utils.d.ts
vendored
2
lib/types/customModules/utils.d.ts
vendored
@@ -7,3 +7,5 @@ export type InputHandlerEvents = {
|
||||
onScrollUp?: Binding;
|
||||
onScrollDown?: Binding;
|
||||
};
|
||||
|
||||
export type RunAsyncCommand = (cmd: string, args: EventArgs, fn?: (output: string) => void) => void;
|
||||
|
||||
3
lib/types/utils.d.ts
vendored
3
lib/types/utils.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
import { substitutes } from 'lib/icons';
|
||||
import { EventArgs } from './widget';
|
||||
|
||||
type SubstituteKeys = keyof typeof substitutes;
|
||||
|
||||
export type ThrottleFn = (cmd: string, fn: ((output: string) => void) | undefined) => void;
|
||||
export type ThrottleFn = (cmd: string, args: EventArgs, fn?: (output: string) => void) => void;
|
||||
export type ThrottleFnCallback = ((output: string) => void) | undefined;
|
||||
|
||||
1
lib/types/widget.d.ts
vendored
1
lib/types/widget.d.ts
vendored
@@ -26,3 +26,4 @@ export type GLabel = Gtk.Label;
|
||||
export type GCenterBox = Gtk.Box;
|
||||
|
||||
export type EventHandler<Self> = (self: Self, event: Gdk.Event) => boolean | unknown;
|
||||
export type EventArgs = { clicked: Button<Child, Attribute>; event: Gdk.Event };
|
||||
|
||||
Reference in New Issue
Block a user