refactor(next): remove use of :has for performance reasons

This commit is contained in:
Elian Doran 2025-07-08 21:24:18 +03:00
parent 2fac2a8c5e
commit 24340d3a8e
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View File

@ -71,13 +71,13 @@ body.background-effects.platform-win32.layout-vertical #vertical-main-container
/* #endregion */ /* #endregion */
/* Matches when the left pane is collapsed */ /* Matches when the left pane is collapsed */
#horizontal-main-container:has(#left-pane.hidden-int) { #horizontal-main-container.left-pane-hidden {
--center-pane-border-radius: 0; --center-pane-border-radius: 0;
--tab-first-item-horiz-offset: 5px; --tab-first-item-horiz-offset: 5px;
} }
/* Add a border to the vertical launch bar if collapsed. */ /* Add a border to the vertical launch bar if collapsed. */
body.layout-vertical #horizontal-main-container:has(#left-pane.hidden-int) #launcher-pane.vertical { body.layout-vertical #horizontal-main-container.left-pane-hidden #launcher-pane.vertical {
border-right: 2px solid var(--left-pane-collapsed-border-color); border-right: 2px solid var(--left-pane-collapsed-border-color);
} }

View File

@ -5,7 +5,7 @@ import type Component from "../../components/component.js";
export default class LeftPaneContainer extends FlexContainer<Component> { export default class LeftPaneContainer extends FlexContainer<Component> {
private currentLeftPaneVisible: boolean; private currentLeftPaneVisible: boolean;
constructor() { constructor() {
super("column"); super("column");
@ -24,6 +24,7 @@ export default class LeftPaneContainer extends FlexContainer<Component> {
this.currentLeftPaneVisible = leftPaneVisible ?? !this.currentLeftPaneVisible; this.currentLeftPaneVisible = leftPaneVisible ?? !this.currentLeftPaneVisible;
const visible = this.isEnabled(); const visible = this.isEnabled();
this.toggleInt(visible); this.toggleInt(visible);
this.parent?.$widget.toggleClass("left-pane-hidden", !visible);
if (visible) { if (visible) {
this.triggerEvent("focusTree", {}); this.triggerEvent("focusTree", {});