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

Merge branch 'release-2.10' into dev

This commit is contained in:
Laurent Cozic 2023-03-13 18:48:05 +00:00
commit 0804b62ffb
4 changed files with 17 additions and 6 deletions

View File

@ -26,6 +26,7 @@ interface Props {
notesParentType: string;
height: number;
width: number;
onContentHeightChange: (sameRow: boolean)=> void;
}
interface Breakpoints {
@ -179,10 +180,12 @@ function NoteListControls(props: Props) {
if (breakpoint === dynamicBreakpoints.Xl) {
noteControlsRef.current.style.flexDirection = 'row';
searchAndSortRef.current.style.flex = '2 1 auto';
props.onContentHeightChange(true);
} else {
noteControlsRef.current.style.flexDirection = 'column';
props.onContentHeightChange(false);
}
}, [breakpoint, dynamicBreakpoints]);
}, [breakpoint, dynamicBreakpoints, props.onContentHeightChange]);
useEffect(() => {
CommandService.instance().registerRuntime('focusSearch', focusSearchRuntime(searchBarRef));

View File

@ -1,6 +1,6 @@
import { themeStyle } from '@joplin/lib/theme';
import * as React from 'react';
import { useMemo } from 'react';
import { useMemo, useState } from 'react';
import NoteList from '../NoteList/NoteList';
import NoteListControls from '../NoteListControls/NoteListControls';
import { Size } from '../ResizableLayout/utils/types';
@ -22,7 +22,15 @@ const StyledRoot = styled.div`
export default function NoteListWrapper(props: Props) {
const theme = themeStyle(props.themeId);
const controlHeight = theme.topRowHeight;
const [controlHeight, setControlHeight] = useState(theme.topRowHeight);
const onContentHeightChange = (sameRow: boolean) => {
if (sameRow) {
setControlHeight(theme.topRowHeight);
} else {
setControlHeight(theme.topRowHeight * 2);
}
};
const noteListSize = useMemo(() => {
return {
@ -33,7 +41,7 @@ export default function NoteListWrapper(props: Props) {
return (
<StyledRoot>
<NoteListControls height={controlHeight} width={noteListSize.width}/>
<NoteListControls height={controlHeight} width={noteListSize.width} onContentHeightChange={onContentHeightChange}/>
<NoteList resizableLayoutEventEmitter={props.resizableLayoutEventEmitter} size={noteListSize} visible={props.visible}/>
</StyledRoot>
);

View File

@ -1,6 +1,6 @@
{
"name": "@joplin/app-desktop",
"version": "2.10.9",
"version": "2.10.10",
"description": "Joplin for Desktop",
"main": "main.js",
"private": true,

View File

@ -60,7 +60,7 @@ const globalStyle: any = {
toolbarPadding: 6,
appearance: 'light',
mainPadding: 12,
topRowHeight: 81,
topRowHeight: 50,
editorPaddingLeft: 8,
};