MCPcopy Index your code
hub / github.com/material-shell/material-shell / toggle

Method toggle

src/layout/verticalPanel/verticalPanel.ts:211–292  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

209 }
210
211 toggle() {
212 if (!this.isExpanded) {
213 if (!Me.layout!.panelsVisible) {
214 this.show();
215 }
216 if (this.extendedPanelContent.get_parent() === null) {
217 if (
218 Me.msThemeManager!.verticalPanelPosition ===
219 VerticalPanelPositionEnum.LEFT
220 ) {
221 this.insert_child_below(
222 this.extendedPanelContent,
223 this.panelContent
224 );
225 } else {
226 this.insert_child_above(
227 this.extendedPanelContent,
228 this.panelContent
229 );
230 }
231 }
232 if (this.divider.get_parent() === null) {
233 if (
234 Me.msThemeManager!.verticalPanelPosition ===
235 VerticalPanelPositionEnum.LEFT
236 ) {
237 this.insert_child_below(this.divider, this.panelContent);
238 } else {
239 this.insert_child_above(this.divider, this.panelContent);
240 }
241 }
242
243 this.width = Me.msThemeManager!.getScaledSize(448);
244 this.translation_x =
245 (Me.msThemeManager!.getScaledSize(448) -
246 (Me.layout!.panelsVisible
247 ? Me.msThemeManager!.getPanelSize()
248 : 0)) *
249 (Me.msThemeManager!.verticalPanelPosition ===
250 VerticalPanelPositionEnum.LEFT
251 ? -1
252 : 1);
253
254 this.ease({
255 translation_x: 0,
256 duration: 200,
257 mode: Clutter.AnimationMode.EASE_OUT_QUAD,
258 });
259 this.extendedPanelContent.searchEntry.grab_key_focus();
260 this.panelContent.setIcon('close');
261 this.isExpanded = true;
262 this.add_style_class_name('shadow');
263 } else {
264 this.isExpanded = false;
265 this.panelContent.setIcon('search');
266 this.remove_style_class_name('shadow');
267
268 this.ease({

Callers 6

loadMethod · 0.80
toggleOverviewMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
activateMethod · 0.80

Calls 14

insert_child_belowMethod · 0.80
insert_child_aboveMethod · 0.80
getScaledSizeMethod · 0.80
getPanelSizeMethod · 0.80
easeMethod · 0.80
add_style_class_nameMethod · 0.80
showMethod · 0.65
get_parentMethod · 0.65
grab_key_focusMethod · 0.65
remove_childMethod · 0.65
hideMethod · 0.65

Tested by

no test coverage detected