mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 01:11:13 -06:00
ELECTRON-771 (Fix custom title bar button titles & localization) (#651)
* ELECTRON-771 - Fix custom title bar button titles * ELECTRON-771 - Update unit test cases
This commit is contained in:
parent
4a7fe58fba
commit
a084735ce5
@ -85,7 +85,7 @@ exports[`windows title bar should render correctly 1`] = `
|
||||
className="title-bar-button"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
title="unMaximize"
|
||||
title="Maximize"
|
||||
>
|
||||
<svg
|
||||
viewBox="0 0 14 10.2"
|
||||
|
@ -146,7 +146,7 @@ describe('windows title bar', () => {
|
||||
|
||||
describe('maximize functions', () => {
|
||||
it('should call `unmaximize` correctly when is not full screen', () => {
|
||||
const titleLabel = 'Maximize';
|
||||
const titleLabel = 'Restore';
|
||||
const unmaximizeFn = 'unmaximize';
|
||||
const customSelector = `button.title-bar-button[title="${titleLabel}"]`;
|
||||
const wrapper = shallow(React.createElement(WindowsTitleBar));
|
||||
@ -160,7 +160,7 @@ describe('windows title bar', () => {
|
||||
|
||||
it('should call `unmaximize` correctly when is full screen', () => {
|
||||
const windowSpyFn = 'setFullScreen';
|
||||
const titleLabel = 'Maximize';
|
||||
const titleLabel = 'Restore';
|
||||
const customSelector = `button.title-bar-button[title="${titleLabel}"]`;
|
||||
const wrapper = shallow(React.createElement(WindowsTitleBar));
|
||||
const instance: any = wrapper.instance();
|
||||
@ -175,7 +175,7 @@ describe('windows title bar', () => {
|
||||
});
|
||||
|
||||
it('should call maximize correctly when it is not in full screen', () => {
|
||||
const titleLabel = 'unMaximize';
|
||||
const titleLabel = 'Maximize';
|
||||
const maximizeFn = 'maximize';
|
||||
const expectedState = { isMaximized: true };
|
||||
const customSelector = `button.title-bar-button[title="${titleLabel}"]`;
|
||||
|
@ -162,7 +162,8 @@
|
||||
"Close": "Close",
|
||||
"Maximize": "Maximize",
|
||||
"Menu": "Menu",
|
||||
"Minimize": "Minimize"
|
||||
"Minimize": "Minimize",
|
||||
"Restore": "Restore"
|
||||
},
|
||||
"Title Bar Style": "Title Bar Style",
|
||||
"Toggle Full Screen": "Toggle Full Screen",
|
||||
|
@ -162,7 +162,8 @@
|
||||
"Close": "Close",
|
||||
"Maximize": "Maximize",
|
||||
"Menu": "Menu",
|
||||
"Minimize": "Minimize"
|
||||
"Minimize": "Minimize",
|
||||
"Restore": "Restore"
|
||||
},
|
||||
"Title Bar Style": "Title Bar Style",
|
||||
"Toggle Full Screen": "Toggle Full Screen",
|
||||
|
@ -162,7 +162,8 @@
|
||||
"Close": "Fermer",
|
||||
"Maximize": "Maximiser",
|
||||
"Menu": "Menu",
|
||||
"Minimize": "Minimiser"
|
||||
"Minimize": "Minimiser",
|
||||
"Restore": "Restaurer"
|
||||
},
|
||||
"Title Bar Style": "Style de la barre de titre",
|
||||
"Toggle Full Screen": "Basculer plein écran",
|
||||
|
@ -162,7 +162,8 @@
|
||||
"Close": "Fermer",
|
||||
"Maximize": "Maximiser",
|
||||
"Menu": "Menu",
|
||||
"Minimize": "Minimiser"
|
||||
"Minimize": "Minimiser",
|
||||
"Restore": "Restaurer"
|
||||
},
|
||||
"Title Bar Style": "Style de la barre de titre",
|
||||
"Toggle Full Screen": "Basculer plein écran",
|
||||
|
@ -162,7 +162,8 @@
|
||||
"Close": "閉じる",
|
||||
"Maximize": "最大化する",
|
||||
"Menu": "メニュー",
|
||||
"Minimize": "最小化する"
|
||||
"Minimize": "最小化する",
|
||||
"Restore": "戻す"
|
||||
},
|
||||
"Title Bar Style": "タイトルバーのスタイル",
|
||||
"Toggle Full Screen": "画面表示を切り替え",
|
||||
|
@ -162,7 +162,8 @@
|
||||
"Close": "閉じる",
|
||||
"Maximize": "最大化する",
|
||||
"Menu": "メニュー",
|
||||
"Minimize": "最小化する"
|
||||
"Minimize": "最小化する",
|
||||
"Restore": "戻す"
|
||||
},
|
||||
"Title Bar Style": "タイトルバーのスタイル",
|
||||
"Toggle Full Screen": "画面表示を切り替え",
|
||||
|
@ -9,6 +9,7 @@ interface IState {
|
||||
isFullScreen: boolean;
|
||||
titleBarHeight: string;
|
||||
}
|
||||
const TITLE_BAR_NAMESPACE = 'TitleBar';
|
||||
|
||||
export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
private readonly window: Electron.BrowserWindow;
|
||||
@ -75,7 +76,7 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
>
|
||||
<div className='title-bar-button-container'>
|
||||
<button
|
||||
title={i18n.t('Menu')()}
|
||||
title={i18n.t('Menu', TITLE_BAR_NAMESPACE)()}
|
||||
className='hamburger-menu-button'
|
||||
onClick={this.eventHandlers.onShowMenu}
|
||||
onMouseDown={this.handleMouseDown}
|
||||
@ -94,7 +95,7 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
<div className='title-bar-button-container'>
|
||||
<button
|
||||
className='title-bar-button'
|
||||
title={i18n.t('Minimize')()}
|
||||
title={i18n.t('Minimize', TITLE_BAR_NAMESPACE)()}
|
||||
onClick={this.eventHandlers.onMinimize}
|
||||
onMouseDown={this.handleMouseDown}
|
||||
>
|
||||
@ -109,7 +110,7 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
<div className='title-bar-button-container'>
|
||||
<button
|
||||
className='title-bar-button'
|
||||
title={i18n.t('Close')()}
|
||||
title={i18n.t('Close', TITLE_BAR_NAMESPACE)()}
|
||||
onClick={this.eventHandlers.onClose}
|
||||
onMouseDown={this.handleMouseDown}
|
||||
>
|
||||
@ -136,7 +137,7 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
return (
|
||||
<button
|
||||
className='title-bar-button'
|
||||
title={i18n.t('Maximize')()}
|
||||
title={i18n.t('Restore', TITLE_BAR_NAMESPACE)()}
|
||||
onClick={this.eventHandlers.onUnmaximize}
|
||||
onMouseDown={this.handleMouseDown}
|
||||
>
|
||||
@ -152,7 +153,7 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
return (
|
||||
<button
|
||||
className='title-bar-button'
|
||||
title={i18n.t('unMaximize')()}
|
||||
title={i18n.t('Maximize', TITLE_BAR_NAMESPACE)()}
|
||||
onClick={this.eventHandlers.onMaximize}
|
||||
onMouseDown={this.handleMouseDown}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user