diff --git a/CHANGELOG.md b/CHANGELOG.md index a6933c4e..affde4e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## 9.0.2-dev.1 +* Add configurations for the new dropdown `QuillToolbarSelectHeaderStyleButton`, you can use the orignal one or this + ## 9.0.2-dev * **Breaking change** Remove the spacer widget, removed the controller option for each button * Add `toolbarRunSpacing` property to the simple toolbar diff --git a/example/lib/presentation/quill/my_quill_toolbar.dart b/example/lib/presentation/quill/my_quill_toolbar.dart index 8430f787..634119d6 100644 --- a/example/lib/presentation/quill/my_quill_toolbar.dart +++ b/example/lib/presentation/quill/my_quill_toolbar.dart @@ -205,7 +205,16 @@ class MyQuillToolbar extends StatelessWidget { base: QuillToolbarBaseButtonOptions( // Request editor focus when any button is pressed afterButtonPressed: focusNode.requestFocus, - globalIconSize: 30, + globalIconSize: 18, + ), + selectHeaderStyleButton: + const QuillToolbarSelectHeaderStyleButtonOptions( + textStyle: TextStyle( + fontSize: 20, + ), + iconTheme: QuillIconTheme( + iconSelectedColor: Colors.red, + ), ), ), customButtons: [ diff --git a/lib/src/models/config/toolbar/buttons/select_header_style_button_configurations.dart b/lib/src/models/config/toolbar/buttons/select_header_style_button_configurations.dart index 7c4d01f6..44c905d3 100644 --- a/lib/src/models/config/toolbar/buttons/select_header_style_button_configurations.dart +++ b/lib/src/models/config/toolbar/buttons/select_header_style_button_configurations.dart @@ -1,3 +1,5 @@ +import 'package:flutter/widgets.dart' show TextStyle; + import '../../../../widgets/toolbar/base_toolbar.dart'; class QuillToolbarSelectHeaderStyleButtonExtraOptions @@ -20,9 +22,11 @@ class QuillToolbarSelectHeaderStyleButtonOptions super.tooltip, this.iconSize, this.iconButtonFactor, + this.textStyle, }); /// By default we will the toolbar axis from [QuillSimpleToolbarConfigurations] final double? iconSize; final double? iconButtonFactor; + final TextStyle? textStyle; } diff --git a/lib/src/models/config/toolbar/simple_toolbar_configurations.dart b/lib/src/models/config/toolbar/simple_toolbar_configurations.dart index ac71f29e..faf9513f 100644 --- a/lib/src/models/config/toolbar/simple_toolbar_configurations.dart +++ b/lib/src/models/config/toolbar/simple_toolbar_configurations.dart @@ -39,6 +39,7 @@ export 'buttons/link_style2_configurations.dart'; export 'buttons/link_style_configurations.dart'; export 'buttons/search_configurations.dart'; export 'buttons/select_alignment_configurations.dart'; +export 'buttons/select_header_style_button_configurations.dart'; export 'buttons/select_header_style_buttons_configurations.dart'; export 'buttons/toggle_check_list_configurations.dart'; export 'buttons/toggle_style_configurations.dart'; diff --git a/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_button.dart b/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_button.dart index d1cd8f26..3c58ac3f 100644 --- a/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_button.dart +++ b/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_button.dart @@ -4,6 +4,7 @@ import '../../../../../translations.dart'; import '../../../../extensions/quill_configurations_ext.dart'; import '../../../../models/config/toolbar/buttons/select_header_style_button_configurations.dart'; import '../../../../models/documents/attribute.dart'; +import '../../../../models/themes/quill_icon_theme.dart'; import '../../../quill/quill_controller.dart'; import '../../base_toolbar.dart'; @@ -123,6 +124,11 @@ class _QuillToolbarSelectHeaderStyleButtonState return iconButtonFactor ?? baseIconFactor ?? kIconButtonFactor; } + QuillIconTheme? get iconTheme { + return widget.options.iconTheme ?? + context.quillToolbarBaseButtonOptions?.iconTheme; + } + @override Widget build(BuildContext context) { return MenuAnchor( @@ -149,7 +155,13 @@ class _QuillToolbarSelectHeaderStyleButtonState icon: Row( mainAxisSize: MainAxisSize.min, children: [ - Text(_label(_selectedItem)), + Text( + _label(_selectedItem), + style: widget.options.textStyle ?? + TextStyle( + fontSize: iconSize / 1.15, + ), + ), Icon( Icons.arrow_drop_down, size: iconSize * iconButtonFactor, diff --git a/version.dart b/version.dart index d3536745..fa0b0038 100644 --- a/version.dart +++ b/version.dart @@ -1 +1 @@ -const version = '9.0.2-dev'; +const version = '9.0.2-dev.1';