1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00

Desktop: Fixes #2865: Make sidebar resizable when note list is not displayed (#2895)

Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
This commit is contained in:
anirudh murali 2020-05-15 16:50:56 +05:30 committed by GitHub
parent b3f32ffc59
commit ebe06c9c38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {
<Header style={styles.header} showBackButton={false} items={headerItems} />
{messageComp}
<SideBar style={styles.sideBar} />
<VerticalResizer style={styles.verticalResizer} onDrag={this.sidebar_onDrag} />
<VerticalResizer style={styles.verticalResizerSidebar} onDrag={this.sidebar_onDrag} />
<NoteList style={styles.noteList} />
<VerticalResizer style={styles.verticalResizer} onDrag={this.noteList_onDrag} />
<VerticalResizer style={styles.verticalResizerNotelist} onDrag={this.noteList_onDrag} />
<NoteEditor bodyEditor={bodyEditor} style={styles.noteText} />
{pluginDialog}
</div>