From 984dd6f2c0bfe83c95500441486dae0341549a43 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 16 Apr 2018 15:32:33 +0200 Subject: [PATCH] Electron: Rotate sidebar icon when it is hidden --- ElectronClient/app/gui/Header.jsx | 3 ++- ElectronClient/app/gui/MainScreen.jsx | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ElectronClient/app/gui/Header.jsx b/ElectronClient/app/gui/Header.jsx index 72b0c7bb7..1fb0f0dfa 100644 --- a/ElectronClient/app/gui/Header.jsx +++ b/ElectronClient/app/gui/Header.jsx @@ -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 = } diff --git a/ElectronClient/app/gui/MainScreen.jsx b/ElectronClient/app/gui/MainScreen.jsx index 50d8e0ddb..1ed236aa0 100644 --- a/ElectronClient/app/gui/MainScreen.jsx +++ b/ElectronClient/app/gui/MainScreen.jsx @@ -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, }; };