mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-3437 (Fix missing title bar on leave fullscreen) (#1285)
* SDA-3437 - Fix missing title bar on leave fullscreen
This commit is contained in:
parent
289dfb42bb
commit
2ef2be7617
@ -4,11 +4,6 @@ exports[`windows title bar should render correctly 1`] = `
|
|||||||
<div
|
<div
|
||||||
id="title-bar"
|
id="title-bar"
|
||||||
onDoubleClick={[Function]}
|
onDoubleClick={[Function]}
|
||||||
style={
|
|
||||||
Object {
|
|
||||||
"display": "flex",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="title-bar-button-container"
|
className="title-bar-button-container"
|
||||||
|
@ -17,8 +17,6 @@ describe('windows title bar', () => {
|
|||||||
const apiName = 'symphony-api';
|
const apiName = 'symphony-api';
|
||||||
const maximizeEventLabel = 'maximize';
|
const maximizeEventLabel = 'maximize';
|
||||||
const unmaximizeEventLabel = 'unmaximize';
|
const unmaximizeEventLabel = 'unmaximize';
|
||||||
const enterFullScreenEventLabel = 'enter-full-screen';
|
|
||||||
const leaveFullScreenEventLabel = 'leave-full-screen';
|
|
||||||
|
|
||||||
it('should render correctly', () => {
|
it('should render correctly', () => {
|
||||||
const wrapper = shallow(React.createElement(WindowsTitleBar));
|
const wrapper = shallow(React.createElement(WindowsTitleBar));
|
||||||
@ -33,16 +31,6 @@ describe('windows title bar', () => {
|
|||||||
expect(spy).toBeCalled();
|
expect(spy).toBeCalled();
|
||||||
expect(spy).nthCalledWith(1, maximizeEventLabel, expect.any(Function));
|
expect(spy).nthCalledWith(1, maximizeEventLabel, expect.any(Function));
|
||||||
expect(spy).nthCalledWith(2, unmaximizeEventLabel, expect.any(Function));
|
expect(spy).nthCalledWith(2, unmaximizeEventLabel, expect.any(Function));
|
||||||
expect(spy).nthCalledWith(
|
|
||||||
3,
|
|
||||||
enterFullScreenEventLabel,
|
|
||||||
expect.any(Function),
|
|
||||||
);
|
|
||||||
expect(spy).nthCalledWith(
|
|
||||||
4,
|
|
||||||
leaveFullScreenEventLabel,
|
|
||||||
expect.any(Function),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call `close` correctly', () => {
|
it('should call `close` correctly', () => {
|
||||||
|
@ -7,7 +7,6 @@ import { i18n } from '../../common/i18n-preload';
|
|||||||
interface IState {
|
interface IState {
|
||||||
title: string;
|
title: string;
|
||||||
isMaximized: boolean;
|
isMaximized: boolean;
|
||||||
isFullScreen: boolean;
|
|
||||||
isDisabled: boolean;
|
isDisabled: boolean;
|
||||||
}
|
}
|
||||||
const TITLE_BAR_NAMESPACE = 'TitleBar';
|
const TITLE_BAR_NAMESPACE = 'TitleBar';
|
||||||
@ -27,7 +26,6 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
|||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
title: document.title || 'Symphony',
|
title: document.title || 'Symphony',
|
||||||
isFullScreen: false,
|
|
||||||
isMaximized: false,
|
isMaximized: false,
|
||||||
isDisabled: false,
|
isDisabled: false,
|
||||||
};
|
};
|
||||||
@ -40,12 +38,6 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
|||||||
ipcRenderer.on('unmaximize', () =>
|
ipcRenderer.on('unmaximize', () =>
|
||||||
this.updateState({ isMaximized: false }),
|
this.updateState({ isMaximized: false }),
|
||||||
);
|
);
|
||||||
ipcRenderer.on('enter-full-screen', () =>
|
|
||||||
this.updateState({ isFullScreen: true }),
|
|
||||||
);
|
|
||||||
ipcRenderer.on('leave-full-screen', () =>
|
|
||||||
this.updateState({ isFullScreen: false }),
|
|
||||||
);
|
|
||||||
|
|
||||||
ipcRenderer.once('disable-action-button', () => {
|
ipcRenderer.once('disable-action-button', () => {
|
||||||
this.updateState({ isDisabled: true });
|
this.updateState({ isDisabled: true });
|
||||||
@ -86,8 +78,7 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
|||||||
* Renders the component
|
* Renders the component
|
||||||
*/
|
*/
|
||||||
public render(): JSX.Element | null {
|
public render(): JSX.Element | null {
|
||||||
const { title, isFullScreen, isDisabled } = this.state;
|
const { title, isDisabled } = this.state;
|
||||||
const style = { display: isFullScreen ? 'none' : 'flex' };
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@ -97,7 +88,6 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
|||||||
? this.eventHandlers.onUnmaximize
|
? this.eventHandlers.onUnmaximize
|
||||||
: this.eventHandlers.onMaximize
|
: this.eventHandlers.onMaximize
|
||||||
}
|
}
|
||||||
style={style}
|
|
||||||
>
|
>
|
||||||
<div className='title-bar-button-container'>
|
<div className='title-bar-button-container'>
|
||||||
<button
|
<button
|
||||||
|
Loading…
Reference in New Issue
Block a user