1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +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; notesParentType: string;
height: number; height: number;
width: number; width: number;
onContentHeightChange: (sameRow: boolean)=> void;
} }
interface Breakpoints { interface Breakpoints {
@ -179,10 +180,12 @@ function NoteListControls(props: Props) {
if (breakpoint === dynamicBreakpoints.Xl) { if (breakpoint === dynamicBreakpoints.Xl) {
noteControlsRef.current.style.flexDirection = 'row'; noteControlsRef.current.style.flexDirection = 'row';
searchAndSortRef.current.style.flex = '2 1 auto'; searchAndSortRef.current.style.flex = '2 1 auto';
props.onContentHeightChange(true);
} else { } else {
noteControlsRef.current.style.flexDirection = 'column'; noteControlsRef.current.style.flexDirection = 'column';
props.onContentHeightChange(false);
} }
}, [breakpoint, dynamicBreakpoints]); }, [breakpoint, dynamicBreakpoints, props.onContentHeightChange]);
useEffect(() => { useEffect(() => {
CommandService.instance().registerRuntime('focusSearch', focusSearchRuntime(searchBarRef)); CommandService.instance().registerRuntime('focusSearch', focusSearchRuntime(searchBarRef));

View File

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

View File

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

View File

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