diff --git a/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/center.svg b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/center.svg new file mode 100644 index 0000000000..ea834a35bd --- /dev/null +++ b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/center.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/h1.svg b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/h1.svg new file mode 100644 index 0000000000..8a87ece4f0 --- /dev/null +++ b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/h1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/h2.svg b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/h2.svg new file mode 100644 index 0000000000..9ce394b0b1 --- /dev/null +++ b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/h2.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/h3.svg b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/h3.svg new file mode 100644 index 0000000000..43af128937 --- /dev/null +++ b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/h3.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/left.svg b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/left.svg new file mode 100644 index 0000000000..b4f2d0101e --- /dev/null +++ b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/left.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/link.svg b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/link.svg new file mode 100644 index 0000000000..612e8377b6 --- /dev/null +++ b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/link.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/right.svg b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/right.svg new file mode 100644 index 0000000000..86a1facaac --- /dev/null +++ b/frontend/app_flowy/packages/appflowy_editor/assets/images/toolbar/right.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/app_flowy/packages/appflowy_editor/lib/src/render/selection/toolbar_widget.dart b/frontend/app_flowy/packages/appflowy_editor/lib/src/render/selection/toolbar_widget.dart index 19ca0101a9..117bf316dc 100644 --- a/frontend/app_flowy/packages/appflowy_editor/lib/src/render/selection/toolbar_widget.dart +++ b/frontend/app_flowy/packages/appflowy_editor/lib/src/render/selection/toolbar_widget.dart @@ -18,9 +18,9 @@ ToolbarEventHandlers defaultToolbarEventHandlers = { 'bulleted_list': (editorState) => formatBulletedList(editorState), 'highlight': (editorState) => formatHighlight(editorState), 'Text': (editorState) => formatText(editorState), - 'H1': (editorState) => formatHeading(editorState, StyleKey.h1), - 'H2': (editorState) => formatHeading(editorState, StyleKey.h2), - 'H3': (editorState) => formatHeading(editorState, StyleKey.h3), + 'h1': (editorState) => formatHeading(editorState, StyleKey.h1), + 'h2': (editorState) => formatHeading(editorState, StyleKey.h2), + 'h3': (editorState) => formatHeading(editorState, StyleKey.h3), }; List defaultListToolbarEventNames = [ @@ -95,7 +95,10 @@ class _ToolbarWidgetState extends State with ToolbarMixin { crossAxisAlignment: CrossAxisAlignment.start, children: [ // _listToolbar(context), - // _centerToolbarIcon('divider', width: 10), + _centerToolbarIcon('h1', tooltipMessage: 'Heading 1'), + _centerToolbarIcon('h2', tooltipMessage: 'Heading 2'), + _centerToolbarIcon('h3', tooltipMessage: 'Heading 3'), + _centerToolbarIcon('divider', width: 2), _centerToolbarIcon('bold', tooltipMessage: 'Bold'), _centerToolbarIcon('italic', tooltipMessage: 'Italic'), _centerToolbarIcon('strikethrough', @@ -134,11 +137,11 @@ class _ToolbarWidgetState extends State with ToolbarMixin { child: GestureDetector( onTap: onTap ?? () => _onTap(name), child: SizedBox.fromSize( - size: width != null - ? Size(width, toolbarHeight) - : Size.square(toolbarHeight), + size: + Size(toolbarHeight - (width != null ? 20 : 0), toolbarHeight), child: Center( child: FlowySvg( + size: Size(width ?? 20, 20), name: 'toolbar/$name', ), ),