@gjsify/adwaita-core 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/about-dialog.js +3 -0
- package/lib/esm/action-row.js +1 -0
- package/lib/esm/avatar.js +1 -0
- package/lib/esm/banner.js +1 -0
- package/lib/esm/button-content.js +1 -0
- package/lib/esm/carousel.js +1 -0
- package/lib/esm/checks.js +1 -0
- package/lib/esm/chrome.js +1 -0
- package/lib/esm/conformance/about-dialog.js +6 -0
- package/lib/esm/conformance/action-row.js +1 -0
- package/lib/esm/conformance/avatar.js +1 -0
- package/lib/esm/conformance/banner.js +1 -0
- package/lib/esm/conformance/button-content.js +1 -0
- package/lib/esm/conformance/carousel.js +1 -0
- package/lib/esm/conformance/checks.js +1 -0
- package/lib/esm/conformance/chrome.js +1 -0
- package/lib/esm/conformance/data-grid.js +1 -0
- package/lib/esm/conformance/dialog.js +1 -0
- package/lib/esm/conformance/entry-row.js +1 -0
- package/lib/esm/conformance/index.js +1 -0
- package/lib/esm/conformance/navigation-view.js +1 -0
- package/lib/esm/conformance/popover.js +1 -0
- package/lib/esm/conformance/preferences.js +1 -0
- package/lib/esm/conformance/rows.js +1 -0
- package/lib/esm/conformance/sidebar.js +1 -0
- package/lib/esm/conformance/spinner.js +1 -0
- package/lib/esm/conformance/split-button.js +1 -0
- package/lib/esm/conformance/split-view.js +1 -0
- package/lib/esm/conformance/tab-view.js +1 -0
- package/lib/esm/conformance/view-stack.js +1 -0
- package/lib/esm/conformance/view-switcher.js +1 -0
- package/lib/esm/conformance/wrap-box.js +1 -0
- package/lib/esm/data-grid.js +1 -0
- package/lib/esm/dialog.js +1 -1
- package/lib/esm/easing.js +1 -0
- package/lib/esm/entry-row.js +1 -0
- package/lib/esm/glib.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/length-unit.js +1 -0
- package/lib/esm/navigation-view.js +1 -0
- package/lib/esm/popover.js +1 -0
- package/lib/esm/preferences.js +1 -0
- package/lib/esm/rows.js +1 -1
- package/lib/esm/sidebar.js +1 -0
- package/lib/esm/spinner.js +1 -0
- package/lib/esm/split-button.js +1 -0
- package/lib/esm/split-view.js +1 -0
- package/lib/esm/tab-view.js +1 -0
- package/lib/esm/view-stack.js +1 -0
- package/lib/esm/view-switcher.js +1 -0
- package/lib/esm/wrap-box.js +1 -0
- package/lib/types/about-dialog.d.ts +391 -0
- package/lib/types/about-dialog.spec.d.ts +2 -0
- package/lib/types/action-row.d.ts +270 -0
- package/lib/types/action-row.spec.d.ts +2 -0
- package/lib/types/avatar.d.ts +112 -0
- package/lib/types/avatar.spec.d.ts +2 -0
- package/lib/types/banner.d.ts +104 -0
- package/lib/types/banner.spec.d.ts +2 -0
- package/lib/types/button-content.d.ts +141 -0
- package/lib/types/button-content.spec.d.ts +2 -0
- package/lib/types/carousel.d.ts +535 -0
- package/lib/types/carousel.spec.d.ts +2 -0
- package/lib/types/checks.d.ts +63 -0
- package/lib/types/checks.spec.d.ts +2 -0
- package/lib/types/chrome.d.ts +355 -0
- package/lib/types/chrome.spec.d.ts +2 -0
- package/lib/types/conformance/about-dialog.d.ts +314 -0
- package/lib/types/conformance/action-row.d.ts +186 -0
- package/lib/types/conformance/avatar.d.ts +61 -0
- package/lib/types/conformance/banner.d.ts +91 -0
- package/lib/types/conformance/button-content.d.ts +110 -0
- package/lib/types/conformance/carousel.d.ts +298 -0
- package/lib/types/conformance/checks.d.ts +29 -0
- package/lib/types/conformance/chrome.d.ts +207 -0
- package/lib/types/conformance/data-grid.d.ts +136 -0
- package/lib/types/conformance/dialog.d.ts +97 -0
- package/lib/types/conformance/entry-row.d.ts +187 -0
- package/lib/types/conformance/index.d.ts +46 -0
- package/lib/types/conformance/navigation-view.d.ts +235 -0
- package/lib/types/conformance/popover.d.ts +58 -0
- package/lib/types/conformance/preferences.d.ts +184 -0
- package/lib/types/conformance/rows.d.ts +74 -0
- package/lib/types/conformance/sidebar.d.ts +182 -0
- package/lib/types/conformance/spinner.d.ts +66 -0
- package/lib/types/conformance/split-button.d.ts +193 -0
- package/lib/types/conformance/split-view.d.ts +301 -0
- package/lib/types/conformance/tab-view.d.ts +449 -0
- package/lib/types/conformance/view-stack.d.ts +121 -0
- package/lib/types/conformance/view-switcher.d.ts +443 -0
- package/lib/types/conformance/wrap-box.d.ts +185 -0
- package/lib/types/data-grid.d.ts +140 -0
- package/lib/types/data-grid.spec.d.ts +2 -0
- package/lib/types/dialog.d.ts +144 -0
- package/lib/types/easing.d.ts +21 -0
- package/lib/types/entry-row.d.ts +308 -0
- package/lib/types/entry-row.spec.d.ts +2 -0
- package/lib/types/glib.d.ts +49 -0
- package/lib/types/index.d.ts +50 -4
- package/lib/types/length-unit.d.ts +24 -0
- package/lib/types/navigation-view.d.ts +343 -0
- package/lib/types/navigation-view.spec.d.ts +2 -0
- package/lib/types/popover.d.ts +155 -0
- package/lib/types/popover.spec.d.ts +2 -0
- package/lib/types/preferences.d.ts +349 -0
- package/lib/types/preferences.spec.d.ts +2 -0
- package/lib/types/rows.d.ts +96 -8
- package/lib/types/sidebar.d.ts +308 -0
- package/lib/types/sidebar.spec.d.ts +2 -0
- package/lib/types/spinner.d.ts +117 -0
- package/lib/types/spinner.spec.d.ts +2 -0
- package/lib/types/split-button.d.ts +316 -0
- package/lib/types/split-button.spec.d.ts +2 -0
- package/lib/types/split-view.d.ts +703 -0
- package/lib/types/split-view.spec.d.ts +2 -0
- package/lib/types/tab-view.d.ts +616 -0
- package/lib/types/tab-view.spec.d.ts +2 -0
- package/lib/types/view-stack.d.ts +278 -0
- package/lib/types/view-stack.spec.d.ts +2 -0
- package/lib/types/view-switcher.d.ts +524 -0
- package/lib/types/view-switcher.spec.d.ts +2 -0
- package/lib/types/wrap-box.d.ts +200 -0
- package/lib/types/wrap-box.spec.d.ts +2 -0
- package/package.json +8 -4
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four mutually exclusive content slots of the action half. `'empty'` is the
|
|
3
|
+
* initial state — `label`, `icon-name` and `child` are all `NULL`
|
|
4
|
+
* (adw-split-button.c:311-352).
|
|
5
|
+
*/
|
|
6
|
+
export type SplitButtonContentMode = 'empty' | 'label' | 'icon' | 'child';
|
|
7
|
+
/** `GtkArrowType` as a string union. Default `'down'` (adw-split-button.c:420). */
|
|
8
|
+
export type SplitButtonDirection = 'none' | 'up' | 'down' | 'left' | 'right';
|
|
9
|
+
/**
|
|
10
|
+
* Every symbolic icon an `arrow` node can be given `-gtk-icon-source` for
|
|
11
|
+
* (_buttons.scss:451-469 plus the `splitbutton` override at :621-623).
|
|
12
|
+
*
|
|
13
|
+
* A union rather than `string` so a renderer's glyph→asset table is TOTAL: an
|
|
14
|
+
* `Adwaita` release that introduces a sixth glyph breaks the renderers at COMPILE
|
|
15
|
+
* time instead of painting a blank arrow at runtime.
|
|
16
|
+
*/
|
|
17
|
+
export type AdwArrowIcon = 'open-menu-symbolic' | 'pan-down-symbolic' | 'pan-up-symbolic' | 'pan-start-symbolic' | 'pan-end-symbolic';
|
|
18
|
+
/** A root style class `update_style_classes` puts on the `splitbutton` node. */
|
|
19
|
+
export type SplitButtonStyleClass = 'image-button' | 'text-button';
|
|
20
|
+
/**
|
|
21
|
+
* The GObject property names this widget notifies.
|
|
22
|
+
*
|
|
23
|
+
* Carried in {@link SplitButtonChange.notified} so a renderer can re-emit
|
|
24
|
+
* `notify::*` with the same sequence the upstream suite asserts: one mutation
|
|
25
|
+
* emits SEVERAL notifications inside a single freeze/thaw
|
|
26
|
+
* (adw-split-button.c:671-681), and that sequence cannot be reconstructed from
|
|
27
|
+
* the final state alone.
|
|
28
|
+
*
|
|
29
|
+
* `can-shrink` is deliberately absent — see the module note on deferred scope.
|
|
30
|
+
*/
|
|
31
|
+
export type SplitButtonProperty = 'label' | 'icon-name' | 'child' | 'use-underline' | 'menu-model' | 'popover' | 'direction' | 'dropdown-tooltip';
|
|
32
|
+
/**
|
|
33
|
+
* One `GMenuModel` item: a label plus the detailed action it invokes, i.e. what
|
|
34
|
+
* `Gio.Menu.append (label, action)` produces (adw-split-button.c:385-388).
|
|
35
|
+
*
|
|
36
|
+
* `id` and `icon` are the existing menu-button extras from the two renderers, so
|
|
37
|
+
* all four menu call sites in the workspace can converge on ONE type. The name
|
|
38
|
+
* is family-neutral on purpose: `Adw.MenuButton` needs exactly this and must be
|
|
39
|
+
* able to adopt it without a rename.
|
|
40
|
+
*/
|
|
41
|
+
export interface AdwMenuEntry {
|
|
42
|
+
/** Display label. */
|
|
43
|
+
label: string;
|
|
44
|
+
/** Detailed action name, e.g. `app.save-as`. */
|
|
45
|
+
action?: string;
|
|
46
|
+
/** Stable identifier, defaulting to {@link label} on activation. */
|
|
47
|
+
id?: string;
|
|
48
|
+
/** Symbolic icon name for the item. */
|
|
49
|
+
icon?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Payload of a {@link SplitButtonState} notification. */
|
|
52
|
+
export interface SplitButtonChange {
|
|
53
|
+
/** Which content slot is filled. */
|
|
54
|
+
mode: SplitButtonContentMode;
|
|
55
|
+
/** The label, or `null` unless {@link mode} is `'label'`. */
|
|
56
|
+
label: string | null;
|
|
57
|
+
/** The icon name, or `null` unless {@link mode} is `'icon'`. */
|
|
58
|
+
iconName: string | null;
|
|
59
|
+
/** The child widget — the app's in `'child'` mode, an opaque internal node in `'label'`/`'icon'` mode. */
|
|
60
|
+
child: object | null;
|
|
61
|
+
/** The root style classes after this change. */
|
|
62
|
+
styleClasses: readonly SplitButtonStyleClass[];
|
|
63
|
+
/** Whether the dropdown half is live (a menu model or a popover is set). */
|
|
64
|
+
dropdownEnabled: boolean;
|
|
65
|
+
/** Whether the menu is popped up. */
|
|
66
|
+
open: boolean;
|
|
67
|
+
/** The `notify::*` properties C emits for this one mutation, in emission order. */
|
|
68
|
+
notified: readonly SplitButtonProperty[];
|
|
69
|
+
/** True for a user gesture ({@link SplitButtonState.toggleMenu} / {@link SplitButtonState.activateMenuEntry}). */
|
|
70
|
+
interactive: boolean;
|
|
71
|
+
}
|
|
72
|
+
/** Subscriber for {@link SplitButtonState} changes. */
|
|
73
|
+
export type SplitButtonListener = (change: SplitButtonChange) => void;
|
|
74
|
+
/** The GTK state flags of one half of the control, as booleans. */
|
|
75
|
+
export interface SplitButtonHalfState {
|
|
76
|
+
/** `GTK_STATE_FLAG_ACTIVE` — the half is pressed. */
|
|
77
|
+
active: boolean;
|
|
78
|
+
/** `GTK_STATE_FLAG_CHECKED` — for the arrow half, the menu is open. */
|
|
79
|
+
checked: boolean;
|
|
80
|
+
/** The `keyboard-activating` CSS class GTK sets during a keyboard press. */
|
|
81
|
+
keyboardActivating: boolean;
|
|
82
|
+
}
|
|
83
|
+
/** The translatable default dropdown tooltip (adw-split-button.c:531-532, :1049-1050). */
|
|
84
|
+
export declare const DEFAULT_DROPDOWN_TOOLTIP = "More Options";
|
|
85
|
+
/** Adwaita's `--disabled-opacity`, for renderers that dim rather than desaturate. */
|
|
86
|
+
export declare const SPLIT_BUTTON_DISABLED_OPACITY = 0.5;
|
|
87
|
+
/**
|
|
88
|
+
* `update_style_classes` as a pure function (adw-split-button.c:145-165).
|
|
89
|
+
*
|
|
90
|
+
* Both branches test the FIRST CHARACTER, not truthiness of the value: `''` is a
|
|
91
|
+
* perfectly good label — non-`NULL`, so `get_label()` returns it and
|
|
92
|
+
* `get_icon_name()` is `NULL` — yet `label[0]` is NUL, so it carries no
|
|
93
|
+
* `text-button` class. `' '` does carry it, and renders two spaces: nothing in
|
|
94
|
+
* the C path trims.
|
|
95
|
+
*/
|
|
96
|
+
export declare function splitButtonStyleClasses(label: string | null, iconName: string | null): readonly SplitButtonStyleClass[];
|
|
97
|
+
/**
|
|
98
|
+
* The dropdown tooltip to actually show, and whether it is markup
|
|
99
|
+
* (adw-split-button.c:1044-1051).
|
|
100
|
+
*
|
|
101
|
+
* `has_dropdown_tooltip = tooltip && *tooltip` — a non-empty value goes through
|
|
102
|
+
* `gtk_widget_set_tooltip_markup` (Pango markup), an empty one restores the
|
|
103
|
+
* translated default as plain TEXT. The distinction is not cosmetic: a renderer
|
|
104
|
+
* that escapes the markup branch, or that leaves the accessible name empty on
|
|
105
|
+
* the default branch, is a different widget.
|
|
106
|
+
*/
|
|
107
|
+
export declare function resolveDropdownTooltip(tooltip: string): {
|
|
108
|
+
text: string;
|
|
109
|
+
markup: boolean;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* The arrow glyph a PLAIN `menubutton` draws for a direction — `none` is the
|
|
113
|
+
* `open-menu-symbolic` hamburger (_buttons.scss:454-456).
|
|
114
|
+
*
|
|
115
|
+
* Use {@link splitButtonArrowIcon} for the dropdown half of a split button, which
|
|
116
|
+
* the stylesheet gives a different `none`.
|
|
117
|
+
*/
|
|
118
|
+
export declare function menuButtonArrowIcon(direction: SplitButtonDirection): AdwArrowIcon;
|
|
119
|
+
/**
|
|
120
|
+
* The arrow glyph a SPLIT BUTTON's dropdown half draws for a direction — `none`
|
|
121
|
+
* is `pan-down-symbolic`, per the `splitbutton` override at _buttons.scss:621-623.
|
|
122
|
+
*/
|
|
123
|
+
export declare function splitButtonArrowIcon(direction: SplitButtonDirection): AdwArrowIcon;
|
|
124
|
+
/**
|
|
125
|
+
* Where the popup is placed: `'none'` behaves the same as `'down'`
|
|
126
|
+
* (adw-split-button.c:415).
|
|
127
|
+
*
|
|
128
|
+
* PLACEMENT IS NOT A SPLIT-BUTTON RULE, unlike the glyph. `adw_split_button_set_direction`
|
|
129
|
+
* is a pass-through to `gtk_menu_button_set_direction` (:997) and the getter reads
|
|
130
|
+
* it straight back off the same `GtkMenuButton` (:971) — the split button stores
|
|
131
|
+
* nothing and overrides nothing here, so `none → down` is `GtkMenuButton`'s own
|
|
132
|
+
* behaviour. {@link menuButtonPopupDirection} is therefore this very function
|
|
133
|
+
* rather than a second copy of it.
|
|
134
|
+
*/
|
|
135
|
+
export declare function splitButtonPopupDirection(direction: SplitButtonDirection): Exclude<SplitButtonDirection, 'none'>;
|
|
136
|
+
/**
|
|
137
|
+
* Where a plain `menubutton` places its popup — deliberately an ALIAS of
|
|
138
|
+
* {@link splitButtonPopupDirection}, not a copy.
|
|
139
|
+
*
|
|
140
|
+
* The two arrow-glyph functions differ because the stylesheet overrides the glyph
|
|
141
|
+
* per widget; placement has no such override, and pinning that as reference
|
|
142
|
+
* equality (`menuButtonPopupDirection === splitButtonPopupDirection`) is a claim a
|
|
143
|
+
* test can hold, where a duplicated body would only be a claim a comment makes.
|
|
144
|
+
*/
|
|
145
|
+
export declare const menuButtonPopupDirection: typeof splitButtonPopupDirection;
|
|
146
|
+
/** Whether `value` names a `GtkArrowType`, for parsing a renderer attribute. */
|
|
147
|
+
export declare function isSplitButtonDirection(value: unknown): value is SplitButtonDirection;
|
|
148
|
+
/**
|
|
149
|
+
* `update_state` as a pure fold (adw-split-button.c:118-143).
|
|
150
|
+
*
|
|
151
|
+
* The two halves are separate widgets, but the state the STYLESHEET keys off
|
|
152
|
+
* sits on the root: `splitbutton.flat:checked` shades the whole control and
|
|
153
|
+
* hides the separator while the menu is open (_buttons.scss:542-549). Neither
|
|
154
|
+
* renderer folded it, so both showed a per-half highlight only.
|
|
155
|
+
*/
|
|
156
|
+
export declare function splitButtonRootState(action: SplitButtonHalfState, dropdown: SplitButtonHalfState): {
|
|
157
|
+
active: boolean;
|
|
158
|
+
checked: boolean;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Parse a JSON menu attribute into entries.
|
|
162
|
+
*
|
|
163
|
+
* Total by construction — malformed JSON, a non-array root and entries without a
|
|
164
|
+
* `label` key all yield `[]` / are dropped — because the input is author-written
|
|
165
|
+
* markup and a typo must not take the widget down with it. Replaces the two
|
|
166
|
+
* byte-identical copies in `adw-split-button.ts` and `adw-menu-button.ts`.
|
|
167
|
+
*/
|
|
168
|
+
export declare function parseMenuEntries(json: string | null | undefined): AdwMenuEntry[];
|
|
169
|
+
/**
|
|
170
|
+
* The whole `Adw.SplitButton` state machine: content mode, use-underline,
|
|
171
|
+
* menu-model/popover exclusivity, direction, dropdown tooltip and the popup flag.
|
|
172
|
+
*
|
|
173
|
+
* Every mutator returns whether it changed anything and notifies only on a real
|
|
174
|
+
* change, like `ComboState`/`SpinState`. What this class adds over those is
|
|
175
|
+
* {@link SplitButtonChange.notified}: an ORDERED property list, because a single
|
|
176
|
+
* `set_label()` can emit `notify::icon-name`, `notify::child` and `notify::label`
|
|
177
|
+
* in that order and the upstream suite counts them.
|
|
178
|
+
*/
|
|
179
|
+
export declare class SplitButtonState {
|
|
180
|
+
private _mode;
|
|
181
|
+
private _label;
|
|
182
|
+
private _iconName;
|
|
183
|
+
private _child;
|
|
184
|
+
private _useUnderline;
|
|
185
|
+
private _menuModel;
|
|
186
|
+
private _popover;
|
|
187
|
+
private _direction;
|
|
188
|
+
private _dropdownTooltip;
|
|
189
|
+
private _open;
|
|
190
|
+
private readonly _listeners;
|
|
191
|
+
/** Subscribe to state changes. Returns an unsubscribe function. */
|
|
192
|
+
subscribe(listener: SplitButtonListener): () => void;
|
|
193
|
+
private _emit;
|
|
194
|
+
/** Which content slot is filled. */
|
|
195
|
+
get mode(): SplitButtonContentMode;
|
|
196
|
+
/** The label, or `null` unless {@link mode} is `'label'`. */
|
|
197
|
+
get label(): string | null;
|
|
198
|
+
/**
|
|
199
|
+
* Set the label, clearing `icon-name` and `child`
|
|
200
|
+
* (adw-split-button.c:661-682).
|
|
201
|
+
*
|
|
202
|
+
* A non-string is rejected outright and changes nothing, mirroring
|
|
203
|
+
* `g_return_if_fail (label != NULL)` at :666 — there is no "unset the label"
|
|
204
|
+
* path in C, clearing it is a side effect of setting another slot.
|
|
205
|
+
*/
|
|
206
|
+
setLabel(label: string): boolean;
|
|
207
|
+
/** The icon name, or `null` unless {@link mode} is `'icon'`. */
|
|
208
|
+
get iconName(): string | null;
|
|
209
|
+
/**
|
|
210
|
+
* Set the icon name, clearing `label` and `child`
|
|
211
|
+
* (adw-split-button.c:749-771). A non-string is rejected — `g_return_if_fail
|
|
212
|
+
* (icon_name != NULL)` at :754.
|
|
213
|
+
*/
|
|
214
|
+
setIconName(iconName: string): boolean;
|
|
215
|
+
/**
|
|
216
|
+
* The child widget: the app's own in `'child'` mode, the opaque internal
|
|
217
|
+
* content node in `'label'`/`'icon'` mode, `null` when empty.
|
|
218
|
+
*/
|
|
219
|
+
get child(): object | null;
|
|
220
|
+
/**
|
|
221
|
+
* Set (or clear, with `null`) the child, clearing `label` and `icon-name`
|
|
222
|
+
* (adw-split-button.c:799-824).
|
|
223
|
+
*
|
|
224
|
+
* This is also the only way to reach `'empty'` again from a filled slot, and
|
|
225
|
+
* it is how a renderer expresses "no content" — `setChild(null)` on a fresh
|
|
226
|
+
* state is correctly a no-op (:806-807).
|
|
227
|
+
*/
|
|
228
|
+
setChild(child: object | null | undefined): boolean;
|
|
229
|
+
/** The root style classes for the current content. */
|
|
230
|
+
get styleClasses(): readonly SplitButtonStyleClass[];
|
|
231
|
+
/** Whether an underline in the label marks a mnemonic. */
|
|
232
|
+
get useUnderline(): boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Set the mnemonic flag (adw-split-button.c:709-721). `!!`-normalised at :715,
|
|
235
|
+
* so a truthy non-boolean stores `true` and a following `setUseUnderline(true)`
|
|
236
|
+
* is correctly a no-op.
|
|
237
|
+
*
|
|
238
|
+
* Only the PROPERTY lives here. The `_S` → underlined-S derivation belongs to
|
|
239
|
+
* `GtkLabel`, not to this widget or its test — see the module note on
|
|
240
|
+
* deferred scope.
|
|
241
|
+
*/
|
|
242
|
+
setUseUnderline(value: boolean): boolean;
|
|
243
|
+
/** The menu entries, or `null` when no menu model is set. */
|
|
244
|
+
get menuModel(): readonly AdwMenuEntry[] | null;
|
|
245
|
+
/**
|
|
246
|
+
* Set the menu model, dissociating any popover (adw-split-button.c:906-916,
|
|
247
|
+
* :397-398) and replacing it with the model-derived one.
|
|
248
|
+
*
|
|
249
|
+
* DELIBERATE NORMALISATION: an EMPTY list is stored as "no menu model". C can
|
|
250
|
+
* hold a non-`NULL` but empty `GMenu`, which leaves the dropdown live and
|
|
251
|
+
* pops up an empty popover — but neither renderer can construct that state
|
|
252
|
+
* (one parses a JSON array, the other takes a label list), so the two cases
|
|
253
|
+
* are the same input here, and collapsing them is what makes "no menu ⇒
|
|
254
|
+
* insensitive dropdown" (:376-378) hold from a renderer's point of view. The
|
|
255
|
+
* `@gjsify/adwaita-web` bug this kills was a click on a menu-less split
|
|
256
|
+
* button opening an empty, fully styled popover.
|
|
257
|
+
*/
|
|
258
|
+
setMenuModel(entries: readonly AdwMenuEntry[] | null | undefined): boolean;
|
|
259
|
+
/** The popover: the one the app set, or the model-derived stand-in, or `null`. */
|
|
260
|
+
get popover(): object | null;
|
|
261
|
+
/**
|
|
262
|
+
* Set the popover, dissociating any menu model (adw-split-button.c:946-956,
|
|
263
|
+
* :390-398).
|
|
264
|
+
*
|
|
265
|
+
* The cleared property is notified before the set one, the order
|
|
266
|
+
* `set_label`/`set_icon_name`/`set_child` use throughout this widget
|
|
267
|
+
* (:671-681). GtkMenuButton's own internal ordering is not observable from
|
|
268
|
+
* the upstream suite, which only counts per-property notifications.
|
|
269
|
+
*/
|
|
270
|
+
setPopover(popover: object | null | undefined): boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Whether the dropdown half is live. "If the menu model is `NULL`, the
|
|
273
|
+
* dropdown is disabled" (adw-split-button.c:376-378) and the same for the
|
|
274
|
+
* popover (:394-396) — with neither, GtkMenuButton is insensitive.
|
|
275
|
+
*/
|
|
276
|
+
get dropdownEnabled(): boolean;
|
|
277
|
+
/** The direction the popup opens in, and the arrow points. */
|
|
278
|
+
get direction(): SplitButtonDirection;
|
|
279
|
+
/** Set the direction (adw-split-button.c:988-1000). An unknown value is rejected. */
|
|
280
|
+
setDirection(direction: SplitButtonDirection): boolean;
|
|
281
|
+
/** The arrow glyph for the current direction, with the split button's `none`. */
|
|
282
|
+
get arrowIcon(): AdwArrowIcon;
|
|
283
|
+
/**
|
|
284
|
+
* The dropdown tooltip as SET — `''` while unset, never `null`
|
|
285
|
+
* (adw-split-button.c:1017-1018). Pass it through
|
|
286
|
+
* {@link resolveDropdownTooltip} to get what should actually be shown.
|
|
287
|
+
*/
|
|
288
|
+
get dropdownTooltip(): string;
|
|
289
|
+
/**
|
|
290
|
+
* Set the dropdown tooltip (adw-split-button.c:1034-1054). The guard compares
|
|
291
|
+
* against the GETTER (:1041-1042), which already reports `''` when unset — so
|
|
292
|
+
* clearing an unset tooltip notifies nothing, while clearing a set one does
|
|
293
|
+
* notify and RESTORES the default rather than blanking the tooltip.
|
|
294
|
+
*/
|
|
295
|
+
setDropdownTooltip(tooltip: string): boolean;
|
|
296
|
+
/** Whether the menu is popped up. */
|
|
297
|
+
get open(): boolean;
|
|
298
|
+
private _setOpen;
|
|
299
|
+
/** Pop the menu up programmatically — `adw_split_button_popup` (:1062-1068). */
|
|
300
|
+
openMenu(): boolean;
|
|
301
|
+
/** Dismiss the menu programmatically — `adw_split_button_popdown` (:1076-1082). */
|
|
302
|
+
closeMenu(): boolean;
|
|
303
|
+
/** The dropdown half was activated by the user; flips the menu open/closed. */
|
|
304
|
+
toggleMenu(): boolean;
|
|
305
|
+
/**
|
|
306
|
+
* Activate a menu entry BY POSITION and dismiss the menu, returning the entry
|
|
307
|
+
* (or `null` for an out-of-range index).
|
|
308
|
+
*
|
|
309
|
+
* Position is the addressing a `GMenuModel` actually uses — each item carries
|
|
310
|
+
* its own detailed action (adw-split-button.c:385-388). Resolving a choice by
|
|
311
|
+
* LABEL, as the NativeScript port did, silently dispatches the first of two
|
|
312
|
+
* identically named entries and cannot tell an entry called `Cancel` from a
|
|
313
|
+
* dismissed sheet.
|
|
314
|
+
*/
|
|
315
|
+
activateMenuEntry(index: number): AdwMenuEntry | null;
|
|
316
|
+
}
|