fix width and resizing

pull/5012/head
Your Name 4 months ago committed by Aniket
parent da768f8ef3
commit ad7d250c85
  1. 13
      libs/remix-api/src/lib/plugins/layout-api.ts
  2. 11
      libs/remix-api/src/lib/plugins/pinned-panel-api.ts
  3. 11
      libs/remix-api/src/lib/plugins/sidePanel-api.ts
  4. 6
      libs/remix-api/src/lib/remix-api.ts
  5. 4
      libs/remix-ui/git/src/components/branchHeader.tsx
  6. 17
      libs/remix-ui/git/src/lib/listeners.ts

@ -0,0 +1,13 @@
import { IFilePanel } from '@remixproject/plugin-api'
import { StatusEvents } from '@remixproject/plugin-utils'
export interface ILayoutApi {
events:{
} & StatusEvents
methods: {
maximisePinnedPanel: () => void
maximiseSidePanel: () => void
resetPinnedPanel: () => void
resetSidePanel: () => void
}
}

@ -0,0 +1,11 @@
import { IFilePanel } from '@remixproject/plugin-api'
import { StatusEvents } from '@remixproject/plugin-utils'
export interface IPinnedPanelApi {
events:{
} & StatusEvents
methods: {
currentFocus(): Promise<string>
}
}

@ -0,0 +1,11 @@
import { IFilePanel } from '@remixproject/plugin-api'
import { StatusEvents } from '@remixproject/plugin-utils'
export interface ISidePanelApi {
events:{
focusChanged: (name: string) => void;
} & StatusEvents
methods: {
}
}

@ -8,6 +8,9 @@ import { INotificationApi } from "./plugins/notification-api"
import { ISettings } from "./plugins/settings-api"
import { IFilePanelApi } from "./plugins/filePanel-api"
import { Plugin } from "@remixproject/engine"
import { ISidePanelApi } from "./plugins/sidePanel-api"
import { IPinnedPanelApi } from "./plugins/pinned-panel-api"
import { ILayoutApi } from "./plugins/layout-api"
export interface ICustomRemixApi extends IRemixApi {
dgitApi: IGitApi
@ -17,6 +20,9 @@ export interface ICustomRemixApi extends IRemixApi {
fileDecorator: IFileDecoratorApi
fileManager: IExtendedFileSystem
filePanel: IFilePanelApi
sidePanel: ISidePanelApi
pinnedPanel: IPinnedPanelApi
layout: ILayoutApi
}
export declare type CustomRemixApi = Readonly<ICustomRemixApi>

@ -16,16 +16,12 @@ export const BranchHeader = () => {
actions.getBranchDifferences(context.currentBranch, null, context)
}
if (!context.currentBranch || (context.currentBranch && context.currentBranch.name === '')) {
console.log(context)
if (context.currentHead === '') {
console.log('not detached')
setIsDetached(false)
} else {
console.log('detached')
setIsDetached(true)
}
} else {
console.log('not detached')
setIsDetached(false)
}
setLatestCommit(null)

@ -164,6 +164,23 @@ export const setCallBacks = (viewPlugin: Plugin, gitDispatcher: React.Dispatch<g
setAtivePanel(panelNumber)
})
plugin.on('sidePanel', 'focusChanged', async (name: string) => {
const pinnedPlugin = await plugin.call('pinnedPanel', 'currentFocus')
if (name == 'dgit') {
if (pinnedPlugin === 'dgit') {
plugin.call('layout', 'maximisePinnedPanel')
} else {
plugin.call('layout', 'maximiseSidePanel')
}
} else {
if (pinnedPlugin === 'dgit') {
plugin.call('layout', 'resetPinnedPanel')
} else {
plugin.call('layout', 'resetSidePanel')
}
}
})
callBackEnabled = true;
}

Loading…
Cancel
Save