From ebe06c9c38436a7702c2c7b670d64c46559f5a00 Mon Sep 17 00:00:00 2001 From: anirudh murali <49116134+anihm136@users.noreply.github.com> Date: Fri, 15 May 2020 16:50:56 +0530 Subject: [PATCH] Desktop: Fixes #2865: Make sidebar resizable when note list is not displayed (#2895) Co-authored-by: Laurent Cozic --- ElectronClient/gui/MainScreen.jsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ElectronClient/gui/MainScreen.jsx b/ElectronClient/gui/MainScreen.jsx index 63ff30ef7..ea28e6dbf 100644 --- a/ElectronClient/gui/MainScreen.jsx +++ b/ElectronClient/gui/MainScreen.jsx @@ -605,7 +605,7 @@ class MainScreenComponent extends React.Component { const rowHeight = height - theme.headerHeight - (messageBoxVisible ? this.styles_.messageBox.height : 0); - this.styles_.verticalResizer = { + this.styles_.verticalResizerSidebar = { width: 5, // HACK: For unknown reasons, the resizers are just a little bit taller than the other elements, // making the whole window scroll vertically. So we remove 10 extra pixels here. @@ -613,8 +613,10 @@ class MainScreenComponent extends React.Component { display: 'inline-block', }; + this.styles_.verticalResizerNotelist = Object.assign({}, this.styles_.verticalResizerSidebar); + this.styles_.sideBar = { - width: sidebarWidth - this.styles_.verticalResizer.width, + width: sidebarWidth - this.styles_.verticalResizerSidebar.width, height: rowHeight, display: 'inline-block', verticalAlign: 'top', @@ -623,10 +625,11 @@ class MainScreenComponent extends React.Component { if (isSidebarVisible === false) { this.styles_.sideBar.width = 0; this.styles_.sideBar.display = 'none'; + this.styles_.verticalResizerSidebar.display = 'none'; } this.styles_.noteList = { - width: noteListWidth - this.styles_.verticalResizer.width, + width: noteListWidth - this.styles_.verticalResizerNotelist.width, height: rowHeight, display: 'inline-block', verticalAlign: 'top', @@ -635,7 +638,7 @@ class MainScreenComponent extends React.Component { if (isNoteListVisible === false) { this.styles_.noteList.width = 0; this.styles_.noteList.display = 'none'; - this.styles_.verticalResizer.display = 'none'; + this.styles_.verticalResizerNotelist.display = 'none'; } this.styles_.noteText = { @@ -874,9 +877,9 @@ class MainScreenComponent extends React.Component {
{messageComp} - + - + {pluginDialog}