diff --git a/src/renderer/components/windows-title-bar.tsx b/src/renderer/components/windows-title-bar.tsx index 4abd70cc..b890f581 100644 --- a/src/renderer/components/windows-title-bar.tsx +++ b/src/renderer/components/windows-title-bar.tsx @@ -52,6 +52,10 @@ export default class WindowsTitleBar extends React.Component<{}, IState> { if (target) { this.observer.observe(target, { attributes: true, childList: true, subtree: true, characterData: true }); } + + setTimeout(() => { + this.updateTitleBar(); + }, 10000); } public componentWillUnmount(): void { @@ -247,15 +251,29 @@ export default class WindowsTitleBar extends React.Component<{}, IState> { private updateTitleBar(): void { const { isFullScreen, titleBarHeight } = this.state; const contentWrapper = document.getElementById('content-wrapper'); - if (!contentWrapper) { + const root = document.getElementById('root'); + const railContainer = document.getElementsByClassName('ReactRail-container-2')[0] as HTMLElement; + const railList = document.getElementsByClassName('railList')[0] as HTMLElement; + if (railContainer) { + railContainer.style.height = isFullScreen ? '100vh' : `calc(100vh - ${titleBarHeight})`; + } else if (railList) { + railList.style.height = isFullScreen ? '100vh' : `calc(100vh - ${titleBarHeight})`; + } + if (!contentWrapper && !root) { document.body.style.marginTop = isFullScreen ? '0px' : titleBarHeight; return; } - contentWrapper.style.marginTop = isFullScreen ? '0px' : titleBarHeight; + if (root) { + root.style.marginTop = isFullScreen ? '0px' : titleBarHeight; + } else if (contentWrapper) { + contentWrapper.style.marginTop = isFullScreen ? '0px' : titleBarHeight; + } if (isFullScreen) { document.body.style.removeProperty('margin-top'); } + + document.body.classList.add('sda-title-bar'); } /** diff --git a/src/renderer/styles/title-bar.less b/src/renderer/styles/title-bar.less index e0d9c690..81288141 100644 --- a/src/renderer/styles/title-bar.less +++ b/src/renderer/styles/title-bar.less @@ -112,9 +112,7 @@ bottom: 0; } -body { - sda-title-bar { - display: flex; - flex-direction: row; - } +.sda-title-bar { + display: flex; + flex-direction: row; }