mirror of https://github.com/laurent22/joplin.git
Desktop: Accessibility: Make Markdown toolbar scrollable when low on space (#11636)
parent
c58aac9387
commit
ff465767ab
|
@ -33,6 +33,7 @@ function Toolbar(props: ToolbarProps) {
|
||||||
return (
|
return (
|
||||||
<ToolbarBase
|
<ToolbarBase
|
||||||
style={styles.root}
|
style={styles.root}
|
||||||
|
scrollable={true}
|
||||||
items={props.toolbarButtonInfos}
|
items={props.toolbarButtonInfos}
|
||||||
disabled={!!props.disabled}
|
disabled={!!props.disabled}
|
||||||
aria-label={_('Editor actions')}
|
aria-label={_('Editor actions')}
|
||||||
|
|
|
@ -35,6 +35,7 @@ function NoteToolbar(props: NoteToolbarProps) {
|
||||||
return (
|
return (
|
||||||
<ToolbarBase
|
<ToolbarBase
|
||||||
style={styles.root}
|
style={styles.root}
|
||||||
|
scrollable={false}
|
||||||
items={props.toolbarButtonInfos}
|
items={props.toolbarButtonInfos}
|
||||||
disabled={props.disabled}
|
disabled={props.disabled}
|
||||||
aria-label={_('Note')}
|
aria-label={_('Note')}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { focus } from '@joplin/lib/utils/focusHandler';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
scrollable: boolean;
|
||||||
style: React.CSSProperties;
|
style: React.CSSProperties;
|
||||||
items: ToolbarItem[];
|
items: ToolbarItem[];
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
|
@ -177,7 +178,7 @@ const ToolbarBaseComponent: React.FC<Props> = props => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
className='editor-toolbar'
|
className={`editor-toolbar ${props.scrollable ? '-scrollable' : ''}`}
|
||||||
style={props.style}
|
style={props.style}
|
||||||
|
|
||||||
role='toolbar'
|
role='toolbar'
|
||||||
|
@ -191,7 +192,8 @@ const ToolbarBaseComponent: React.FC<Props> = props => {
|
||||||
<div className='group'>
|
<div className='group'>
|
||||||
{centerItemComps}
|
{centerItemComps}
|
||||||
</div>
|
</div>
|
||||||
<div className='group -right'>
|
<div className='spacer' />
|
||||||
|
<div className='group'>
|
||||||
{rightItemComps}
|
{rightItemComps}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,15 +7,21 @@
|
||||||
padding: var(--joplin-toolbar-padding);
|
padding: var(--joplin-toolbar-padding);
|
||||||
padding-right: var(--joplin-main-padding);
|
padding-right: var(--joplin-main-padding);
|
||||||
|
|
||||||
|
&.-scrollable {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
> .group {
|
> .group {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
min-width: 0;
|
|
||||||
|
|
||||||
&.-right {
|
min-width: 0;
|
||||||
flex: 1;
|
flex-shrink: 0;
|
||||||
justify-content: flex-end;
|
}
|
||||||
}
|
|
||||||
|
> .spacer {
|
||||||
|
flex-grow: 1;
|
||||||
|
min-width: 7px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue