Electron: Rotate sidebar icon when it is hidden

pull/428/head
Laurent Cozic 2018-04-16 15:32:33 +02:00
parent 02bde2c6e9
commit 984dd6f2c0
2 changed files with 4 additions and 1 deletions

View File

@ -72,9 +72,10 @@ class HeaderComponent extends React.Component {
if (options.iconName) {
const iconStyle = {
fontSize: Math.round(style.fontSize * 1.4),
color: style.color
color: style.color,
};
if (options.title) iconStyle.marginRight = 5;
if (options.iconRotation) iconStyle.transform = 'rotate(' + options.iconRotation + 'deg)';
icon = <i style={iconStyle} className={"fa " + options.iconName}></i>
}

View File

@ -311,6 +311,7 @@ class MainScreenComponent extends React.Component {
headerItems.push({
title: _('Toggle sidebar'),
iconName: 'fa-bars',
iconRotation: this.props.sidebarVisibility ? 0 : 90,
onClick: () => { this.doCommand({ name: 'toggleSidebar'}) }
});
@ -426,6 +427,7 @@ const mapStateToProps = (state) => {
hasDisabledSyncItems: state.hasDisabledSyncItems,
showMissingMasterKeyMessage: state.notLoadedMasterKeys.length && state.masterKeys.length,
selectedFolderId: state.selectedFolderId,
sidebarVisibility: state.sidebarVisibility,
};
};