mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: update tooltips in toolbar
This commit is contained in:
parent
3e2dc161f8
commit
555beed47b
@ -96,16 +96,18 @@ class _ToolbarWidgetState extends State<ToolbarWidget> with ToolbarMixin {
|
|||||||
children: [
|
children: [
|
||||||
// _listToolbar(context),
|
// _listToolbar(context),
|
||||||
// _centerToolbarIcon('divider', width: 10),
|
// _centerToolbarIcon('divider', width: 10),
|
||||||
_centerToolbarIcon('bold'),
|
_centerToolbarIcon('bold', tooltipMessage: 'Bold'),
|
||||||
_centerToolbarIcon('italic'),
|
_centerToolbarIcon('italic', tooltipMessage: 'Italic'),
|
||||||
_centerToolbarIcon('strikethrough'),
|
_centerToolbarIcon('strikethrough',
|
||||||
_centerToolbarIcon('underline'),
|
tooltipMessage: 'Strikethrough'),
|
||||||
|
_centerToolbarIcon('underline', tooltipMessage: 'Underline'),
|
||||||
_centerToolbarIcon('divider', width: 2),
|
_centerToolbarIcon('divider', width: 2),
|
||||||
_centerToolbarIcon('quote'),
|
_centerToolbarIcon('quote', tooltipMessage: 'Quote'),
|
||||||
// _centerToolbarIcon('number_list'),
|
// _centerToolbarIcon('number_list'),
|
||||||
_centerToolbarIcon('bulleted_list'),
|
_centerToolbarIcon('bulleted_list',
|
||||||
|
tooltipMessage: 'Bulleted List'),
|
||||||
_centerToolbarIcon('divider', width: 2),
|
_centerToolbarIcon('divider', width: 2),
|
||||||
_centerToolbarIcon('highlight'),
|
_centerToolbarIcon('highlight', tooltipMessage: 'Highlight'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -122,25 +124,27 @@ class _ToolbarWidgetState extends State<ToolbarWidget> with ToolbarMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _centerToolbarIcon(String name,
|
Widget _centerToolbarIcon(String name,
|
||||||
{Key? key, double? width, VoidCallback? onTap}) {
|
{Key? key, String? tooltipMessage, double? width, VoidCallback? onTap}) {
|
||||||
return Tooltip(
|
return Tooltip(
|
||||||
key: key,
|
key: key,
|
||||||
preferBelow: false,
|
preferBelow: false,
|
||||||
message: name,
|
message: tooltipMessage ?? '',
|
||||||
child: GestureDetector(
|
child: MouseRegion(
|
||||||
onTap: onTap ?? () => _onTap(name),
|
cursor: SystemMouseCursors.click,
|
||||||
child: SizedBox.fromSize(
|
child: GestureDetector(
|
||||||
size: width != null
|
onTap: onTap ?? () => _onTap(name),
|
||||||
? Size(width, toolbarHeight)
|
child: SizedBox.fromSize(
|
||||||
: Size.square(toolbarHeight),
|
size: width != null
|
||||||
child: Center(
|
? Size(width, toolbarHeight)
|
||||||
child: FlowySvg(
|
: Size.square(toolbarHeight),
|
||||||
name: 'toolbar/$name',
|
child: Center(
|
||||||
|
child: FlowySvg(
|
||||||
|
name: 'toolbar/$name',
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
));
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onTapListToolbar(BuildContext context) {
|
void _onTapListToolbar(BuildContext context) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user