From 7bdd2e045557e179a63c758444af3923d3575fa7 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 16 Sep 2024 13:10:35 +0200 Subject: [PATCH] fix maximize panel --- apps/remix-ide/src/app/panels/layout.ts | 16 +++++++++++++-- .../remix-app/components/dragbar/dragbar.tsx | 20 ++++++++----------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/apps/remix-ide/src/app/panels/layout.ts b/apps/remix-ide/src/app/panels/layout.ts index f7060a237ca..539a9b1c486 100644 --- a/apps/remix-ide/src/app/panels/layout.ts +++ b/apps/remix-ide/src/app/panels/layout.ts @@ -85,7 +85,13 @@ export class Layout extends Plugin { const current = await this.call('sidePanel', 'currentFocus') if (this.enhanced[current]) { this.event.emit('enhancesidepanel') - } else { + } + + if (this.maximized[current]) { + this.event.emit('maximisesidepanel') + } + + if (!this.enhanced[current] && !this.maximized[current]) { this.event.emit('resetsidepanel') } }) @@ -94,7 +100,13 @@ export class Layout extends Plugin { const current = await this.call('pinnedPanel', 'currentFocus') if (this.enhanced[current]) { this.event.emit('enhancepinnedpanel') - } else { + } + + if (this.maximized[current]) { + this.event.emit('maximisepinnedpanel') + } + + if (!this.enhanced[current] && !this.maximized[current]) { this.event.emit('resetpinnedpanel') } }) diff --git a/libs/remix-ui/app/src/lib/remix-app/components/dragbar/dragbar.tsx b/libs/remix-ui/app/src/lib/remix-app/components/dragbar/dragbar.tsx index e7260500671..7bab81df793 100644 --- a/libs/remix-ui/app/src/lib/remix-app/components/dragbar/dragbar.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/components/dragbar/dragbar.tsx @@ -46,21 +46,17 @@ const DragBar = (props: IRemixDragBarUi) => { if (layoutPosition === 'left') { const width = coeff * window.innerWidth - if (width > refObject.current.offsetWidth) { - props.refObject.current.style.width = width + 'px' - setTimeout(() => { - setDragBarPosX(offset + width) - }, 300) - } + props.refObject.current.style.width = width + 'px' + setTimeout(() => { + setDragBarPosX(offset + width) + }, 300) } else if (layoutPosition === 'right') { const width = coeff * window.innerWidth - if (width > refObject.current.offsetWidth) { - refObject.current.style.width = width + 'px' - setTimeout(() => { - setDragBarPosX(window.innerWidth - width) - }, 300) - } + refObject.current.style.width = width + 'px' + setTimeout(() => { + setDragBarPosX(window.innerWidth - width) + }, 300) } } }